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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzRiMzQ3MzkwZGMzMDJjZDVlYjVjNGI0YzdmMzE3NDFkOTRkOWM3ZQ==
4
+ ODgwNTdhMzIwNjhhNWE1ZjE1N2M5ZTgzNjJiNDc3ODU4MWJkODYwMA==
5
5
  data.tar.gz: !binary |-
6
- MDJjMDNjNmIxMWVmMDhkZmFjM2U1ZGQ4ZmFkM2ZjYmZjY2IzNzk0Yw==
6
+ YmZjZjY2NDk3ODExMTlmODcwNmY1ODc2ZmNjZDZjYmEwOTIyNTE3Zg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MmUwZGIwYWNkNzJhOWY4M2Y1YzE1MjljN2JmODg3ZWVlODJhYjI0NzRmMzky
10
- NWQ3NzUyM2JhODU5M2I3MzYyY2IyMWMxZTA3ZDQxMTU0ODdmZmY5OTg5YmNi
11
- MWU3OTViYzY3Y2E4NDgyMjhiMmUzNDk2NjY0MTdiYWUwYmFkYTE=
9
+ Yjk5NmRjZWIzODJjMjg3NWZkMTY4YjBmYTUxOTJmMWU2ZWNjNGIxYzM5YWQy
10
+ YTViZGZhOWNiZTNjNWIwMjViNjJlZjA5MDk4MDMyNDBhNTVkNTVjMmMzMTU1
11
+ YTJjMjk4YTM0NmI2NTdmNjE3OWUzN2M3NjJiYjk0NzkxNDBiNGU=
12
12
  data.tar.gz: !binary |-
13
- ZjAwNmI4MjNmNDEyOWZlMDM4YjA2YzM3MTBhMjc0MTcyZjliYjc3NWU0ZWIy
14
- YjM2OTQzYWVkMDlhMGRkNmQ2OWNhYzhkM2IyNjNlNGNlMzEzMDA3MDYzM2Zj
15
- ZTNmOTFjZTcyODRiNjAyNjMwNjQ3MzQ4ZDUyOTMyMGI4NTkxYjc=
13
+ M2ZlZWZiYzIyYjYzM2Q3YTJhY2YwOWEwMTYwMDEzODc3NWYzNDc5NWIzYjFh
14
+ M2U4MGY5NGRlYTQ1MGQ2NWVlNDNjMmFkZjRmY2FiOWY5YjNiODZkNmIyMzQw
15
+ NWMzYmFiY2RmZjhkZjk2ZDUwODQ0YmE5OGMyNmQzNDVlYzhkMWY=
@@ -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.
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Rley # Module used as a namespace
5
5
  # The version number of the gem.
6
- Version = '0.2.05'
6
+ Version = '0.2.06'
7
7
 
8
8
  # Brief description of the gem.
9
9
  Description = "Ruby implementation of the Earley's parsing algorithm"
@@ -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: #{terminals},"
215
+ err_msg << "one of: ['#{term_names.join("', '")}'],"
215
216
  else
216
- err_msg << ": #{terminals[0]},"
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.05
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-19 00:00:00.000000000 Z
11
+ date: 2015-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake