racc 1.4.12 → 1.4.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44ef99c73c5dbebdb4369c0d13edd67a0e7f24c7
4
- data.tar.gz: 04bb0efe7ca54b21954e1ce1ea5f437346c8a0e5
3
+ metadata.gz: 63f4e66898f77de945b0df3b04bab131f7c55aed
4
+ data.tar.gz: 900f1d9ce77c84ea450b5d5f679795c0e0a2cef2
5
5
  SHA512:
6
- metadata.gz: c1cb0384f8e5af6323b2cac552762beda3b43f38a028f183aefcd8ce88813c92e5591c09039018a78553ceb3473da9397bd3e5f5120f9550c19bbd54bef6a005
7
- data.tar.gz: 54a594e4a035a08a96e027833ae1124be562cd2b0cce531b3c66f07e5e39c6c8aa5037127b76e7ae876d68bf777ef75490f865902e7896c348d295fd1794bd5e
6
+ metadata.gz: 07b41103a1d046166af2d748cacc21a6830d5a70b77a91c9dbf8cbc15469fa83d3367ba6cff6057bb63314cecca05fc18cda889839b5e37416ac29aa8b18131a
7
+ data.tar.gz: 1edf22c34ccd8cc533a66d513809f07133124dcf0b778f5c0cd8037ec510d4562dd3df4de6c22bc8fd1cd7b8bfccee0f8b7e406dc9e46f3686be5275d334370f
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ def java?
11
11
  /java/ === RUBY_PLATFORM
12
12
  end
13
13
  def jruby?
14
- 'jruby' == RUBY_ENGINE
14
+ Object.const_defined?(:RUBY_ENGINE) and 'jruby' == RUBY_ENGINE
15
15
  end
16
16
 
17
17
  HOE = Hoe.spec 'racc' do
@@ -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.12"; // TODO: parse from Cparse.c
33
+ public static final String RACC_VERSION = "1.4.13"; // TODO: parse from Cparse.c
34
34
 
