You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rakudo, r30888. When defining a grammar and regex, defining a regex
after a grammar places the regex in the grammar namespace, but vice
versa works fine. Below is some demo code (switch the definition
placements and comment out the check against Foo::Bar to see it
magically work):
grammar Foo {
rule TOP {\d+}
};
regex Bar {\d+};
# smart match against Foo may change based on RT 58676
'123' ~~ Foo;
say $/;
On Mon Sep 08 09:08:50 2008, cjfields@illinois.edu wrote:
Rakudo, r30888. When defining a grammar and regex, defining a regex
after a grammar places the regex in the grammar namespace, but vice
versa works fine. Below is some demo code (switch the definition
placements and comment out the check against Foo::Bar to see it
magically work):
grammar Foo {
rule TOP {\d+}
};
regex Bar {\d+};
# smart match against Foo may change based on RT 58676
'123' ~~ Foo;
say $/;
'1234' ~~ Foo::Bar; # works?!?
say $/;
'12345' ~~ Bar; # fails
say $/;
Ah yes, forgot to clear the thingy holding the current namespace. Fixed
it in r31006; if you have time to contribute a test for this somewhere,
that'd be wonderful.
Migrated from rt.perl.org#58678 (status was 'resolved')
Searchable as RT58678$
The text was updated successfully, but these errors were encountered: