mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
multiline strings
This commit is contained in:
@@ -30,6 +30,7 @@ Usage:
|
||||
|
||||
def compile_javascript
|
||||
@sources.each do |source|
|
||||
next tokens(source) if @options[:tokens]
|
||||
contents = CoffeeScript.compile(File.open(source))
|
||||
next puts(contents) if @options[:print]
|
||||
next lint(contents) if @options[:lint]
|
||||
@@ -55,6 +56,10 @@ Usage:
|
||||
stdout.close and stderr.close
|
||||
end
|
||||
|
||||
def tokens(source)
|
||||
puts Lexer.new.tokenize(File.read(source)).inspect
|
||||
end
|
||||
|
||||
# Write out JavaScript alongside CoffeeScript unless an output directory
|
||||
# is specified.
|
||||
def path_for(source)
|
||||
@@ -76,6 +81,9 @@ Usage:
|
||||
opts.on('-l', '--lint', 'pipe the compiled javascript through JSLint') do |l|
|
||||
@options[:lint] = true
|
||||
end
|
||||
opts.on('-t', '--tokens', 'print the tokens that the lexer produces') do |t|
|
||||
@options[:tokens] = true
|
||||
end
|
||||
opts.on_tail('-v', '--version', 'display coffee-script version') do
|
||||
puts "coffee-script version #{CoffeeScript::VERSION}"
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user