calyx 0.9.2 → 0.9.3
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/lib/calyx/grammar/registry.rb +6 -2
- data/lib/calyx/version.rb +1 -1
- metadata +2 -3
- data/.rspec +0 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37cdacc0c9a70c27bf6ac43e713e2ee0af8e524f
|
|
4
|
+
data.tar.gz: 447e59dddca3f7afc50954ae4b3f1c203a50ee6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2af24d9e1bc92e7ca7020ee26accea4227536878ee819c9099309e9c9889e65e325435af4514f0035882ef10b9b1e049da9abf9beae700256567070b474a8525
|
|
7
|
+
data.tar.gz: a5d36d452cbff0077caf4ce800bd100487002d64004e03fdc34ae54519a97b6a20defef8e3d2fb231b7c84f84dc9605a63255ecdf2ea6b11c4f9f74b61b67a81
|
|
@@ -5,7 +5,6 @@ module Calyx
|
|
|
5
5
|
|
|
6
6
|
def initialize
|
|
7
7
|
@rules = {}
|
|
8
|
-
@memos = {}
|
|
9
8
|
end
|
|
10
9
|
|
|
11
10
|
def method_missing(name, *arguments)
|
|
@@ -29,7 +28,7 @@ module Calyx
|
|
|
29
28
|
end
|
|
30
29
|
|
|
31
30
|
def evaluate(start_symbol=:start, rules_map={})
|
|
32
|
-
|
|
31
|
+
reset_state
|
|
33
32
|
|
|
34
33
|
rules_map.each do |key, value|
|
|
35
34
|
if rules.key?(key.to_sym)
|
|
@@ -48,6 +47,11 @@ module Calyx
|
|
|
48
47
|
|
|
49
48
|
private
|
|
50
49
|
|
|
50
|
+
def reset_state
|
|
51
|
+
@context = {}
|
|
52
|
+
@memos = {}
|
|
53
|
+
end
|
|
54
|
+
|
|
51
55
|
def construct_rule(productions)
|
|
52
56
|
if productions.first.is_a?(Enumerable)
|
|
53
57
|
Production::WeightedChoices.parse(productions, self)
|
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.9.
|
|
4
|
+
version: 0.9.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mark Rickerby
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-05-
|
|
11
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -61,7 +61,6 @@ extensions: []
|
|
|
61
61
|
extra_rdoc_files: []
|
|
62
62
|
files:
|
|
63
63
|
- ".gitignore"
|
|
64
|
-
- ".rspec"
|
|
65
64
|
- ".travis.yml"
|
|
66
65
|
- Gemfile
|
|
67
66
|
- LICENSE
|
data/.rspec
DELETED