diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-10-01 15:25:27 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-10-01 15:25:27 -0700 |
| commit | 331b22b3a3b61313a65ea6c49e2930b67f7ce82b (patch) | |
| tree | f106bc55ea3cbd4aa3a5f4b4e5cd6fe3894ffb9e /nomnom/compile.nom | |
| parent | 1a3137a210f7886677c6672c26081152318252a3 (diff) | |
Got compiler errors actually working.
Diffstat (limited to 'nomnom/compile.nom')
| -rw-r--r-- | nomnom/compile.nom | 10 |
1 files changed, 5 insertions, 5 deletions
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." |
