calyx 0.18.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +33 -0
  3. data/calyx.gemspec +2 -2
  4. data/examples/faker.json +1 -0
  5. data/examples/faker.rb +1 -1
  6. data/lib/calyx.rb +12 -8
  7. data/lib/calyx/format.rb +5 -0
  8. data/lib/calyx/grammar.rb +12 -0
  9. data/lib/calyx/mapping.rb +15 -0
  10. data/lib/calyx/modifiers.rb +8 -0
  11. data/lib/calyx/prefix_tree.rb +191 -0
  12. data/lib/calyx/production/affix_table.rb +53 -0
  13. data/lib/calyx/production/uniform_branch.rb +6 -0
  14. data/lib/calyx/production/weighted_branch.rb +6 -0
  15. data/lib/calyx/registry.rb +35 -17
  16. data/lib/calyx/rule.rb +25 -4
  17. data/lib/calyx/{production → syntax}/choices.rb +1 -1
  18. data/lib/calyx/{production → syntax}/concat.rb +18 -22
  19. data/lib/calyx/syntax/expression.rb +87 -0
  20. data/lib/calyx/{production → syntax}/memo.rb +1 -1
  21. data/lib/calyx/{production → syntax}/non_terminal.rb +1 -1
  22. data/lib/calyx/syntax/paired_mapping.rb +53 -0
  23. data/lib/calyx/{production → syntax}/terminal.rb +1 -1
  24. data/lib/calyx/syntax/token.rb +9 -0
  25. data/lib/calyx/{production → syntax}/unique.rb +1 -1
  26. data/lib/calyx/{production → syntax}/weighted_choices.rb +9 -2
  27. data/lib/calyx/version.rb +1 -1
  28. metadata +27 -86
  29. data/.travis.yml +0 -9
  30. data/docs/404.html +0 -7
  31. data/docs/CNAME +0 -1
  32. data/docs/_config.yml +0 -27
  33. data/docs/_data/breadcrumbs.yml +0 -9
  34. data/docs/_data/docs.yml +0 -35
  35. data/docs/_data/examples.yml +0 -9
  36. data/docs/_includes/breadcrumbs.html +0 -36
  37. data/docs/_includes/contents.html +0 -12
  38. data/docs/_includes/icon-github.html +0 -4
  39. data/docs/_includes/icon-rubygems.html +0 -9
  40. data/docs/_includes/navbar.html +0 -24
  41. data/docs/_includes/pagebar.html +0 -12
  42. data/docs/_layouts/default.html +0 -13
  43. data/docs/_layouts/docs.html +0 -14
  44. data/docs/_layouts/home.html +0 -13
  45. data/docs/_layouts/page.html +0 -20
  46. data/docs/_posts/2017-09-14-welcome-to-jekyll.markdown +0 -25
  47. data/docs/_posts/2017-09-21-0.17.0-released.md +0 -10
  48. data/docs/_styles/card.scss +0 -7
  49. data/docs/_styles/colors.scss +0 -18
  50. data/docs/_styles/content.scss +0 -57
  51. data/docs/_styles/cta.scss +0 -25
  52. data/docs/_styles/grid.scss +0 -22
  53. data/docs/_styles/media.scss +0 -50
  54. data/docs/_styles/menu.scss +0 -54
  55. data/docs/_styles/modifiers.scss +0 -3
  56. data/docs/_styles/navbar.scss +0 -161
  57. data/docs/_styles/pagebar.scss +0 -32
  58. data/docs/_styles/reset.scss +0 -92
  59. data/docs/_styles/scale.scss +0 -23
  60. data/docs/_styles/spread.scss +0 -55
  61. data/docs/_styles/styleguide.scss +0 -52
  62. data/docs/_styles/syntax.scss +0 -84
  63. data/docs/_styles/typography.scss +0 -49
  64. data/docs/_styles/yard.scss +0 -36
  65. data/docs/api.html +0 -9662
  66. data/docs/assets/calyx-docs.css +0 -792
  67. data/docs/assets/calyx-flower-outline.svg +0 -202
  68. data/docs/assets/calyx-flower-reverse.svg +0 -202
  69. data/docs/assets/calyx-flower.svg +0 -202
  70. data/docs/assets/logo-small.png +0 -0
  71. data/docs/assets/logos/calyx-flower-1.svg +0 -22
  72. data/docs/assets/logos/calyx-flower-2.svg +0 -21
  73. data/docs/content/documentation.html +0 -20
  74. data/docs/content/examples.html +0 -12
  75. data/docs/content/examples/any-gradient.md +0 -32
  76. data/docs/content/examples/faker.md +0 -16
  77. data/docs/content/examples/tiny-woodland-bot.md +0 -24
  78. data/docs/content/guides/context.md +0 -45
  79. data/docs/content/guides/expressions.md +0 -175
  80. data/docs/content/guides/features.md +0 -50
  81. data/docs/content/guides/formats.md +0 -37
  82. data/docs/content/guides/installation.md +0 -51
  83. data/docs/content/guides/random.md +0 -100
  84. data/docs/content/guides/results.md +0 -62
  85. data/docs/content/index.html +0 -44
  86. data/docs/content/introduction.md +0 -23
  87. data/docs/content/introduction/concepts.md +0 -82
  88. data/docs/content/introduction/contributing.md +0 -43
  89. data/docs/content/introduction/tutorial.md +0 -129
  90. data/docs/content/styleguide.html +0 -71
  91. data/docs/docs.scss +0 -94
  92. data/docs/index.html +0 -12
  93. data/docs/package-lock.json +0 -1536
  94. data/docs/package.json +0 -16
  95. data/examples/faker.yml +0 -42
  96. data/lib/calyx/production/expression.rb +0 -32
@@ -1,50 +0,0 @@
1
- $min-tablet: 768px;
2
- $min-desktop: 1024px;
3
-
4
- @mixin tablet {
5
- @media (min-width: 768px) and (max-width: 1024px) {
6
- @content;
7
- }
8
- }
9
-
10
- @mixin at-least-tablet {
11
- @include at-least($min-tablet) {
12
- @content;
13
- }
14
- }
15
-
16
- @mixin until-tablet {
17
- @include until($min-tablet) {
18
- @content;
19
- }
20
- }
21
-
22
- @mixin at-least-desktop {
23
- @include at-least($min-desktop) {
24
- @content;
25
- }
26
- }
27
-
28
- @mixin desktop {
29
- @media (min-width: 1024px) {
30
- @content;
31
- }
32
- }
33
-
34
- @mixin at-least($device-width) {
35
- @media (min-width: $device-width) {
36
- @content;
37
- }
38
- }
39
-
40
- @mixin until($device-width) {
41
- @media (max-width: $device-width) {
42
- @content;
43
- }
44
- }
45
-
46
- @mixin between($min-width, $max-width) {
47
- @media (min-width: $min-width) and (max-width: $max-width) {
48
- @content;
49
- }
50
- }
@@ -1,54 +0,0 @@
1
- .menu {
2
- width: 100%;
3
- padding-top: $scale-p0;
4
-
5
- .menu-label,
6
- .menu-list li {
7
- @include at-least-tablet {
8
- font-size: $scale-p0;
9
- }
10
-
11
- @include until-tablet {
12
- font-size: $scale-p1;
13
- }
14
- }
15
-
16
- .menu-label {
17
- margin: $scale-p0 0 0 0;
18
- font-weight: 700;
19
- font-family: $font-display-family;
20
-
21
- &:first-child {
22
- margin-top: 0;
23
- }
24
-
25
- a {
26
- display: block;
27
- padding: $scale-m1 $scale-p0;
28
- }
29
- }
30
-
31
- .menu-list {
32
- a {
33
- display: block;
34
- padding: $scale-m1 $scale-p0;
35
- }
36
- }
37
-
38
- .menu-label, .menu-list {
39
- a {
40
- color: $color-sidebar-link;
41
-
42
- &.is-active {
43
- color: $color-white;
44
- background-color: $color-eucalyptus;
45
- }
46
-
47
- &:hover {
48
- &:not(.is-active) {
49
- background-color: $color-sidebar-link-background-hover;
50
- }
51
- }
52
- }
53
- }
54
- }
@@ -1,3 +0,0 @@
1
- .is-hidden {
2
- display: none;
3
- }
@@ -1,161 +0,0 @@
1
- $navbar-height: ($scale-p0 + $scale-m3) * 3;
2
- $navbar-transition-timing: 0.2s;
3
- $color-navbar-hover: darken($color-meadow, 6%);
4
-
5
- .navbar {
6
- width: 100%;
7
- height: $navbar-height;
8
- background-color: $color-meadow;
9
-
10
- @include until-tablet {
11
- //transition: height $navbar-transition-timing ease-in;
12
-
13
- .nav-menu {
14
- visibility: hidden;
15
- }
16
-
17
- &.is-open {
18
- height: 100vh;
19
- //transition: height $navbar-transition-timing ease-in;
20
- overflow-y: scroll;
21
-
22
- .logo {
23
- height: $navbar-height;
24
- background-color: $color-navbar-hover;
25
- }
26
-
27
- .nav-menu {
28
- visibility: visible;
29
- }
30
- }
31
- }
32
-
33
- @include at-least-tablet {
34
- display: flex;
35
- justify-content: space-between;
36
- }
37
-
38
- @include at-least-desktop {
39
- justify-content: space-between;
40
- }
41
-
42
- .nav-toggle {
43
- color: $color-white;
44
- font-size: $scale-p2;
45
- height: $navbar-height;
46
- display: inline-block;
47
- line-height: $scale-p2;
48
-
49
- &:hover {
50
- background-color: $color-navbar-hover;
51
- }
52
-
53
- @include at-least-tablet {
54
- display: none;
55
- }
56
- }
57
-
58
- &.is-fixed {
59
- position: fixed;
60
- top: 0px;
61
- z-index: 2000;
62
- }
63
-
64
- .nav-brand {
65
- @include at-least-tablet {
66
- display: flex;
67
- align-items: center;
68
- }
69
-
70
- @include until-tablet {
71
- width: 100%;
72
-
73
- .nav-menu ul {
74
- justify-content: center;
75
- }
76
- }
77
-
78
- .logo {
79
- height: $navbar-height;
80
- display: flex;
81
- align-items: center;
82
- }
83
-
84
- .logo-mark {
85
- width: 36px;
86
- height: 36px;
87
- padding: $scale-p0 $scale-m1 $scale-p0 $scale-p0;
88
- }
89
-
90
- .logo-type {
91
- color: #fff;
92
- font-family: $font-display-family;
93
- font-weight: 800;
94
- font-size: $scale-p1;
95
- padding-right: $scale-p0;
96
- }
97
- }
98
-
99
- .nav-menu {
100
- @include at-least-desktop {
101
- margin-left: $scale-p3;
102
- }
103
-
104
- &.is-meta {
105
- margin-left: 0;
106
- }
107
-
108
- ul {
109
- @include at-least-tablet {
110
- display: flex;
111
- align-items: center;
112
- }
113
-
114
- li {
115
- font-size: $scale-p0;
116
- line-height: 1.2;
117
- height: $navbar-height;
118
- font-family: $font-display-family;
119
- font-weight: 700;
120
- color: $color-white;
121
-
122
- a {
123
- display: block;
124
- box-sizing: border-box;
125
- padding: $scale-p0 + $scale-m3;
126
- height: $navbar-height;
127
- color: $color-white;
128
-
129
- &:hover {
130
- background-color: $color-navbar-hover;
131
- }
132
-
133
- svg {
134
- display: inline;
135
- }
136
-
137
- span {
138
- display: none;
139
- }
140
- }
141
-
142
- @include until-tablet {
143
- font-size: $scale-p2;
144
- height: auto;
145
-
146
- a {
147
- height: auto;
148
-
149
- svg {
150
- display: none;
151
- }
152
-
153
- span {
154
- display: inline;
155
- }
156
- }
157
- }
158
- }
159
- }
160
- }
161
- }
@@ -1,32 +0,0 @@
1
- $pagebar-height: ($scale-p2 + $scale-p1 + $scale-m2 + $scale-m3);
2
-
3
- .pagebar {
4
- background-color: $color-eucalyptus;
5
- height: $pagebar-height;
6
- color: $color-white;
7
- padding: $scale-p0;
8
-
9
- .breadcrumbs {
10
- display: flex;
11
- align-items: baseline;
12
- justify-content: flex-start;
13
-
14
- li {
15
- margin-right: $scale-m2;
16
- font-size: $scale-m1;
17
-
18
- &:not(:first-child) {
19
- &:before {
20
- content: "/";
21
- margin-right: $scale-m2;
22
- }
23
- }
24
- }
25
- }
26
-
27
- h1 {
28
- margin-top: $scale-m3;
29
- line-height: 1.2;
30
- font-size: $scale-p2;
31
- }
32
- }
@@ -1,92 +0,0 @@
1
- // Via: https://github.com/maetl/highball
2
-
3
- html {
4
- // Setting text-size-adjust to 100% means that fonts don't automatically zoom on mobile browsers
5
- // (but pinch zoom still works).
6
- -ms-text-size-adjust: 100%;
7
- -webkit-text-size-adjust: 100%;
8
- }
9
-
10
- body {
11
- // Remove default margins from the document.
12
- margin: 0;
13
-
14
- // Make the base font size consistent across all browsers.
15
- font-size: 1rem;
16
-
17
- // TODO: what is the best option here?
18
- -moz-osx-font-smoothing: grayscale;
19
- -webkit-font-smoothing: antialiased;
20
- }
21
-
22
- h1,
23
- h2,
24
- h3,
25
- h4,
26
- h5,
27
- h6
28
- p,
29
- blockquote,
30
- figure,
31
- ol,
32
- ul {
33
- // Remove margin and padding from content block elements. This makes it easier to style
34
- // by adding margins and ratios, rather than resetting 0 all over the place.
35
- margin: 0;
36
- padding: 0;
37
- }
38
-
39
- main,
40
- li {
41
- // Strangely, main isn't block level in certain versions of IE. Also, list items not being
42
- // block by default leads to fiddly resets when they're used in nav bars or menus.
43
- display: block;
44
- }
45
-
46
- h1,
47
- h2,
48
- h3,
49
- h4,
50
- h5,
51
- h6 {
52
- // Make font sizes reset
53
- font-size: inherit;
54
- }
55
-
56
- strong {
57
- // Bold, not bolder.
58
- font-weight: bold;
59
- }
60
-
61
- a,
62
- button {
63
- // fixes buttons not inheriting text color in most browsers
64
- color: inherit;
65
- }
66
-
67
- a {
68
- // This is what we want most of the time for apps. Content sites are a little different.
69
- text-decoration: none;
70
- }
71
-
72
- button {
73
- overflow: visible;
74
- border: 0;
75
- font: inherit;
76
- -webkit-font-smoothing: inherit;
77
- letter-spacing: inherit;
78
- background: none;
79
- cursor: pointer;
80
- }
81
-
82
- ::-moz-focus-inner {
83
- // Fix a Firefox WTF.
84
- padding: 0;
85
- border: 0;
86
- }
87
-
88
- img {
89
- max-width: 100%;
90
- height: auto;
91
- border: 0;
92
- }
@@ -1,23 +0,0 @@
1
- // https://github.com/modularscale/modularscale-sass#ratios
2
-
3
- $unit-base: 1rem;
4
-
5
- $ratio-major-twelfth: 1.3;
6
- $ratio-fifth: 1.5;
7
- $ratio-minor-sixth: 1.6;
8
- $ratio-golden: 1.618;
9
- $ratio-augmented-fourth: 1.414;
10
-
11
- $ratio: $ratio-major-twelfth;
12
-
13
- $scale-p0: $unit-base;
14
- $scale-p1: $unit-base * $ratio;
15
- $scale-p2: $unit-base * ($ratio * 2);
16
- $scale-p3: $unit-base * ($ratio * 3);
17
- $scale-p4: $unit-base * ($ratio * 4);
18
-
19
- $scale-m0: $unit-base;
20
- $scale-m1: $unit-base / $ratio;
21
- $scale-m2: $unit-base / ($ratio * 2);
22
- $scale-m3: $unit-base / ($ratio * 3);
23
- $scale-m4: $unit-base / ($ratio * 4);
@@ -1,55 +0,0 @@
1
- .spread {
2
- //height: 100vh;
3
- display: flex;
4
- align-items: center;
5
- padding: $scale-p3 $scale-p3 $scale-p2 $scale-p3;
6
- //justify-content: center;
7
-
8
- &.spread-hero {
9
- background-color: $color-eucalyptus;
10
- color: $color-white;
11
- }
12
-
13
- &.spread-intro {
14
- p {
15
- font-size: $scale-p0;
16
- font-weight: 700;
17
- color: $color-stromboli;
18
- padding-bottom: $scale-p0;
19
- border-bottom: $scale-m4 solid $color-stromboli;
20
- }
21
- }
22
-
23
- .identity {
24
- width: 30%;
25
- display: flex;
26
- align-items: center;
27
- justify-content: center;
28
-
29
- // img {
30
- // animation-name: logospin;
31
- // animation-duration: 5s;
32
- // animation-iteration-count: infinite;
33
- // transform-origin: 50% 50%;
34
- // }
35
- //
36
- // @keyframes logospin {
37
- // 0% {
38
- // transform: rotate(0deg);
39
- // }
40
- // 100% {
41
- // transform: rotate(360deg);
42
- // }
43
- // }
44
- }
45
-
46
- .lede {
47
- width: 60%;
48
-
49
- h2 {
50
- margin-bottom: $scale-p1;
51
- font-size: $scale-p2;
52
- line-height: 1.2;
53
- }
54
- }
55
- }