From 331b22b3a3b61313a65ea6c49e2930b67f7ce82b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 1 Oct 2018 15:25:27 -0700 Subject: Got compiler errors actually working. --- nomnom/compile.nom | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nomnom/compile.nom') diff --git a/nomnom/compile.nom b/nomnom/compile.nom index 64465bd..3d7c5b0 100644 --- a/nomnom/compile.nom +++ b/nomnom/compile.nom @@ -5,11 +5,11 @@ use "nomnom/parser.nom" use "nomnom/pretty_errors.nom" # TODO: use pretty_errors -local action [report compile error at %pos %err]: - barf "Compile error at \%pos: \%err" +local action [report compile error at %tree %err]: + barf (pretty "Compile Error" error at %tree %err) local action [report compile error at %pos %err hint %hint]: - barf "Compile error at \%pos: \%err\n\%hint" + barf (pretty "Compile Error" error at %tree %err hint %hint) action [compile %tree using %compile_actions]: assume (%tree is a "Syntax Tree") @@ -30,13 +30,13 @@ action [compile %tree using %compile_actions]: for % in (%tree::get args): %args::add % %result = (call %compile_action with %args) if (%result == (nil)): - report compile error at %tree.source "\ + report compile error at %tree "\ ..The compile-time action here (\(%tree.stub)) failed to return any value." ..hint "\ ..Look at the implementation of (\(%tree.stub)) and make sure it's returning something." if (%result is a "Syntax Tree"): if (%result == %tree): - report compile error at %tree.source "\ + report compile error at %tree "\ ..The compile-time action here (\(%tree.stub)) is producing an endless loop." ..hint "\ ..Look at the implementation of (\(%tree.stub)) and make sure it's not just returning the original tree." -- cgit v1.2.3