rley 0.1.00 → 0.1.01
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 +8 -8
- data/CHANGELOG.md +3 -0
- data/lib/rley/constants.rb +1 -1
- data/spec/rley/parser/parse_state_spec.rb +2 -0
- data/spec/rley/parser/state_set_spec.rb +8 -0
- data/spec/rley/ptree/token_range_spec.rb +23 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDFkMmY0NDg1YzViYzMwYjRmODJhZDg2ZmQ5Mjc4OTljNTMxZjEyZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWJjNzRmZWEzZjc3N2IyMTgxYTQ2ZGNjMGI0ZmI0ODY1NTU4N2Q1NA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTNlOGQ3NjliMDFmNGY2ZDk4NGRjZGYzMjE1NzdhODg0ZWJiNzMwZGE5MjY2
|
10
|
+
MTgwOWI0NjRiMjI3MTBhOGI2NjQ4MWMxNmMyNjM3ODFhYWMzZjlmNzNmYTdm
|
11
|
+
ODk5MDZiZjAxNmJkYTY0YjIyYmI3YWI4YjRlMzEyZDE3YzFjMjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWE0NWIzNThkZWU1YThkN2JjZTg4Y2ZkYTAyNzYyODk3NjIyNGFiZDFlNzlm
|
14
|
+
OTRlMGE1OTQ2ZWI4MTI0ZjJiNzhlNzk3MDNmYWQyNTA5ZGQwNmE0MzMwMDU1
|
15
|
+
NzE4MTZhYzBkYjVhNWQ5ZTBmNGYwNjUxMGEwOTVlZDhiYzUwZTI=
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
### 0.1.01 / 2014-12-06
|
2
|
+
* [CHANGE] Restaured test coverage to above 99%
|
3
|
+
|
1
4
|
### 0.1.00 / 2014-12-05
|
2
5
|
* [CHANGE] Bumped version number: it is the first version able to generate a parse tree.
|
3
6
|
* [NEW] `Grammar#name2symbol` attribute and accessor. Retrieve a grammar symbol from its name.
|
data/lib/rley/constants.rb
CHANGED
@@ -98,6 +98,8 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
98
98
|
state0 = ParseState.new(DottedItem.new(sample_prod, 0), origin_val)
|
99
99
|
expect(state0.precedes?(state1)).to eq(true)
|
100
100
|
expect(state0.precedes?(subject)).to eq(false)
|
101
|
+
state3 = ParseState.new(DottedItem.new(sample_prod, 3), origin_val)
|
102
|
+
expect(state3.precedes?(state0)).to eq(false)
|
101
103
|
end
|
102
104
|
|
103
105
|
it 'should know its text representation' do
|
@@ -72,6 +72,14 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
72
72
|
allow(prod2).to receive(:lhs).and_return(non_term)
|
73
73
|
expect(subject.states_rewriting(non_term)).to eq([state2])
|
74
74
|
end
|
75
|
+
|
76
|
+
it 'should complain when impossible predecessor of parse state' do
|
77
|
+
subject.push_state(state1)
|
78
|
+
subject.push_state(state2)
|
79
|
+
allow(dotted_rule1).to receive(:prev_position).and_return(nil)
|
80
|
+
err = StandardError
|
81
|
+
expect { subject.predecessor_state(state1) }.to raise_error(err)
|
82
|
+
end
|
75
83
|
|
76
84
|
end # context
|
77
85
|
|
@@ -13,7 +13,7 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
13
13
|
subject { TokenRange.new(sample_range) }
|
14
14
|
|
15
15
|
context 'Initialization:' do
|
16
|
-
it '
|
16
|
+
it 'could be created with a range Hash' do
|
17
17
|
# No bounds provided
|
18
18
|
expect { TokenRange.new({}) }.not_to raise_error
|
19
19
|
|
@@ -26,6 +26,20 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
26
26
|
# Both bounds provided
|
27
27
|
expect { TokenRange.new({low: 0, high: 5}) }.not_to raise_error
|
28
28
|
end
|
29
|
+
|
30
|
+
it 'could be created with another TokenRange' do
|
31
|
+
# Low bound provided
|
32
|
+
instance = TokenRange.new({low: 0})
|
33
|
+
expect { TokenRange.new(instance) }.not_to raise_error
|
34
|
+
|
35
|
+
# High bound provided
|
36
|
+
instance = TokenRange.new({high: 5})
|
37
|
+
expect { TokenRange.new(instance) }.not_to raise_error
|
38
|
+
|
39
|
+
# Both bounds provided
|
40
|
+
instance = TokenRange.new({low: 0, high: 5})
|
41
|
+
expect { TokenRange.new(instance) }.not_to raise_error
|
42
|
+
end
|
29
43
|
|
30
44
|
it 'should know its low bound' do
|
31
45
|
expect(subject.low).to eq(0)
|
@@ -37,6 +51,13 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
37
51
|
end # context
|
38
52
|
|
39
53
|
context 'Provided services:' do
|
54
|
+
it 'should compare to another range' do
|
55
|
+
expect(subject == subject).to eq(true)
|
56
|
+
equal = TokenRange.new({low: 0, high: 5})
|
57
|
+
expect(subject == equal).to eq(true)
|
58
|
+
end
|
59
|
+
|
60
|
+
|
40
61
|
it 'should know whether it is bounded or not' do
|
41
62
|
expect(subject).to be_bounded
|
42
63
|
|
@@ -53,7 +74,7 @@ module Rley # Open this namespace to avoid module qualifier prefixes
|
|
53
74
|
expect(instance).not_to be_bounded
|
54
75
|
end
|
55
76
|
|
56
|
-
it 'should assign
|
77
|
+
it 'should assign its open bounds' do
|
57
78
|
some_range = {low: 1, high: 4}
|
58
79
|
|
59
80
|
###########
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rley
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.01
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|