racc 1.4.13-java → 1.4.14-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4fc725ef77f34fbb5b4dccd7f231a842b8bfd7c
4
- data.tar.gz: 685f8318b917162f0a07beac64ebd41960d78203
3
+ metadata.gz: 681c95b1332a75dbfee93167ec7bf86c0c517b1f
4
+ data.tar.gz: 0dab7c12b7c6c1c8c5e2fd79a0637ce96dd1542a
5
5
  SHA512:
6
- metadata.gz: 4fe9b8ec6a5d373eda60d79db37d8c3a43065ba5ffd34ddddf8207afd2055ab246067b706dac6e3969de49195f38307303142749a93a2efcd7bc612dc366c80f
7
- data.tar.gz: 83894982df218989c2556874dfcff4e2dccbc226af7e31ad98c235f90ade5330991a40e165137c85276925e3a7c6e71c52e45421237e473baf6e0d12b33c01d8
6
+ metadata.gz: 7516f3e60e718065087662ee30e66c269683bc64e0f4be03b78609c60b7a21bdeecaccc39a3ec0d205e6de6e273d780abb0b2b419d0773c0e065c7c71b93e64c
7
+ data.tar.gz: 830e23296524399742599fb6a93f4ad51f551167659b35c08f6727d1243dcd77a5a792d93bff88fae6b490b26afa5a5482cf7f93472a62cd64b0375f67a10a63
@@ -61,6 +61,7 @@ test/assets/conf.y
61
61
  test/assets/digraph.y
62
62
  test/assets/echk.y
63
63
  test/assets/err.y
64
+ test/assets/error_recovery.y
64
65
  test/assets/expect.y
65
66
  test/assets/firstline.y
66
67
  test/assets/ichk.y
@@ -30,7 +30,7 @@ import org.jruby.runtime.builtin.IRubyObject;
30
30
  import org.jruby.runtime.load.Library;
31
31
 
32
32
  public class Cparse implements Library {
33
- public static final String RACC_VERSION = "1.4.13"; // TODO: parse from Cparse.c
33
+ public static final String RACC_VERSION = "1.4.14"; // TODO: parse from Cparse.c
34
34
 
35
35
  public enum TokenType {
36
36
  DEFAULT(-1),
@@ -17,7 +17,7 @@
17
17
  Important Constants
18
18
  ----------------------------------------------------------------------- */
19
19
 
20
- #define RACC_VERSION "1.4.13"
20
+ #define RACC_VERSION "1.4.14"
21
21
 
22
22
  #define DEFAULT_TOKEN -1
23
23
  #define ERROR_TOKEN 1
Binary file
@@ -10,7 +10,7 @@
10
10
  #
11
11
 
12
12
  module Racc
13
- VERSION = '1.4.13'
13
+ VERSION = '1.4.14'
14
14
  Version = VERSION
15
15
  Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
16
16
  end
@@ -1,7 +1,7 @@
1
1
  module Racc
2
2
  PARSER_TEXT = <<'__end_of_file__'
3
3
  #
4
- # $Id: f015c335c3b92ed58b32b8fb00163be48783f689 $
4
+ # $Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $
5
5
  #
6
6
  # Copyright (c) 1999-2006 Minero Aoki
7
7
  #
@@ -189,10 +189,10 @@ module Racc
189
189
  class Parser
190
190
 
191
191
  Racc_Runtime_Version = ::Racc::VERSION
192
- Racc_Runtime_Revision = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'
192
+ Racc_Runtime_Revision = '$Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $'
193
193
 
194
194
  Racc_Runtime_Core_Version_R = ::Racc::VERSION
195
- Racc_Runtime_Core_Revision_R = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'.split[1]
195
+ Racc_Runtime_Core_Revision_R = '$Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $'.split[1]
196
196
  begin
197
197
  if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
198
198
  require 'racc/cparse-jruby.jar'
@@ -398,7 +398,7 @@ puts $!.backtrace
398
398
  # shift
399
399
  #
400
400
  if @racc_error_status > 0
401
- @racc_error_status -= 1 unless @racc_t == 1 # error token
401
+ @racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
402
402
  end
403
403
  @racc_vstack.push @racc_val
404
404
  @racc_state.push act
@@ -447,6 +447,8 @@ puts $!.backtrace
447
447
  end
448
448
  when 3
449
449
  if @racc_t == 0 # is $
450
+ # We're at EOF, and another error occurred immediately after
451
+ # attempting auto-recovery
450
452
  throw :racc_end_parse, nil
451
453
  end
452
454
  @racc_read_next = true
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: f015c335c3b92ed58b32b8fb00163be48783f689 $
2
+ # $Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -187,10 +187,10 @@ module Racc
187
187
  class Parser
188
188
 
189
189
  Racc_Runtime_Version = ::Racc::VERSION
190
- Racc_Runtime_Revision = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'
190
+ Racc_Runtime_Revision = '$Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $'
191
191
 
192
192
  Racc_Runtime_Core_Version_R = ::Racc::VERSION
193
- Racc_Runtime_Core_Revision_R = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'.split[1]
193
+ Racc_Runtime_Core_Revision_R = '$Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $'.split[1]
194
194
  begin
195
195
  if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
196
196
  require 'racc/cparse-jruby.jar'
@@ -396,7 +396,7 @@ puts $!.backtrace
396
396
  # shift
397
397
  #
398
398
  if @racc_error_status > 0
399
- @racc_error_status -= 1 unless @racc_t == 1 # error token
399
+ @racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
400
400
  end
401
401
  @racc_vstack.push @racc_val
402
402
  @racc_state.push act
@@ -445,6 +445,8 @@ puts $!.backtrace
445
445
  end
446
446
  when 3
447
447
  if @racc_t == 0 # is $
448
+ # We're at EOF, and another error occurred immediately after
449
+ # attempting auto-recovery
448
450
  throw :racc_end_parse, nil
449
451
  end
450
452
  @racc_read_next = true
@@ -0,0 +1,35 @@
1
+ # Regression test case for the bug discussed here:
2
+ # https://github.com/whitequark/parser/issues/93
3
+ # In short, a Racc-generated parser could go into an infinite loop when
4
+ # attempting error recovery at EOF
5
+
6
+ class InfiniteLoop
7
+
8
+ rule
9
+
10
+ stmts: stmt
11
+ | error stmt
12
+
13
+ stmt: '%' stmt
14
+
15
+ end
16
+
17
+ ---- inner
18
+
19
+ def parse
20
+ @errors = []
21
+ do_parse
22
+ end
23
+
24
+ def next_token
25
+ nil
26
+ end
27
+
28
+ def on_error(error_token, error_value, value_stack)
29
+ # oh my, an error
30
+ @errors << [error_token, error_value]
31
+ end
32
+
33
+ ---- footer
34
+
35
+ InfiniteLoop.new.parse
@@ -3,6 +3,7 @@ require 'minitest/autorun'
3
3
  require 'racc/static'
4
4
  require 'fileutils'
5
5
  require 'tempfile'
6
+ require 'timeout'
6
7
 
7
8
  module Racc
8
9
  class TestCase < MiniTest::Unit::TestCase
@@ -151,5 +151,14 @@ module Racc
151
151
  assert_compile 'unterm.y'
152
152
  }
153
153
  end
154
+
155
+ # Regression test for a problem where error recovery at EOF would cause
156
+ # a Racc-generated parser to go into an infinite loop (on some grammars)
157
+ def test_error_recovery_y
158
+ assert_compile 'error_recovery.y'
159
+ Timeout.timeout(10) do
160
+ assert_exec 'error_recovery.y'
161
+ end
162
+ end
154
163
  end
155
164
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.13
4
+ version: 1.4.14
5
5
  platform: java
6
6
  authors:
7
7
  - Aaron Patterson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-16 00:00:00.000000000 Z
11
+ date: 2015-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -156,6 +156,7 @@ files:
156
156
  - test/assets/digraph.y
157
157
  - test/assets/echk.y
158
158
  - test/assets/err.y
159
+ - test/assets/error_recovery.y
159
160
  - test/assets/expect.y
160
161
  - test/assets/firstline.y
161
162
  - test/assets/ichk.y