18 lines
254 B
Ruby
18 lines
254 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
require './rlox/prompt'
|
|
require './rlox/file'
|
|
|
|
case ARGV.length
|
|
when 0 then prompt
|
|
when 1 then
|
|
begin
|
|
file ARGV[0]
|
|
rescue Error => e
|
|
STDERR.puts e
|
|
end
|
|
else
|
|
puts "Usage: rlox [script]"
|
|
exit 64
|
|
end
|