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

Cannot refer to a regex with dashes or apostrophes in it in Rakudo #863

Closed
p6rt opened this issue Apr 4, 2009 · 7 comments
Closed

Cannot refer to a regex with dashes or apostrophes in it in Rakudo #863

p6rt opened this issue Apr 4, 2009 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Apr 4, 2009

Migrated from rt.perl.org#64464 (status was 'resolved')

Searchable as RT64464$

@p6rt
Copy link
Author

p6rt commented Apr 4, 2009

From @masak

<masak> rakudo​: regex foo_bar { foobar }; say "foobar" ~~ /<foo_bar>/
<p6eval> rakudo 0bb68e​: OUTPUT«foobar␤»
<masak> rakudo​: regex foo-bar { foobar }; say "foobar" ~~ /<foo-bar>
<p6eval> rakudo 0bb68e​: OUTPUT«Statement not terminated properly at
line 1, near "~~ /<foo-b" [...]
<masak> pmichaud​: can I report this to rakudobug?
<pmichaud> masak​: no, because it's not a bug :-)
<masak> I thought it best to ask for exactly this reason. :)
<pmichaud> or you can report it, but I'll respond with a message to
p6l saying "wtf?"
<masak> :)
<moritz_> it's ambiguous in the sepc, I think
<pmichaud> agreed.
<moritz_> maybe we need a wtf mail
<masak> ok, let's do it that way.
* masak submits rakudobug
<moritz_> for example char classes could require whitespaces
<moritz_> around the -
<pmichaud> oh
<moritz_> std​: /<foo-bar>/
<pmichaud> S05 beats us to it.
<p6eval> std 26089​: OUTPUT«ok 00​:03 35m␤»
<pmichaud> However, in order to combine classes you must prefix a named
<pmichaud> character class with C<+> or C<->. Whitespace is required before
<pmichaud> any C<-> that would be misparsed as an identifier extender.
<moritz_> wow
<moritz_> TimToady++
<pmichaud> okay, it's a rakudobug, and I don't have to ask p6l whazzup
<pmichaud> I just have to fix PGE to recognize perl6's new identifier
<pmichaud> it's because PGE wants <+foo-bar>
<pmichaud> without that, it can't recognize <foo-bar> as being anything usable
<pmichaud> so the pattern fails, so the smart match fails, so...
<masak> rakudo​: regex foo'bar { foobar }; say "foobar" ~~ /<foo'bar>/
<moritz_> that serial testing is slow :(
<p6eval> rakudo 0bb68e​: OUTPUT«Statement not terminated properly at
line 1, near "~~ /<foo'b" [...]
<masak> make sure you get that case too. :)

@p6rt
Copy link
Author

p6rt commented Apr 23, 2009

From @moritz

On Sat Apr 04 09​:49​:21 2009, masak wrote​:

<masak> rakudo​: regex foo_bar { foobar }; say "foobar" ~~ /<foo_bar>/
<p6eval> rakudo 0bb68e​: OUTPUT«foobar␤»
<masak> rakudo​: regex foo-bar { foobar }; say "foobar" ~~ /<foo-bar>
<p6eval> rakudo 0bb68e​: OUTPUT«Statement not terminated properly at
line 1, near "~~ /<foo-b" [...]

Tests added to t/spec/S05-metasyntax/angle-brackets.t.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Apr 23, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jun 21, 2010

From @cognominal

$ perl6

grammar { token a-a { a } }
()
grammar { token a-a { a }; token b { <a-a> } }
regex assertion not terminated by angle bracket at line 1, near "-a> } }\n"

--
cognominal stef

@p6rt
Copy link
Author

p6rt commented Jan 13, 2012

From @jnthn

On Mon Jun 21 06​:04​:36 2010, cognominal wrote​:

$ perl6

grammar { token a-a { a } }
()
grammar { token a-a { a }; token b { <a-a> } }
regex assertion not terminated by angle bracket at line 1, near "-a> }
}\n"

Now it works​:

grammar { token a-a { a }; token b { <a-a> } }
<anon>()

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Jan 30, 2012

From @moritz

Tests fixed (made them use a lexical regex), and are now passing.

@p6rt
Copy link
Author

p6rt commented Jan 30, 2012

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 30, 2012
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant