Sha256: f7db94ff28724c1ec6bbad22508a72edfa144d9ecdabdff0d3678f441e5f7ee1
Contents?: true
Size: 761 Bytes
Versions: 14
Compression:
Stored size: 761 Bytes
Contents
PARSER = Dir["lib/build-tool/*.y", "lib/build-tool/cfg/*.y"].map { |f| f.chomp(".y") } rule '.rb' => [ '.y' ] do |t| puts "generating #{t.source}" sh "racc -o#{t.name} #{t.source}" end PARSER.each do |parser| # need closure # file "#{parser}.rb" => [ "#{parser}.y" ] task :genfiles => [ "#{parser}.rb" ] end LEXER = Dir["lib/build-tool/*.rex", "lib/build-tool/cfg/*.rex"].map { |f| f.chomp(".rex") } rule '.rb' => [ '.rex' ] do |t| puts "generating #{t.source}" sh "rex -o#{t.name} #{t.source}" end LEXER.each do |lexer| # need closure # file "#{lexer}.rb" => [ "#{lexer}.rex" ] task :genfiles => [ "#{lexer}.rb" ] end task :test => :genfiles desc 'Regenerate all rex and racc files if necessary.' task :genfiles
Version data entries
14 entries across 14 versions & 1 rubygems