Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a grammar doesn't match when using perl6-debug-m and does when using perl6-m #5797

Open
p6rt opened this issue Nov 13, 2016 · 1 comment
Open
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 13, 2016

Migrated from rt.perl.org#130083 (status was 'new')

Searchable as RT130083$

@p6rt
Copy link
Author

p6rt commented Nov 13, 2016

From @MasterDuke17

perl6-debug-m -e 'grammar G { regex TOP {^^ "#" \s* "line" \s+
$&lt;line&gt;=(\d+) \s* [ \s (&lt;[,​:]&gt;?) $&lt;filename>=(<-[,​:]>+) $0 ]? \s* $$} };
say G.parse("#line 2 ,foo.bar,")'
Nil

It matched up through the 'foo.bar', but then backs off back to the space
and gives Nil.

perl6-m -e 'grammar G { regex TOP {^^ "#" \s* "line" \s+ $<line>=(\d+) \s*
[ \s (<[,​:]>?) $<filename>=(<-[,​:]>+) $0 ]? \s* $$} }; say G.parse("#line 2
,foo.bar,")'
「#line 2 foo.bar」
line => 「2」
0 => 「」
filename => 「foo.bar」

However, simpler example works in both.

perl6-debug-m -e 'grammar G { regex TOP {^^ "#" \s* "line" \s+
$&lt;line&gt;=(\d+) $$} }; say G.parse("#line 2")'
「#line 2」
0 => 「2」
line => 「2」

perl6-m -e 'grammar G { regex TOP {^^ "#" \s* "line" \s+ $&lt;line&gt;=(\d+) $$}
}; say G.parse("#line 2")'
「#line 2」
0 => 「2」
line => 「2」

perl6 --version
This is Rakudo version 2016.10-144-ga1347ca built on MoarVM version
2016.10-35-gec45ae2

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant