racc 1.4.14 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +5 -5
  2. data/COPYING +22 -515
  3. data/README.ja.rdoc +3 -4
  4. data/README.rdoc +6 -8
  5. data/Rakefile +32 -53
  6. data/bin/racc +39 -27
  7. data/ext/racc/com/headius/racc/Cparse.java +66 -23
  8. data/ext/racc/{cparse.c → cparse/cparse.c} +82 -47
  9. data/ext/racc/{extconf.rb → cparse/extconf.rb} +2 -1
  10. data/lib/racc/compat.rb +5 -4
  11. data/lib/racc/debugflags.rb +5 -4
  12. data/lib/racc/exception.rb +5 -4
  13. data/lib/racc/grammar.rb +25 -22
  14. data/lib/racc/grammarfileparser.rb +10 -8
  15. data/lib/racc/info.rb +6 -5
  16. data/lib/racc/iset.rb +6 -5
  17. data/lib/racc/logfilegenerator.rb +6 -5
  18. data/lib/racc/parser-text.rb +20 -23
  19. data/lib/racc/parser.rb +20 -23
  20. data/lib/racc/parserfilegenerator.rb +10 -10
  21. data/lib/racc/sourcetext.rb +5 -4
  22. data/lib/racc/state.rb +13 -12
  23. data/lib/racc/statetransitiontable.rb +7 -6
  24. data/rdoc/ja/command.ja.html +1 -1
  25. data/sample/array.y +1 -1
  26. data/sample/array2.y +1 -1
  27. data/sample/calc-ja.y +2 -2
  28. data/sample/calc.y +2 -2
  29. data/sample/conflict.y +1 -1
  30. data/sample/hash.y +1 -1
  31. data/sample/lalr.y +1 -1
  32. data/sample/lists.y +1 -1
  33. data/sample/syntax.y +1 -1
  34. data/sample/yyerr.y +1 -1
  35. data/test/assets/cadenza.y +170 -0
  36. data/test/assets/cast.y +926 -0
  37. data/test/assets/csspool.y +729 -0
  38. data/test/assets/edtf.y +583 -0
  39. data/test/assets/huia.y +318 -0
  40. data/test/assets/intp.y +4 -4
  41. data/test/assets/journey.y +47 -0
  42. data/test/assets/liquor.y +313 -0
  43. data/test/assets/machete.y +423 -0
  44. data/test/assets/macruby.y +2197 -0
  45. data/test/assets/mailp.y +27 -27
  46. data/test/assets/mediacloth.y +599 -0
  47. data/test/assets/mof.y +649 -0
  48. data/test/assets/namae.y +302 -0
  49. data/test/assets/nasl.y +626 -0
  50. data/test/assets/nokogiri-css.y +255 -0
  51. data/test/assets/nullbug2.y +2 -2
  52. data/test/assets/opal.y +1807 -0
  53. data/test/assets/php_serialization.y +98 -0
  54. data/test/assets/recv.y +20 -20
  55. data/test/assets/riml.y +665 -0
  56. data/test/assets/ruby18.y +1943 -0
  57. data/test/assets/ruby19.y +2174 -0
  58. data/test/assets/ruby20.y +2350 -0
  59. data/test/assets/ruby21.y +2359 -0
  60. data/test/assets/ruby22.y +2381 -0
  61. data/test/assets/syntax.y +1 -1
  62. data/test/assets/tp_plus.y +622 -0
  63. data/test/assets/twowaysql.y +278 -0
  64. data/test/helper.rb +68 -41
  65. data/test/regress/cadenza +796 -0
  66. data/test/regress/cast +3428 -0
  67. data/test/regress/csspool +2314 -0
  68. data/test/regress/edtf +1794 -0
  69. data/test/regress/huia +1392 -0
  70. data/test/regress/journey +222 -0
  71. data/test/regress/liquor +885 -0
  72. data/test/regress/machete +833 -0
  73. data/test/regress/mediacloth +1463 -0
  74. data/test/regress/mof +1368 -0
  75. data/test/regress/namae +634 -0
  76. data/test/regress/nasl +2058 -0
  77. data/test/regress/nokogiri-css +836 -0
  78. data/test/regress/opal +6431 -0
  79. data/test/regress/php_serialization +336 -0
  80. data/test/regress/riml +3283 -0
  81. data/test/regress/ruby18 +6344 -0
  82. data/test/regress/ruby22 +7460 -0
  83. data/test/regress/tp_plus +1933 -0
  84. data/test/regress/twowaysql +556 -0
  85. data/test/test_chk_y.rb +1 -0
  86. data/test/test_racc_command.rb +177 -2
  87. data/test/test_scan_y.rb +1 -0
  88. data/test/testscanner.rb +1 -1
  89. metadata +59 -83
  90. data/DEPENDS +0 -4
  91. data/Manifest.txt +0 -102
  92. data/bin/racc2y +0 -195
  93. data/bin/y2racc +0 -339
  94. data/ext/racc/depend +0 -1
  95. data/fastcache/extconf.rb +0 -2
  96. data/fastcache/fastcache.c +0 -185
  97. data/misc/dist.sh +0 -31
  98. data/setup.rb +0 -1587
  99. data/tasks/doc.rb +0 -12
  100. data/tasks/email.rb +0 -55
