Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created February 19, 2020 16:19
Show Gist options
  • Save Whateverable/e080aef9bc48e168ec5455b0bb6eb9d7 to your computer and use it in GitHub Desktop.
Save Whateverable/e080aef9bc48e168ec5455b0bb6eb9d7 to your computer and use it in GitHub Desktop.
evalable6
chdir ‘sandbox/roast’; run <perl6 S05-grammar/parse_and_parsefile-6e.t>;
1..24
ok 1 - grammar is created using 6.e version of Grammar class
ok 2 - .parse method invokes TOP rule, no match
ok 3 - .parse method invokes TOP rule, match
ok 4 - .parse method requires match to end
ok 5 - .subparse method doesn't require match to end
ok 6 - dies if no TOP rule
ok 7 - .parsefile method invokes TOP rule, no match
ok 8 - .parsefile method invokes TOP rule, match
ok 9 - dies if no TOP rule
ok 10 - dies if file not found
ok 11 - .parse works with namespaced grammars, no match
ok 12 - .parse works with namespaced grammars, match
1..2
ok 1 - '::No::Such::Grammar.parse()' died
ok 2 - right exception type (Exception)
ok 13 - .parse on missing grammar dies
ok 14 - can .parse grammar named "Integer"
ok 15 - empty match is rakuable, not Null PMC access
ok 16 - can use <rule "param"> form of rule invocation in grammar
ok 17 - Recursive .ast calls work
ok 18 - A regex TOP will be backtracked into to get a long enough match
ok 19 - parse failed with Failure
ok 20 - failure exception is X::Syntax::Confused
ok 21 - parsing failed at line 1
ok 22 - pos is 14
ok 23 - pre is ' \# l3'
ok 24 - post is <EOL>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment