rley 0.2.05 → 0.2.06
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +4 -0
- data/lib/rley/constants.rb +1 -1
- data/lib/rley/parser/earley_parser.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODgwNTdhMzIwNjhhNWE1ZjE1N2M5ZTgzNjJiNDc3ODU4MWJkODYwMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmZjZjY2NDk3ODExMTlmODcwNmY1ODc2ZmNjZDZjYmEwOTIyNTE3Zg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yjk5NmRjZWIzODJjMjg3NWZkMTY4YjBmYTUxOTJmMWU2ZWNjNGIxYzM5YWQy
|
10
|
+
YTViZGZhOWNiZTNjNWIwMjViNjJlZjA5MDk4MDMyNDBhNTVkNTVjMmMzMTU1
|
11
|
+
YTJjMjk4YTM0NmI2NTdmNjE3OWUzN2M3NjJiYjk0NzkxNDBiNGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2ZlZWZiYzIyYjYzM2Q3YTJhY2YwOWEwMTYwMDEzODc3NWYzNDc5NWIzYjFh
|
14
|
+
M2U4MGY5NGRlYTQ1MGQ2NWVlNDNjMmFkZjRmY2FiOWY5YjNiODZkNmIyMzQw
|
15
|
+
NWMzYmFiY2RmZjhkZjk2ZDUwODQ0YmE5OGMyNmQzNDVlYzhkMWY=
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### 0.2.06 / 2015-03-21
|
2
|
+
* [FIX] Method `EarleyParser#handle_error` portability issue between Ruby versions.
|
3
|
+
|
4
|
+
|
1
5
|
### 0.2.05 / 2015-03-19
|
2
6
|
* [NEW] Class `EarleyParser` implements a crude error detection mechanism. A syntax error causes an exception to be raised.
|
3
7
|
* [CHANGE] Examplar file `parsing_err_expr.rb`: demo error message.
|
data/lib/rley/constants.rb
CHANGED
@@ -208,14 +208,15 @@ module Rley # This module is used as a namespace
|
|
208
208
|
lexeme_at_pos = aParsing.tokens[pos - 1].lexeme
|
209
209
|
|
210
210
|
terminals = aParsing.chart.state_sets[pos - 1].expected_terminals
|
211
|
+
term_names = terminals.map(&:name)
|
211
212
|
err_msg = "Syntax error at or near token #{pos}"
|
212
213
|
err_msg << ">>>#{lexeme_at_pos}<<<:\nExpected "
|
213
214
|
if terminals.size > 1
|
214
|
-
err_msg << "one of: #{
|
215
|
+
err_msg << "one of: ['#{term_names.join("', '")}'],"
|
215
216
|
else
|
216
|
-
err_msg << ": #{
|
217
|
+
err_msg << ": #{term_names[0]},"
|
217
218
|
end
|
218
|
-
err_msg << " found a #{aParsing.tokens[pos-1].terminal} instead."
|
219
|
+
err_msg << " found a '#{aParsing.tokens[pos-1].terminal.name}' instead."
|
219
220
|
fail StandardError, err_msg
|
220
221
|
end
|
221
222
|
end # class
|
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.2.
|
4
|
+
version: 0.2.06
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|