Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mention corresponding starter for most of the things
This should handle quotes, parens, brackets, subscripts and many other
things.

Resolves part of RT #125641.

Unfortunately I don't know how to print the actual starter, but as
long as the line number is mentioned it's alright.
  • Loading branch information
AlexDaniel authored and zoffixznet committed Oct 7, 2017
1 parent e071490 commit 3ede49c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -255,7 +255,8 @@ role STD {
$stopper := $stopper // $goal;
$stopper := $stopper ~~ /(.*\S)\s*/;
$stopper := ~$stopper[0];
self.typed_panic('X::Comp::FailGoal', :$dba, :goal($stopper));
self.typed_panic('X::Comp::FailGoal', :$dba, :goal($stopper),
:line-real(HLL::Compiler.lineof(self.orig(), self.from())));
}
method panic(*@args) {
Expand Down
4 changes: 3 additions & 1 deletion src/core/Exception.pm
Expand Up @@ -766,10 +766,12 @@ my class X::Comp::AdHoc is X::AdHoc does X::Comp {
my class X::Comp::FailGoal does X::Comp {
has $.dba;
has $.goal;
has $.line-real;

method is-compile-time(--> True) { }

method message { "Unable to parse expression in $.dba; couldn't find final $.goal" }
method message { "Unable to parse expression in $.dba; couldn't find final $.goal"
~ " (corresponding starter was at line $.line-real)" }
}

my role X::Syntax does X::Comp { }
Expand Down

0 comments on commit 3ede49c

Please sign in to comment.