Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Enable use of $¢ in grammars
Unfortunately only works inside regex/token/rules, bare regexes (like
$foo ~~ /bar/) don't get the right $¢ . I've tried everything to fix
this, but the solution is apparently not going to be that simple.
my token foo {AB {say $¢.pos} C}; "ABC" ~~ /<&foo>/; # says '2'
"ABC" ~~ /AB {say $¢.pos} C/; # says 'Nil'
Closest I got was manually removing $¢ from $past in regex_coderef after
qbuildsub (and since qbuildsub will put a $¢ in there if you don't,
better to put one in there you could more reliably remove afterward),
but then eval'd regexes, e.g. EVAL('$foo ~~ /bar/'), complain about not
being able to resolve lexical $¢ .
The best I can guess is that the bare regexes pass a clean slate for the
$block arg of 'regex_coderef', instead of the popped lexpad
rule/token/regex gives, but I don't know how exactly that affects
things, much less how to fix the issue based on that (if it's the source
of the problems).- Loading branch information
1 parent
28faf19
commit edffe05
Showing
2 changed files
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters