calyx 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/calyx/errors.rb +1 -1
- data/lib/calyx/grammar.rb +1 -1
- data/lib/calyx/production/expression.rb +1 -1
- data/lib/calyx/production/non_terminal.rb +6 -1
- data/lib/calyx/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 129a9b8ddec5530b5f427780572e1e0a3a667bd4
|
4
|
+
data.tar.gz: 445ce73db118256bbf9ad748b82421235bb8573d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b31b154440e67f0bde8ba9cd49784aece4ffa971a3b15731f83b05696f44e4db3fc43cdf78ffba990c962c46ac7d71c4964339133a43c202bd651a9066113bd
|
7
|
+
data.tar.gz: 3aded7ee2f7104244b0d47dc0a06a98607f32bdc05e17a1eabf153b1595cca60e17f708cbc2873eb09bb27b16ec6bb445980f23c3b679a76feb669ecb1bcd601
|
data/README.md
CHANGED
@@ -493,7 +493,9 @@ Rough plan for stabilising the API and features for a `1.0` release.
|
|
493
493
|
| `0.11` | ~~support YAML format (and JSON?)~~ |
|
494
494
|
| `0.12` | ~~API documentation~~ |
|
495
495
|
| `0.13` | ~~Support for unique rules~~ |
|
496
|
-
| `0.14` |
|
496
|
+
| `0.14` | ~~Support for Ruby 2.4~~ |
|
497
|
+
| `0.15` | Options config and ‘strict mode’ error handling |
|
498
|
+
| `0.16` | Improve representation of weighted probability selection |
|
497
499
|
|
498
500
|
## Credits
|
499
501
|
|
data/lib/calyx/errors.rb
CHANGED
data/lib/calyx/grammar.rb
CHANGED
@@ -20,7 +20,7 @@ module Calyx
|
|
20
20
|
# @param [Random] random
|
21
21
|
# @return [Array]
|
22
22
|
def evaluate(random)
|
23
|
-
terminal = @production.evaluate(random).flatten.reject { |o| o.is_a?(Symbol) }.join
|
23
|
+
terminal = @production.evaluate(random).flatten.reject { |o| o.is_a?(Symbol) }.join
|
24
24
|
expression = @methods.reduce(terminal) do |value, method|
|
25
25
|
@registry.transform(method, value)
|
26
26
|
end
|
@@ -18,7 +18,12 @@ module Calyx
|
|
18
18
|
# @param [Random] random
|
19
19
|
# @return [Array]
|
20
20
|
def evaluate(random)
|
21
|
-
|
21
|
+
expansion = @registry.expand(@symbol)
|
22
|
+
if expansion.nil?
|
23
|
+
raise Errors::MissingRule.new(@symbol)
|
24
|
+
else
|
25
|
+
[@symbol, expansion.evaluate(random)]
|
26
|
+
end
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|
data/lib/calyx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calyx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickerby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|