35
35
  public enum TokenType {
36
36
  DEFAULT(-1),
@@ -70,8 +70,6 @@ public class Cparse implements Library {
70
70
  private CallSite call_d_read_token;
71
71
  private CallSite call_d_next_state;
72
72
  private CallSite call_d_e_pop;
73
- private AttrWriterMethod set_errstatus;
74
- private AttrReaderMethod get_errstatus;
75
73
 
76
74
  private static RubySymbol value_to_id(ThreadContext context, IRubyObject v) {
77
75
  if (!(v instanceof RubySymbol)) {
@@ -173,7 +171,7 @@ public class Cparse implements Library {
173
171
  this.t = runtime.newFixnum(TokenType.FINAL.id + 1); // must not init to FINAL_TOKEN
174
172
  this.nerr = 0;
175
173
  this.errstatus = 0;
176
- set_errstatus.call(context, parser, parser.getMetaClass(), ID_ERRSTATUS, RubyNumeric.int2fix(runtime, this.errstatus));
174
+ this.parser.setInstanceVariable(ID_ERRSTATUS, runtime.newFixnum(this.errstatus));
177
175
 
178
176
  this.retval = context.nil;
179
177
  this.fin = 0;
@@ -349,7 +347,7 @@ public class Cparse implements Library {
349
347
  D_puts("shift");
350
348
  if (this.errstatus > 0) {
351
349
  this.errstatus--;
352
- set_errstatus.call(context, this.parser, this.parser.getMetaClass(), ID_ERRSTATUS, runtime.newFixnum(this.errstatus));
350
+ this.parser.setInstanceVariable(ID_ERRSTATUS, runtime.newFixnum(this.errstatus));
353
351
  }
354
352
  SHIFT(context, act, this.t, val);
355
353
  read_next = true;
@@ -401,7 +399,7 @@ public class Cparse implements Library {
401
399
  read_next = true;
402
400
  }
403
401
  this.errstatus = 3;
404
- set_errstatus.call(context, this.parser, this.parser.getMetaClass(), ID_ERRSTATUS, runtime.newFixnum(this.errstatus));
402
+ this.parser.setInstanceVariable(ID_ERRSTATUS, runtime.newFixnum(this.errstatus));
405
403
 
406
404
  /* check if we can shift/reduce error token */
407
405
  D_printf("(err) k1=%ld\n", this.curstate);
@@ -498,7 +496,7 @@ public class Cparse implements Library {
498
496
  try {
499
497
  context.pushCatch(rbContinuation.getContinuation());
500
498
  code = reduce0(context);
501
- errstatus = assert_integer(get_errstatus.call(context, parser, parser.getMetaClass(), ID_ERRSTATUS));
499
+ errstatus = assert_integer(parser.getInstanceVariable(ID_ERRSTATUS));
502
500
  } finally {
503
501
  context.popCatch();
504
502
  }
@@ -734,8 +732,14 @@ public class Cparse implements Library {
734
732
  return v.retval;
735
733
  }
736
734
 
735
+ private class LexerUnroll extends RuntimeException {
736
+ public Throwable fillInStackTrace() {
737
+ return this;
738
+ }
739
+ }
740
+
737
741
  private void call_lexer(ThreadContext context, final CparseParams v) {
738
- final int frame = context.getFrameJumpTarget();
742
+ final LexerUnroll lexerUnroll = new LexerUnroll();
739
743
  try {
740
744
  v.call_lexmid.call(context, v.lexer, v.lexer, CallBlock19.newCallClosure(v, v.getMetaClass(), Arity.ONE_ARGUMENT, new BlockCallback() {
741
745
  @Override
@@ -748,14 +752,14 @@ public class Cparse implements Library {
748
752
  v.extract_user_token(context, args[0], tokVal);
749
753
  v.parse_main(context, tokVal[0], tokVal[1], true);
750
754
  if (v.fin != 0 && v.fin != CP_FIN_ACCEPT) {
751
- throw new JumpException.BreakJump(frame, context.nil);
755
+ throw lexerUnroll;
752
756
  }
753
757
 
754
758
  return context.nil;
755
759
  }
756
760
  }, context));
757
- } catch (JumpException.BreakJump bj) {
758
- if (bj.getTarget() == frame) {
761
+ } catch (LexerUnroll maybeOurs) {
762
+ if (maybeOurs == lexerUnroll) {
759
763
  return;
760
764
  }
761
765
  }
@@ -795,10 +799,6 @@ public class Cparse implements Library {
795
799
  call_d_next_state = MethodIndex.getFunctionalCallSite(ID_D_NEXT_STATE);
796
800
  call_d_e_pop = MethodIndex.getFunctionalCallSite(ID_D_E_POP);
797
801
 
798
- // hacky utility for caching instance var accessor
799
- set_errstatus = new AttrWriterMethod(parser, Visibility.PUBLIC, CallConfiguration.FrameNoneScopeNone, ID_ERRSTATUS);
800
- get_errstatus = new AttrReaderMethod(parser, Visibility.PUBLIC, CallConfiguration.FrameNoneScopeNone, ID_ERRSTATUS);
801
-
802
802
  vDEFAULT_TOKEN = runtime.newFixnum(TokenType.DEFAULT.id);
803
803
  vERROR_TOKEN = runtime.newFixnum(TokenType.ERROR.id);
804
804
  vFINAL_TOKEN = runtime.newFixnum(TokenType.FINAL.id);
@@ -17,7 +17,7 @@
17
17
  Important Constants
18
18
  ----------------------------------------------------------------------- */
19
19
 
20
- #define RACC_VERSION "1.4.12"
20
+ #define RACC_VERSION "1.4.13"
21
21
 
22
22
  #define DEFAULT_TOKEN -1
23
23
  #define ERROR_TOKEN 1
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: 90afb43b1438ad2bb681a529146d1cb5cd7e45ac $
2
+ # $Id: 22e498362c014749b453953e8d986243c0b8660c $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -10,7 +10,7 @@
10
10
  #
11
11
 
12
12
  module Racc
13
- VERSION = '1.4.12'
13
+ VERSION = '1.4.13'
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: a7af944d201a32a63d2536cdd589d8e9910848e0 $
4
+ # $Id: f015c335c3b92ed58b32b8fb00163be48783f689 $
5
5
  #
6
6
  # Copyright (c) 1999-2006 Minero Aoki
7
7
  #
@@ -189,12 +189,12 @@ module Racc
189
189
  class Parser
190
190
 
191
191
  Racc_Runtime_Version = ::Racc::VERSION
192
- Racc_Runtime_Revision = '$Id: a7af944d201a32a63d2536cdd589d8e9910848e0 $'
192
+ Racc_Runtime_Revision = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'
193
193
 
194
194
  Racc_Runtime_Core_Version_R = ::Racc::VERSION
195
- Racc_Runtime_Core_Revision_R = '$Id: a7af944d201a32a63d2536cdd589d8e9910848e0 $'.split[1]
195
+ Racc_Runtime_Core_Revision_R = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'.split[1]
196
196
  begin
197
- if RUBY_ENGINE == 'jruby'
197
+ if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
198
198
  require 'racc/cparse-jruby.jar'
199
199
  com.headius.racc.Cparse.new.load(JRuby.runtime, false)
200
200
  else
@@ -1,5 +1,5 @@
1
1
  #
2
- # $Id: a7af944d201a32a63d2536cdd589d8e9910848e0 $
2
+ # $Id: f015c335c3b92ed58b32b8fb00163be48783f689 $
3
3
  #
4
4
  # Copyright (c) 1999-2006 Minero Aoki
5
5
  #
@@ -187,12 +187,12 @@ module Racc
187
187
  class Parser
188
188
 
189
189
  Racc_Runtime_Version = ::Racc::VERSION
190
- Racc_Runtime_Revision = '$Id: a7af944d201a32a63d2536cdd589d8e9910848e0 $'
190
+ Racc_Runtime_Revision = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'
191
191
 
192
192
  Racc_Runtime_Core_Version_R = ::Racc::VERSION
193
- Racc_Runtime_Core_Revision_R = '$Id: a7af944d201a32a63d2536cdd589d8e9910848e0 $'.split[1]
193
+ Racc_Runtime_Core_Revision_R = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'.split[1]
194
194
  begin
195
- if RUBY_ENGINE == 'jruby'
195
+ if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
196
196
  require 'racc/cparse-jruby.jar'
197
197
  com.headius.racc.Cparse.new.load(JRuby.runtime, false)
198
198
  else
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.12
4
+ version: 1.4.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2015-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.12'
61
+ version: '3.14'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.12'
68
+ version: '3.14'
69
69
  description: |-
70
70
  Racc is a LALR(1) parser generator.
71
71
  It is written in Ruby itself, and generates Ruby program.
@@ -92,7 +92,6 @@ extra_rdoc_files:
92
92
  - rdoc/ja/grammar.ja.rdoc
93
93
  - rdoc/ja/parser.ja.rdoc
94
94
  files:
95
- - ".gemtest"
96
95
  - COPYING
97
96
  - ChangeLog
98
97
  - DEPENDS
@@ -216,12 +215,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
215
  version: '0'
217
216
  requirements: []
218
217
  rubyforge_project:
219
- rubygems_version: 2.2.2
218
+ rubygems_version: 2.5.0
220
219
  signing_key:
221
220
  specification_version: 4
222
221
  summary: Racc is a LALR(1) parser generator
223
- test_files:
224
- - test/test_chk_y.rb
225
- - test/test_grammar_file_parser.rb
226
- - test/test_racc_command.rb
227
- - test/test_scan_y.rb
222
+ test_files: []
data/.gemtest DELETED
File without changes