@@ -1,13 +1,14 @@
1
+ #--
2
+ #
1
3
  #
2
- # $Id: 5e1871defa15d288d2252e6a76bb2c4cf2119ed3 $
3
4
  #
4
5
  # Copyright (c) 1999-2006 Minero Aoki
5
6
  #
6
7
  # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU LGPL, Lesser General Public License version 2.1.
9
- # For details of the GNU LGPL, see the file "COPYING".
8
+ # You can distribute/modify this program under the same terms of ruby.
9
+ # see the file "COPYING".
10
10
  #
11
+ #++
11
12
 
12
13
  require 'racc'
13
14
  require 'racc/compat'
@@ -284,9 +285,9 @@ module Racc
284
285
  end
285
286
  label
286
287
  end
287
-
288
+
288
289
  def add_user_code(label, src)
289
- @result.params.send(USER_CODE_LABELS[label]).push src
290
+ @result.params.public_send(USER_CODE_LABELS[label]).push src
290
291
  end
291
292
 
292
293
  end
@@ -295,7 +296,7 @@ module Racc
295
296
  class GrammarFileScanner
296
297
 
297
298
  def initialize(str, filename = '-')
298
- @lines = str.split(/\n|\r\n|\r/)
299
+ @lines = str.b.split(/\n|\r\n|\r/)
299
300
  @filename = filename
300
301
  @lineno = -1
301
302
  @line_head = true
@@ -427,7 +428,7 @@ module Racc
427
428
  $raccs_print_type = false
428
429
 
429
430
  def scan_action
430
- buf = ''
431
+ buf = String.new
431
432
  nest = 1
432
433
  pre = nil
433
434
  @in_block = 'action'
@@ -450,6 +451,7 @@ module Racc
450
451
  nest -= 1
451
452
  if nest == 0
452
453
  @in_block = nil
454
+ buf.sub!(/[ \t\f]+\z/, '')
453
455
  return buf
454
456
  end
455
457
  buf << (pre = ch)
@@ -1,16 +1,17 @@
1
+ #--
2
+ #
1
3
  #
2
- # $Id: 22e498362c014749b453953e8d986243c0b8660c $
3
4
  #
4
5
  # Copyright (c) 1999-2006 Minero Aoki
5
6
  #
6
7
  # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU LGPL, Lesser General Public License version 2.1.
9
- # For details of the GNU LGPL, see the file "COPYING".
8
+ # You can distribute/modify this program under the same terms of ruby.
9
+ # see the file "COPYING".
10
10
  #
11
+ #++
11
12
 
12
13
  module Racc
13
- VERSION = '1.4.14'
14
+ VERSION = '1.5.2'
14
15
  Version = VERSION
15
16
  Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
16
17
  end
@@ -1,13 +1,14 @@
1
+ #--
2
+ #
1
3
  #
2
- # $Id: de638608cfd72d3ed9819d87b65a89ee6a57b589 $
3
4
  #
4
5
  # Copyright (c) 1999-2006 Minero Aoki
5
6
  #
6
7
  # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU LGPL, Lesser General Public License version 2.1.
9
- # For details of the GNU LGPL, see the file "COPYING".
8
+ # You can distribute/modify this program under the same terms of ruby.
9
+ # see the file "COPYING".
10
10
  #
11
+ #++
11
12
 
12
13
  module Racc
13
14
 
@@ -85,7 +86,7 @@ module Racc
85
86
  def dup
86
87
  ISet.new(@set.dup)
87
88
  end
88
-
89
+
89
90
  end # class ISet
90
91
 
91
92
  end # module Racc
@@ -1,13 +1,14 @@
1
+ #--
2
+ #
1
3
  #
2
- # $Id: a7e9663605afdda065d305b250a9805e3bd3fa70 $
3
4
  #
4
5
  # Copyright (c) 1999-2006 Minero Aoki
5
6
  #
6
7
  # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU LGPL, Lesser General Public License version 2.1.
9
- # For details of the GNU LGPL, see the file "COPYING".
8
+ # You can distribute/modify this program under the same terms of ruby.
9
+ # see the file "COPYING".
10
10
  #
11
+ #++
11
12
 
12
13
  module Racc
13
14
 
@@ -132,7 +133,7 @@ module Racc
132
133
  def outact(f, t, act)
133
134
  case act
134
135
  when Shift
135
- f.printf " %-12s shift, and go to state %d\n",
136
+ f.printf " %-12s shift, and go to state %d\n",
136
137
  t.to_s, act.goto_id
137
138
  when Reduce
138
139
  f.printf " %-12s reduce using rule %d (%s)\n",
@@ -1,8 +1,7 @@
1
1
  module Racc
2
2
  PARSER_TEXT = <<'__end_of_file__'
3
- #
4
- # $Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $
5
- #
3
+ # frozen_string_literal: false
4
+ #--
6
5
  # Copyright (c) 1999-2006 Minero Aoki
7
6
  #
8
7
  # This program is free software.
@@ -11,7 +10,7 @@ module Racc
11
10
  # As a special exception, when this code is copied by Racc
12
11
  # into a Racc output file, you may use that output file
13
12
  # without restriction.
14
- #
13
+ #++
15
14
 
16
15
  require 'racc/info'
17
16
 
@@ -32,7 +31,7 @@ end
32
31
  # == Command-line Reference
33
32
  #
34
33
  # racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
35
- # [-e<var>rubypath</var>] [--embedded=<var>rubypath</var>]
34
+ # [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
36
35
  # [-v] [--verbose]
37
36
  # [-O<var>filename</var>] [--log-file=<var>filename</var>]
38
37
  # [-g] [--debug]
@@ -44,8 +43,8 @@ end
44
43
  # [-S] [--output-status]
45
44
  # [--version] [--copyright] [--help] <var>grammarfile</var>
46
45
  #
47
- # [+filename+]
48
- # Racc grammar file. Any extention is permitted.
46
+ # [+grammarfile+]
47
+ # Racc grammar file. Any extension is permitted.
49
48
  # [-o+outfile+, --output-file=+outfile+]
50
49
  # A filename for output. default is <+filename+>.tab.rb
51
50
  # [-O+filename+, --log-file=+filename+]
@@ -61,7 +60,7 @@ end
61
60
  # [-E, --embedded]
62
61
  # Output parser which doesn't need runtime files (racc/parser.rb).
63
62
  # [-C, --check-only]
64
- # Check syntax of racc grammer file and quit.
63
+ # Check syntax of racc grammar file and quit.
65
64
  # [-S, --output-status]
66
65
  # Print messages time to time while compiling.
67
66
  # [-l, --no-line-convert]
@@ -178,49 +177,43 @@ end
178
177
  # This command creates myparser.rb which `includes' Racc runtime.
179
178
  # Only you must do is to distribute your parser file (myparser.rb).
180
179
  #
181
- # Note: parser.rb is LGPL, but your parser is not.
180
+ # Note: parser.rb is ruby license, but your parser is not.
182
181
  # Your own parser is completely yours.
183
182
  module Racc
184
183
 
185
- unless defined?(Racc_No_Extentions)
186
- Racc_No_Extentions = false # :nodoc:
184
+ unless defined?(Racc_No_Extensions)
185
+ Racc_No_Extensions = false # :nodoc:
187
186
  end
188
187
 
189
188
  class Parser
190
189
 
191
190
  Racc_Runtime_Version = ::Racc::VERSION
192
- Racc_Runtime_Revision = '$Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $'
193
-
194
191
  Racc_Runtime_Core_Version_R = ::Racc::VERSION
195
- Racc_Runtime_Core_Revision_R = '$Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $'.split[1]
192
+
196
193
  begin
197
194
  if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
195
+ require 'jruby'
198
196
  require 'racc/cparse-jruby.jar'
199
197
  com.headius.racc.Cparse.new.load(JRuby.runtime, false)
200
198
  else
201
199
  require 'racc/cparse'
202
200
  end
203
- # Racc_Runtime_Core_Version_C = (defined in extention)
204
- Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
201
+
205
202
  unless new.respond_to?(:_racc_do_parse_c, true)
206
203
  raise LoadError, 'old cparse.so'
207
204
  end
208
- if Racc_No_Extentions
205
+ if Racc_No_Extensions
209
206
  raise LoadError, 'selecting ruby version of racc runtime core'
210
207
  end
211
208
 
212
209
  Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc:
213
210
  Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc:
214
211
  Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc:
215
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C # :nodoc:
216
212
  Racc_Runtime_Type = 'c' # :nodoc:
217
213
  rescue LoadError
218
- puts $!
219
- puts $!.backtrace
220
214
  Racc_Main_Parsing_Routine = :_racc_do_parse_rb
221
215
  Racc_YY_Parse_Method = :_racc_yyparse_rb
222
216
  Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
223
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_R
224
217
  Racc_Runtime_Type = 'ruby'
225
218
  end
226
219
 
@@ -269,9 +262,11 @@ puts $!.backtrace
269
262
  # def next_token
270
263
  # @q.shift
271
264
  # end
265
+ class_eval %{
272
266
  def do_parse
273
- __send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
267
+ #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
274
268
  end
269
+ }
275
270
 
276
271
  # The method to fetch next token.
277
272
  # If you use #do_parse method, you must implement #next_token.
@@ -329,9 +324,11 @@ puts $!.backtrace
329
324
  #
330
325
  # RECEIVER#METHOD_ID is a method to get next token.
331
326
  # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
327
+ class_eval %{
332
328
  def yyparse(recv, mid)
333
- __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), false)
329
+ #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
334
330
  end
331
+ }
335
332
 
336
333
  def _racc_yyparse_rb(recv, mid, arg, c_debug)
337
334
  action_table, action_check, action_default, action_pointer,
@@ -1,6 +1,5 @@
1
- #
2
- # $Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $
3
- #
1
+ # frozen_string_literal: false
2
+ #--
4
3
  # Copyright (c) 1999-2006 Minero Aoki
5
4
  #
6
5
  # This program is free software.
@@ -9,7 +8,7 @@
9
8
  # As a special exception, when this code is copied by Racc
10
9
  # into a Racc output file, you may use that output file
11
10
  # without restriction.
12
- #
11
+ #++
13
12
 
14
13
  require 'racc/info'
15
14
 
@@ -30,7 +29,7 @@ end
30
29
  # == Command-line Reference
31
30
  #
32
31
  # racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
33
- # [-e<var>rubypath</var>] [--embedded=<var>rubypath</var>]
32
+ # [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
34
33
  # [-v] [--verbose]
35
34
  # [-O<var>filename</var>] [--log-file=<var>filename</var>]
36
35
  # [-g] [--debug]
@@ -42,8 +41,8 @@ end
42
41
  # [-S] [--output-status]
43
42
  # [--version] [--copyright] [--help] <var>grammarfile</var>
44
43
  #
45
- # [+filename+]
46
- # Racc grammar file. Any extention is permitted.
44
+ # [+grammarfile+]
45
+ # Racc grammar file. Any extension is permitted.
47
46
  # [-o+outfile+, --output-file=+outfile+]
48
47
  # A filename for output. default is <+filename+>.tab.rb
49
48
  # [-O+filename+, --log-file=+filename+]
@@ -59,7 +58,7 @@ end
59
58
  # [-E, --embedded]
60
59
  # Output parser which doesn't need runtime files (racc/parser.rb).
61
60
  # [-C, --check-only]
62
- # Check syntax of racc grammer file and quit.
61
+ # Check syntax of racc grammar file and quit.
63
62
  # [-S, --output-status]
64
63
  # Print messages time to time while compiling.
65
64
  # [-l, --no-line-convert]
@@ -176,49 +175,43 @@ end
176
175
  # This command creates myparser.rb which `includes' Racc runtime.
177
176
  # Only you must do is to distribute your parser file (myparser.rb).
178
177
  #
179
- # Note: parser.rb is LGPL, but your parser is not.
178
+ # Note: parser.rb is ruby license, but your parser is not.
180
179
  # Your own parser is completely yours.
181
180
  module Racc
182
181
 
183
- unless defined?(Racc_No_Extentions)
184
- Racc_No_Extentions = false # :nodoc:
182
+ unless defined?(Racc_No_Extensions)
183
+ Racc_No_Extensions = false # :nodoc:
185
184
  end
186
185
 
187
186
  class Parser
188
187
 
189
188
  Racc_Runtime_Version = ::Racc::VERSION
190
- Racc_Runtime_Revision = '$Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $'
191
-
192
189
  Racc_Runtime_Core_Version_R = ::Racc::VERSION
193
- Racc_Runtime_Core_Revision_R = '$Id: 2bd697d1146b280d8d3878e21e556ef769484a37 $'.split[1]
190
+
194
191
  begin
195
192
  if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
193
+ require 'jruby'
196
194
  require 'racc/cparse-jruby.jar'
197
195
  com.headius.racc.Cparse.new.load(JRuby.runtime, false)
198
196
  else
199
197
  require 'racc/cparse'
200
198
  end
201
- # Racc_Runtime_Core_Version_C = (defined in extention)
202
- Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
199
+
203
200
  unless new.respond_to?(:_racc_do_parse_c, true)
204
201
  raise LoadError, 'old cparse.so'
205
202
  end
206
- if Racc_No_Extentions
203
+ if Racc_No_Extensions
207
204
  raise LoadError, 'selecting ruby version of racc runtime core'
208
205
  end
209
206
 
210
207
  Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc:
211
208
  Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc:
212
209
  Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc:
213
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C # :nodoc:
214
210
  Racc_Runtime_Type = 'c' # :nodoc:
215
211
  rescue LoadError
216
- puts $!
217
- puts $!.backtrace
218
212
  Racc_Main_Parsing_Routine = :_racc_do_parse_rb
219
213
  Racc_YY_Parse_Method = :_racc_yyparse_rb
220
214
  Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
221
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_R
222
215
  Racc_Runtime_Type = 'ruby'
223
216
  end
224
217
 
@@ -267,9 +260,11 @@ puts $!.backtrace
267
260
  # def next_token
268
261
  # @q.shift
269
262
  # end
263
+ class_eval %{
270
264
  def do_parse
271
- __send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
265
+ #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
272
266
  end
267
+ }
273
268
 
274
269
  # The method to fetch next token.
275
270
  # If you use #do_parse method, you must implement #next_token.
@@ -327,9 +322,11 @@ puts $!.backtrace
327
322
  #
328
323
  # RECEIVER#METHOD_ID is a method to get next token.
329
324
  # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
325
+ class_eval %{
330
326
  def yyparse(recv, mid)
331
- __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), false)
327
+ #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
332
328
  end
329
+ }
333
330
 
334
331
  def _racc_yyparse_rb(recv, mid, arg, c_debug)
335
332
  action_table, action_check, action_default, action_pointer,
@@ -1,15 +1,15 @@
1
+ #--
2
+ #
1
3
  #
2
- # $Id: f2d2788af2323ada1913f1dad5fea8aae4cc6830 $
3
4
  #
4
5
  # Copyright (c) 1999-2006 Minero Aoki
5
6
  #
6
7
  # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU LGPL, Lesser General Public License version 2.1.
9
- # For details of the GNU LGPL, see the file "COPYING".
8
+ # You can distribute/modify this program under the same terms of ruby.
9
+ # see the file "COPYING".
10
10
  #
11
+ #++
11
12
 
12
- require 'enumerator'
13
13
  require 'racc/compat'
14
14
  require 'racc/sourcetext'
15
15
  require 'racc/parser-text'
@@ -125,7 +125,7 @@ module Racc
125
125
  line %q[#]
126
126
  line %q[# DO NOT MODIFY!!!!]
127
127
  line %Q[# This file is automatically generated by Racc #{Racc::Version}]
128
- line %Q[# from Racc grammer file "#{@params.filename}".]
128
+ line %Q[# from Racc grammar file "#{@params.filename}".]
129
129
  line %q[#]
130
130
  end
131
131
 
@@ -159,8 +159,8 @@ module Racc
159
159
  cref_pop
160
160
  indent; line "end \# class #{classid}"
161
161
  mods.reverse_each do |mod|
162
- indent; line "end \# module #{mod}"
163
162
  cref_pop
163
+ indent; line "end \# module #{mod}"
164
164
  end
165
165
  end
166
166
 
@@ -237,7 +237,7 @@ module Racc
237
237
  end
238
238
 
239
239
  def unique_separator(id)
240
- sep = "...end #{id}/module_eval..."
240
+ sep = String.new "...end #{id}/module_eval..."
241
241
  while @used_separator.key?(sep)
242
242
  sep.concat sprintf('%02x', rand(255))
243
243
  end
@@ -331,7 +331,7 @@ module Racc
331
331
  # TODO: this can be made a LOT more clean with a simple split/map
332
332
  sep = "\n"
333
333
  nsep = ",\n"
334
- buf = ''
334
+ buf = String.new
335
335
  com = ''
336
336
  ncom = ','
337
337
  co = com
@@ -341,7 +341,7 @@ module Racc
341
341
  if buf.size > 66
342
342
  @f.print sep; sep = nsep
343
343
  @f.print "'", buf, "'"
344
- buf = ''
344
+ buf = String.new
345
345
  co = com
346
346
  end
347
347
  end