mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
completely reorganized for a gem and the 'coffee-script' command
This commit is contained in:
2
test/lexer_test.rb
Normal file
2
test/lexer_test.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
require "lexer"
|
||||
p Lexer.new.tokenize(File.read('code.cs'))
|
||||
19
test/parser_test.rb
Normal file
19
test/parser_test.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
# Recompile the Parser.
|
||||
# With debugging and verbose: -v -g
|
||||
`racc -v -o parser.rb grammar.y`
|
||||
|
||||
# Parse and print the compiled CoffeeScript source.
|
||||
require "parser.rb"
|
||||
js = Parser.new.parse(File.read('code.cs')).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
|
||||
Reference in New Issue
Block a user