better error reporting for parser
This commit is contained in:
@ -5,7 +5,7 @@ module Ticker
|
||||
|
||||
def setup
|
||||
machine = Register.machine.boot
|
||||
syntax = Parser::Salama.new.parse_with_debug(@string_input)
|
||||
syntax = Parser::Salama.new.parse_with_debug(@string_input, reporter: Parslet::ErrorReporter::Deepest.new)
|
||||
parts = Parser::Transform.new.apply(syntax)
|
||||
#puts parts.inspect
|
||||
Soml.compile( parts )
|
||||
|
@ -19,7 +19,7 @@ module ExpressionHelper
|
||||
machine.boot unless machine.booted
|
||||
parser = Parser::Salama.new
|
||||
parser = parser.send @root
|
||||
syntax = parser.parse_with_debug(@string_input)
|
||||
syntax = parser.parse_with_debug(@string_input, reporter: Parslet::ErrorReporter::Deepest.new)
|
||||
parts = Parser::Transform.new.apply(syntax)
|
||||
#puts parts.inspect
|
||||
compiler = Soml::Compiler.new
|
||||
|
@ -21,7 +21,7 @@ class TestRunner < MiniTest::Test
|
||||
string = File.read(file)
|
||||
parser = Parser::Salama.new
|
||||
object_space = Register::Program.new "Arm"
|
||||
syntax = parser.parse_with_debug(string)
|
||||
syntax = parser.parse_with_debug(string, reporter: Parslet::ErrorReporter::Deepest.new)
|
||||
assert syntax
|
||||
parts = Parser::Transform.new.apply(syntax)
|
||||
# file is a list of statements, all but the last must be a function
|
||||
|
Reference in New Issue
Block a user