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
Stumbled on this calling form that seems to parse the space separated stuff as regexes and then calls the token with ForeignCode that appears to be some regex stuff.
Is this valid syntax for some feature or is this an error that should be throwing?
16:42 camelia rakudo-moar 8e1366e7a: OUTPUT: «ForeignCode.new»
16:42 Zoffix m: grammar { token TOP { <a foobarber> }; method a($_) { .perl.say; exit } }.parse: ""
16:42 camelia rakudo-moar 8e1366e7a: OUTPUT: «ForeignCode.new»
16:42 Zoffix m: grammar { token TOP { <a foobarber zef> }; method a($_) { .perl.say; exit } }.parse: ""
16:42 camelia rakudo-moar 8e1366e7a: OUTPUT: «Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at <tmp>:1 ------> 3grammar { token TOP { <a foobarb…»
16:46 Zoffix m: say grammar { token TOP { <a alpha> }; token a($_) { . { say $_(Match.^lookup("!cursor_init")(Match, "abc", :0c)) } } }.parse: "abc"
16:46 camelia rakudo-moar 8e1366e7a: OUTPUT: «#<failed match>Nil»
The text was updated successfully, but these errors were encountered:
Yes, it is the syntax that lets us parse <before abc> and similar. Unlike with <foo: ...> and <foo(...)>, where the args are parsed by the MAIN language, the <foo ...> form parses the rest of the assertion using the regex language, wraps it in a closure, and passes it to foo. Thus it's a general syntax for higher-order regex operators - which is just what before/after are.
Stumbled on this calling form that seems to parse the space separated stuff as regexes and then calls the token with ForeignCode that appears to be some regex stuff.
Is this valid syntax for some feature or is this an error that should be throwing?
The text was updated successfully, but these errors were encountered: