Skip to content

Commit c077b22

Browse files
committed
Make LANG pass on orig, not target, plus args.
This may get rid of some of the oddness we've seen with strings with null bytes showing up. Also means we can pass arguments on to a rule in another language.
1 parent 84a13cb commit c077b22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/HLL/Grammar.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -783,12 +783,12 @@ An operator precedence parser.
783783
$cur
784784
}
785785

786-
method LANG($lang, $regex) {
787-
my $lang_cursor := %*LANG{$lang}.'!cursor_init'(self.target(), :p(self.pos()));
786+
method LANG($lang, $regex, *@args) {
787+
my $lang_cursor := %*LANG{$lang}.'!cursor_init'(self.orig(), :p(self.pos()));
788788
if self.HOW.traced(self) {
789789
$lang_cursor.HOW.trace-on($lang_cursor, self.HOW.trace_depth(self));
790790
}
791791
my $*ACTIONS := %*LANG{$lang ~ '-actions'};
792-
$lang_cursor."$regex"();
792+
$lang_cursor."$regex"(|@args);
793793
}
794794
}

0 commit comments

Comments
 (0)