lib/import/shake_grammar/lexer.rb in tracksperanto-2.6.1 vs lib/import/shake_grammar/lexer.rb in tracksperanto-2.6.2

- old
+ new

@@ -1,7 +1,7 @@ module Tracksperanto::ShakeGrammar - class WrongInput < RuntimeError; end + class WrongInputError < RuntimeError; end # Since Shake uses a C-like language for it's scripts we rig up a very sloppy # but concise C-like lexer to cope class Lexer @@ -39,14 +39,14 @@ def parse c = @io.read(1) if @buf.length > MAX_BUFFER_SIZE # Wrong format and the buffer is filled up, bail - raise WrongInput, "Atom buffer overflow at #{MAX_BUFFER_SIZE} bytes, this is definitely not a Shake script" + raise WrongInputError, "Atom buffer overflow at #{MAX_BUFFER_SIZE} bytes, this is definitely not a Shake script" end if @stack_depth > MAX_STACK_DEPTH # Wrong format - parentheses overload - raise WrongInput, "Stack overflow at level #{MAX_STACK_DEPTH}, this is probably a LISP program uploaded by accident" + raise WrongInputError, "Stack overflow at level #{MAX_STACK_DEPTH}, this is probably a LISP program uploaded by accident" end if c == '/' && (@buf[-1].chr rescue nil) == '/' # Comment start # If some other data from this line has been accumulated we first consume that @buf = @buf[0..-2] # everything except the opening slash of the comment \ No newline at end of file