Debian Codegraph @

ext/ripper/tools/generate-param-macros.rb

raw
1 # frozen_string_literal: true
2 off = true
3 ARGF.each do |line|
4 case line
5 when /RIPPER_PARAMS_DECL_BEGIN/
6 off = false
7 when /RIPPER_PARAMS_DECL_END/
8 exit
9 when /ripper/
10 next if off
11 var = line.scan(/\w+/).last or next
12 base = var.sub(/ripper_/, '')
13 puts %"\#define #{base}\t\t(parser->ripper_#{base})"
14 end
15 end