Skip to content

Commit

Permalink
point out known entrypoints when unknown one is in script
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Jul 13, 2019
1 parent e7f5f1f commit a96de3e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/App/MoarVM/ConfprogCompiler/Parser/Grammar.pm6
@@ -1,3 +1,5 @@
constant @entrypoints = <profiler_static profiler_dynamic spesh jit heapsnapshot>;

grammar ConfProg {
regex TOP {
["version" \s* "=" \s* "1" <.eol> || { die "Program has to start with a version. Only version = 1 is supported here" }]:
Expand All @@ -11,14 +13,11 @@ grammar ConfProg {
regex statement:<var_update> {
<variable> \s+ <update_op> \s+ <expression>
}

regex statement:<entrypoint> {
'entry' \s+ [$<entrypoint>=[
| 'profiler_static'
| 'profiler_dynamic'
| 'spesh'
| 'jit'
| 'heapsnapshot'
] || { die "don't know this entrypoint" }] \s*
'entry' \s+ {} [$<entrypoint>=[
@entrypoints
] || $<rubbish>=<-[:]>* { die "don't know this entrypoint: $/<rubbish>.Str.perl(), try one of: @entrypoints.join(", ")" }] \s*
":"
}

Expand Down

0 comments on commit a96de3e

Please sign in to comment.