Refactor the scanner to make it more reliable
Raise Curly::SyntaxError on bad syntax
Extract SyntaxError