kaiseki 1.0.4 → 1.0.5
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.
- data/lib/grammar.rb +4 -0
- data/lib/grammar_stub.rb +20 -0
- data/lib/kaiseki.rb +2 -1
- data/lib/parser_repeat.rb +1 -1
- metadata +3 -2
data/lib/grammar.rb
CHANGED
data/lib/grammar_stub.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module Kaiseki
|
2
|
+
class GrammarStub < PackageParser
|
3
|
+
attr_reader :grammar
|
4
|
+
|
5
|
+
def initialize expected, grammar
|
6
|
+
super expected
|
7
|
+
@grammar = grammar
|
8
|
+
end
|
9
|
+
|
10
|
+
def parse! stream, options = {}
|
11
|
+
@expected.parse stream, options.merge(:grammar => @grammar)
|
12
|
+
end
|
13
|
+
|
14
|
+
def eql? other
|
15
|
+
other.is_a?(self.class) and other.expected == @expected and other.grammar == @grammar
|
16
|
+
end
|
17
|
+
|
18
|
+
alias :== :eql?
|
19
|
+
end
|
20
|
+
end
|
data/lib/kaiseki.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Kaiseki
|
2
|
-
VERSION = '1.0.
|
2
|
+
VERSION = '1.0.5'
|
3
3
|
file_path = File.dirname __FILE__
|
4
4
|
|
5
5
|
#load basic kaiseki classes
|
@@ -45,6 +45,7 @@ module Kaiseki
|
|
45
45
|
|
46
46
|
#load grammar classes
|
47
47
|
require file_path + '/grammar'
|
48
|
+
require file_path + '/grammar_stub'
|
48
49
|
require file_path + '/rule'
|
49
50
|
require file_path + '/action'
|
50
51
|
|
data/lib/parser_repeat.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 5
|
9
|
+
version: 1.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- William Hamilton-Levi
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- lib/action.rb
|
50
50
|
- lib/stream.rb
|
51
51
|
- lib/var_insert.rb
|
52
|
+
- lib/grammar_stub.rb
|
52
53
|
- lib/parser_sequence.rb
|
53
54
|
- lib/mod_symbol.rb
|
54
55
|
- lib/parser_eof.rb
|