mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
added full complement of bitwise operators
This commit is contained in:
parent
9ba1ffde21
commit
93bdfcb72a
8 changed files with 143 additions and 8 deletions
|
@ -23,6 +23,7 @@ Usage:
|
|||
def initialize
|
||||
@mtimes = {}
|
||||
parse_options
|
||||
return eval_scriptlet if @options[:eval]
|
||||
check_sources
|
||||
@sources.each {|source| compile_javascript(source) }
|
||||
watch_coffee_scripts if @options[:watch]
|
||||
|
@ -88,6 +89,11 @@ Usage:
|
|||
stdout.close and stderr.close
|
||||
end
|
||||
|
||||
# Eval a little piece of CoffeeScript directly from the command line.
|
||||
def eval_scriptlet
|
||||
puts CoffeeScript.compile(@sources.join(' '))
|
||||
end
|
||||
|
||||
# Print the tokens that the lexer generates from a source script.
|
||||
def tokens(source)
|
||||
puts Lexer.new.tokenize(File.read(source)).inspect
|
||||
|
@ -135,6 +141,9 @@ Usage:
|
|||
opts.on('-l', '--lint', 'pipe the compiled JavaScript through JSLint') do |l|
|
||||
@options[:lint] = true
|
||||
end
|
||||
opts.on('-e', '--eval', 'eval a little scriptlet directly from the cli') do |e|
|
||||
@options[:eval] = true
|
||||
end
|
||||
opts.on('-t', '--tokens', 'print the tokens that the lexer produces') do |t|
|
||||
@options[:tokens] = true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue