calyx 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96d0d3ad96525f74b2526c8ef7d2011655773cb4
4
- data.tar.gz: e6c01ff177c34a1768e215fc2294494689cdf731
3
+ metadata.gz: 37cdacc0c9a70c27bf6ac43e713e2ee0af8e524f
4
+ data.tar.gz: 447e59dddca3f7afc50954ae4b3f1c203a50ee6b
5
5
  SHA512:
6
- metadata.gz: 9ac277b2883c2e2e68ac44bdae1387d2c61ad55353fc0c227f38f70f551916e6a9d3987f40e4ef0815af5eec19082de19596671d516d00593e6884be9ed7057c
7
- data.tar.gz: ab1d40f0c27cabf7064fe39e1c6775e85a6e78592b3c74467fdd43780db4f69c39f4e631442761834f63a297b59d2c0f8f21ce07abc23fd67bcb67e082a8ccbe
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
- @context = {}
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
@@ -1,3 +1,3 @@
1
1
  module Calyx
2
- VERSION = '0.9.2'.freeze
2
+ VERSION = '0.9.3'.freeze
3
3
  end
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.2
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-05 00:00:00.000000000 Z
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
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color