Skip to content

Instantly share code, notes, and snippets.

@softmoth
Created September 24, 2017 20:00
Show Gist options
  • Save softmoth/5a3e34b041cfe7ba045503c7d86f617b to your computer and use it in GitHub Desktop.
Save softmoth/5a3e34b041cfe7ba045503c7d86f617b to your computer and use it in GitHub Desktop.
YAMLish failure `foo: no good` doesn't parse
#! /usr/bin/env perl6
grammar Grammar {
rule TOP { <element> }
token plain { \N* }
token inline { yes | no }
token element {
<value=inline> || <value=plain>
}
}
use Data::Dump;
for 'no', 'no bar', 'xno bar' {
note "\n$_";
Grammar.parse($_);
dd $/;
dd $/<element>.Str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment