racc 1.6.0 → 1.7.0

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
  SHA256:
3
- metadata.gz: c1dc09f1fcbc04e87d099180c64c1566e34c7b1f59c734c60a3760b149bd1a99
4
- data.tar.gz: b74af200ad861ddad78ff850a15d7f1554c032c6e24e46841b40a212ee620a0f
3
+ metadata.gz: 83eaf1d816f42411052e1a42c2e298aacb46e3bdaf26836394627187376376e4
4
+ data.tar.gz: 67d6da502e64593608d7b110c63f80cadecc4cf6ab7042282b773d53f223b34b
5
5
  SHA512:
6
- metadata.gz: 18d137641877399ad7ca6f475405fee151af9975df5f04c894c62ed2cba11835b880da0399a69303f663f772ae2283fdd09ce4dce924463c1df8c739a3e30f29
7
- data.tar.gz: 5bec7de05bc72b35614140184f4619419b488f878206ed44d5e59405cf55045e90bd1b2eacef0501bd8195f9db035802e2f3e8d569812948cd944097a6f800f6
6
+ metadata.gz: 7d9d70abfc3a7845b04eba643c6398924ad4239079d29ab223d67b2d723bebc61500f0fc6c5916fd296b4b1bf6f5928a9788df232b5b5dbe435ff1d0c1f7b1ee
7
+ data.tar.gz: dccad491523703f9c0d95502fee6e75ffeb7535f09e7bea39fd12f676a004ae8385d85a5a2d40e164d85b9e38cbdbfe0b43eba8b22ac19e0727b9a53eb839e6c
data/README.rdoc CHANGED
@@ -1,20 +1,15 @@
1
1
  = Racc
2
2
 
3
- * http://i.loveruby.net/en/projects/racc/
3
+ * https://github.com/ruby/racc
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
7
  Racc is a LALR(1) parser generator.
8
8
  It is written in Ruby itself, and generates Ruby program.
9
9
 
10
- NOTE: Ruby 1.8.x comes with Racc runtime module. You
11
- can run your parsers generated by racc 1.4.x out of the
12
- box.
13
-
14
-
15
10
  == Requirement
16
11
 
17
- * Ruby 1.8.x or later.
12
+ * Ruby 2.5 or later.
18
13
 
19
14
  == Installation
20
15
 
@@ -59,7 +54,7 @@
59
54
  $ ruby calc
60
55
 
61
56
  ... Does it work?
62
- For details of Racc, see HTML documents placed under 'rdoc/en/'
57
+ For details of Racc, see HTML documents placed under 'doc/en/'
63
58
  and sample grammar files under 'sample/'.
64
59
 
65
60
 
@@ -74,7 +69,8 @@
74
69
  == Bug Reports
75
70
 
76
71
  Any kind of bug report is welcome.
77
- If you find a bug of Racc, please email me. Your grammar file,
72
+ If you find a bug of Racc, please report an issue at
73
+ https://github.com/ruby/racc/issues. Your grammar file,
78
74
  debug output generated by "racc -g", are helpful.
79
75
 
80
76
 
@@ -7,8 +7,6 @@
7
7
  This library is free software.
8
8
  You can distribute/modify this program under the same terms of ruby.
9
9
 
10
- $originalId: cparse.c,v 1.8 2006/07/06 11:39:46 aamine Exp $
11
-
12
10
  */
13
11
 
14
12
  #include <ruby.h>
@@ -24,7 +22,7 @@
24
22
  Important Constants
25
23
  ----------------------------------------------------------------------- */
26
24
 
27
- #define RACC_VERSION "1.4.15"
25
+ #define RACC_VERSION "1.6.2"
28
26
 
29
27
  #define DEFAULT_TOKEN -1
30
28
  #define ERROR_TOKEN 1
data/lib/racc/grammar.rb CHANGED
@@ -335,14 +335,14 @@ module Racc
335
335
  if action
336
336
  idbase = "#{type}@#{id}-#{@seqs[type] += 1}"
337
337
  target = _wrap(idbase, "#{idbase}-core", action)
338
- _regist("#{idbase}-core", &block)
338
+ _register("#{idbase}-core", &block)
339
339
  else
340
- target = _regist("#{type}@#{id}", &block)
340
+ target = _register("#{type}@#{id}", &block)
341
341
  end
342
342
  @grammar.intern(target)
343
343
  end
344
344
 
345
- def _regist(target_name)
345
+ def _register(target_name)
346
346
  target = target_name.intern
347
347
  unless _added?(@grammar.intern(target))
348
348
  yield(target).each_rule do |rule|
@@ -993,10 +993,6 @@ module Racc
993
993
  @to_s = '$end'
994
994
  @serialized = 'false'
995
995
  @string = false
996
- when ErrorSymbolValue
997
- @to_s = 'error'
998
- @serialized = 'Object.new'
999
- @string = false
1000
996
  else
1001
997
  raise ArgumentError, "unknown symbol value: #{value.class}"
1002
998
  end
@@ -260,9 +260,9 @@ module Racc
260
260
  _, *blocks = *@scanner.epilogue.split(/^----/)
261
261
  blocks.each do |block|
262
262
  header, *body = block.lines.to_a
263
- label0, pathes = *header.sub(/\A-+/, '').split('=', 2)
263
+ label0, paths = *header.sub(/\A-+/, '').split('=', 2)
264
264
  label = canonical_label(label0)
265
- (pathes ? pathes.strip.split(' ') : []).each do |path|
265
+ (paths ? paths.strip.split(' ') : []).each do |path|
266
266
  add_user_code label, SourceText.new(File.read(path), path, 1)
267
267
  end
268
268
  add_user_code label, SourceText.new(body.join(''), @filename, line + 1)
data/lib/racc/info.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  #++
12
12
 
13
13
  module Racc
14
- VERSION = '1.6.0'
14
+ VERSION = '1.7.0'
15
15
  Version = VERSION
16
16
  Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
17
17
  end
@@ -12,7 +12,28 @@ module Racc
12
12
  # without restriction.
13
13
  #++
14
14
 
15
- require 'racc/info'
15
+ unless $".find {|p| p.end_with?('/racc/info.rb')}
16
+ $".push 'racc/info.rb'
17
+ #--
18
+ #
19
+ #
20
+ #
21
+ # Copyright (c) 1999-2006 Minero Aoki
22
+ #
23
+ # This program is free software.
24
+ # You can distribute/modify this program under the same terms of ruby.
25
+ # see the file "COPYING".
26
+ #
27
+ #++
28
+
29
+ module Racc
30
+ VERSION = '1.6.2'
31
+ Version = VERSION
32
+ Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
33
+ end
34
+
35
+ end
36
+
16
37
 
17
38
  unless defined?(NotImplementedError)
18
39
  NotImplementedError = NotImplementError # :nodoc:
@@ -22,7 +43,7 @@ module Racc
22
43
  class ParseError < StandardError; end
23
44
  end
24
45
  unless defined?(::ParseError)
25
- ParseError = Racc::ParseError
46
+ ParseError = Racc::ParseError # :nodoc:
26
47
  end
27
48
 
28
49
  # Racc is a LALR(1) parser generator.
@@ -262,11 +283,11 @@ module Racc
262
283
  # def next_token
263
284
  # @q.shift
264
285
  # end
265
- class_eval %{
286
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
266
287
  def do_parse
267
288
  #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
268
289
  end
269
- }
290
+ RUBY
270
291
 
271
292
  # The method to fetch next token.
272
293
  # If you use #do_parse method, you must implement #next_token.
@@ -324,11 +345,11 @@ module Racc
324
345
  #
325
346
  # RECEIVER#METHOD_ID is a method to get next token.
326
347
  # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
327
- class_eval %{
348
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
328
349
  def yyparse(recv, mid)
329
350
  #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
330
351
  end
331
- }
352
+ RUBY
332
353
 
333
354
  def _racc_yyparse_rb(recv, mid, arg, c_debug)
334
355
  action_table, action_check, action_default, action_pointer,
data/lib/racc/parser.rb CHANGED
@@ -20,7 +20,7 @@ module Racc
20
20
  class ParseError < StandardError; end
21
21
  end
22
22
  unless defined?(::ParseError)
23
- ParseError = Racc::ParseError
23
+ ParseError = Racc::ParseError # :nodoc:
24
24
  end
25
25
 
26
26
  # Racc is a LALR(1) parser generator.
@@ -260,11 +260,11 @@ module Racc
260
260
  # def next_token
261
261
  # @q.shift
262
262
  # end
263
- class_eval %{
263
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
264
264
  def do_parse
265
265
  #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
266
266
  end
267
- }
267
+ RUBY
268
268
 
269
269
  # The method to fetch next token.
270
270
  # If you use #do_parse method, you must implement #next_token.
@@ -322,11 +322,11 @@ module Racc
322
322
  #
323
323
  # RECEIVER#METHOD_ID is a method to get next token.
324
324
  # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
325
- class_eval %{
325
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
326
326
  def yyparse(recv, mid)
327
327
  #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
328
328
  end
329
- }
329
+ RUBY
330
330
 
331
331
  def _racc_yyparse_rb(recv, mid, arg, c_debug)
332
332
  action_table, action_check, action_default, action_pointer,
@@ -310,8 +310,10 @@ module Racc
310
310
  racc_reduce_n,
311
311
  racc_use_result_var ]
312
312
  End
313
+ line "Ractor.make_shareable(Racc_arg) if defined?(Ractor)"
313
314
  line
314
315
  string_list 'Racc_token_to_s_table', table.token_to_s_table
316
+ line "Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)"
315
317
  line
316
318
  line "Racc_debug_parser = #{table.debug_parser}"
317
319
  line
@@ -216,7 +216,7 @@ module Racc
216
216
  end
217
217
  i = ii
218
218
  end
219
- Regexp.compile(map, 'n')
219
+ Regexp.compile(map, Regexp::NOENCODING)
220
220
  end
221
221
 
222
222
  def set_table(entries, dummy, tbl, chk, ptr)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minero Aoki
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-19 00:00:00.000000000 Z
12
+ date: 2023-06-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: |
15
15
  Racc is a LALR(1) parser generator.
@@ -64,7 +64,7 @@ files:
64
64
  - lib/racc/state.rb
65
65
  - lib/racc/statetransitiontable.rb
66
66
  - lib/racc/static.rb
67
- homepage: https://i.loveruby.net/en/projects/racc/
67
+ homepage: https://github.com/ruby/racc
68
68
  licenses:
69
69
  - Ruby
70
70
  - BSD-2-Clause
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.3.0.dev
89
+ rubygems_version: 3.5.0.dev
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Racc is a LALR(1) parser generator