Files
coffeescript/parser_test.rb
2009-12-13 23:25:00 -05:00

19 lines
512 B
Ruby

# Recompile the Parser.
# With debugging and verbose: -v -g
`racc -g -o parser.rb grammar.y`
# Parse and print "code.jaa".
require "parser.rb"
js = Parser.new.parse(File.read('code.jaa')).compile
puts "\n\n"
puts js
# Pipe compiled JS through JSLint.
puts "\n\n"
require 'open3'
stdin, stdout, stderr = Open3.popen3('/Users/jashkenas/Library/Application\ Support/TextMate/Bundles/JavaScript\ Tools.tmbundle/Support/bin/jsl -nologo -stdin')
stdin.write(js)
stdin.close
puts stdout.read
stdout.close
stderr.close