diff options
Diffstat (limited to 'sample/exyacc.rb')
| -rw-r--r-- | sample/exyacc.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sample/exyacc.rb b/sample/exyacc.rb index 7b37a8b236..cbcc18d58b 100644 --- a/sample/exyacc.rb +++ b/sample/exyacc.rb @@ -1,6 +1,6 @@ #! /usr/local/bin/ruby -Kn # usage: exyacc.rb [yaccfiles] -# this is coverted from exyacc.pl in the camel book +# this is covered from exyacc.pl in the camel book ARGF.each(nil) do |source| sbeg = source.index("\n%%") + 1 @@ -8,7 +8,7 @@ ARGF.each(nil) do |source| grammar = source[sbeg, send-sbeg] grammar.sub!(/.*\n/, "") grammar.gsub!(/'\{'/, "'\001'") - grammar.gsub!(/'\}'/, "'\002'") + grammar.gsub!(/["']\}["']/, "'\002'") grammar.gsub!(%r{\*/}, "\003\003") grammar.gsub!(%r{/\*[^\003]*\003\003}, '') while grammar.gsub!(/\{[^{}]*\}/, ''); end |
