diff options
Diffstat (limited to 'ext/ripper/tools')
-rw-r--r-- | ext/ripper/tools/preproc.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/ripper/tools/preproc.rb b/ext/ripper/tools/preproc.rb index 07ef627cf3..a98a60e319 100644 --- a/ext/ripper/tools/preproc.rb +++ b/ext/ripper/tools/preproc.rb @@ -59,10 +59,9 @@ def prelude(f, out) when /\A%%/ out << "%%\n" return - when /\A%token/, /\A} <node>/ - out << line.sub(/<\w+>/, '<val>') - when /\A%type/ - out << line.sub(/<\w+>/, '<val>') + when /\A%token/, /\A%type/, /\A} <node>/ + # types in %union which have corresponding set_yylval_* macro. + out << line.sub(/<(?:node|num|id)>/, '<val>') when /^enum lex_state_(?:bits|e) \{/ lex_state_def = true out << line |