summaryrefslogtreecommitdiff
path: root/lib/racc/pre-setup
blob: 5027d865b7ff02990cff2470376d220041026753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
def generate_parser_text_rb(target)
  return if File.exist?(srcfile(target))
  $stderr.puts "generating #{target}..."
  File.open(target, 'w') {|f|
    f.puts "module Racc"
    f.puts "  PARSER_TEXT = <<'__end_of_file__'"
    f.puts File.read(srcfile('parser.rb'))
    f.puts "__end_of_file__"
    f.puts "end"
  }
end

generate_parser_text_rb 'parser-text.rb'