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

Regex subrule problem <print> related #5528

Open
p6rt opened this issue Aug 3, 2016 · 1 comment
Open

Regex subrule problem <print> related #5528

p6rt opened this issue Aug 3, 2016 · 1 comment
Labels
Bug regex Regular expressions, pattern matching, user-defined grammars, tokens and rules

Comments

@p6rt
Copy link

p6rt commented Aug 3, 2016

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

Searchable as RT128832$

@p6rt
Copy link
Author

p6rt commented Aug 3, 2016

From denis@demayl.com

grammar Test {
    token TOP { (['"'|"'"]) <+print - [s]> ** 1..64 $0 }

};

say Test.parse('"teat"');

Dies with ( --ll-exception )​:

Too many positionals passed; expected 1 argument but got 2
   at gen/moar/m-CORE.setting​:1324  (/home/demayl/rakudo/install/share/perl6/runtime/CORE.setting.moarvm​:print)
 from gen/moar/stage2/QRegex.nqp​:1340  (/home/demayl/rakudo/install/share/nqp/lib/QRegex.moarvm​:!reduce)
 from gen/moar/stage2/QRegex.nqp​:1301  (/home/demayl/rakudo/install/share/nqp/lib/QRegex.moarvm​:!cursor_pass)
 from gen/moar/stage2/QRegex.nqp​:1785  (/home/demayl/rakudo/install/share/nqp/lib/QRegex.moarvm​:print)
 from email.pl6​:11  (<ephemeral file>​:TOP)
 from gen/moar/m-CORE.setting​:26883  (/home/demayl/rakudo/install/share/perl6/runtime/CORE.setting.moarvm​:parse)
 from email.pl6​:15  (<ephemeral file>​:<unit>)
 from email.pl6​:1  (<ephemeral file>​:<unit-outer>)
 from gen/moar/stage2/NQPHLL.nqp​:1508  (/home/demayl/rakudo/install/share/nqp/lib/NQPHLL.moarvm​:eval)
 from gen/moar/stage2/NQPHLL.nqp​:1711  (/home/demayl/rakudo/install/share/nqp/lib/NQPHLL.moarvm​:evalfiles)
 from gen/moar/stage2/NQPHLL.nqp​:1605  (/home/demayl/rakudo/install/share/nqp/lib/NQPHLL.moarvm​:command_eval)
 from src/Perl6/Compiler.nqp​:27  (/home/demayl/rakudo/install/share/nqp/lib/Perl6/Compiler.moarvm​:command_eval)
 from gen/moar/stage2/NQPHLL.nqp​:1579  (/home/demayl/rakudo/install/share/nqp/lib/NQPHLL.moarvm​:command_line)
 from gen/moar/m-main.nqp​:37  (/home/demayl/rakudo/install/share/perl6/runtime/perl6.moarvm​:MAIN)
 from gen/moar/m-main.nqp​:33  (/home/demayl/rakudo/install/share/perl6/runtime/perl6.moarvm​:<mainline>)
 from <unknown>​:1  (/home/demayl/rakudo/install/share/perl6/runtime/perl6.moarvm​:<main>)
 from <unknown>​:1  (/home/demayl/rakudo/install/share/perl6/runtime/perl6.moarvm​:<entry>)

shell returned 1

It dies with same error when used in form

CODE
grammar Test {
    token TOP{ (['"'|"'"]) [<print><!after "=">] ** 1..64 $0 }
}; 

say Test.parse('"teat"');

VERSION​:
This is Rakudo version 2016.07.1-122-g7ec824e built on MoarVM version 2016.07-16-g85b6537
implementing Perl 6.c.

NOTE
Interesting is that when used in normal "regex" it works.
For example
say '"teat"' ~~  / (['"'|"'"]) <+print - [s]> ** 1..64 $0 /

@p6rt p6rt added Bug regex Regular expressions, pattern matching, user-defined grammars, tokens and rules labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug regex Regular expressions, pattern matching, user-defined grammars, tokens and rules
Projects
None yet
Development

No branches or pull requests

1 participant