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

capture variable does not parse for building a pair of the form :$<a> #2014

Closed
p6rt opened this issue Aug 5, 2010 · 8 comments
Closed

capture variable does not parse for building a pair of the form :$<a> #2014

p6rt opened this issue Aug 5, 2010 · 8 comments

Comments

@p6rt
Copy link

@p6rt p6rt commented Aug 5, 2010

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

Searchable as RT76998$

@p6rt
Copy link
Author

@p6rt p6rt commented Aug 5, 2010

From @cognominal

Test program below gives
===SORRY!===
Unable to parse blockoid, couldn't find final '}' at line 7

  grammar A {
  token TOP { <a> };
  token a { a }
  };

  class A​::A {
  method TOP($/) { say :$<a> }
  };

  A.parse('a', :actions(A​::A));

Note​: the specs don't mention that form for capture variables, neither
the form for context variable.
The latter works as expected though.

$ perl6

my $*a = 1; say :$*a.perl
"a" => 1

--
cognominal stef

@p6rt
Copy link
Author

@p6rt p6rt commented Aug 8, 2010

From @masak

cognominal (>)​:

Test program below gives
===SORRY!===
Unable to parse blockoid, couldn't find final '}' at line 7

grammar A {
token TOP { <a> };
token a { a }
};

class A​::A {
method TOP($/) { say :$<a> }
};

A.parse('a', :actions(A​::A));

Note​: the specs don't mention that form for capture variables, neither
the form for context variable.
The latter works as expected though.

$ perl6

my $*a = 1; say :$*a.perl
"a" => 1

Yes, it should work​:

<masak> std​: :$<a>
<p6eval> std 31912​: OUTPUT«ok 00​:01 111m␤»

@p6rt
Copy link
Author

@p6rt p6rt commented Aug 8, 2010

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

@p6rt
Copy link
Author

@p6rt p6rt commented Jun 9, 2013

From @jnthn

On Sat Aug 07 22​:42​:52 2010, masak wrote​:

cognominal (>)​:

Test program below gives
===SORRY!===
Unable to parse blockoid, couldn't find final '}' at line 7

grammar A {
token TOP { <a> };
token a { a }
};

class A​::A {
method TOP($/) { say :$<a> }
};

A.parse('a', :actions(A​::A));

Note​: the specs don't mention that form for capture variables,
neither
the form for context variable.
The latter works as expected though.

$ perl6

my $*a = 1; say :$*a.perl
"a" => 1

Yes, it should work​:

<masak> std​: :$<a>
<p6eval> std 31912​: OUTPUT«ok 00​:01 111m␤»

Implemented; works now​:

'abc' ~~ /a $<a>=[\w+]/; say :$<a>.perl
"a" => Match.new(orig => "abc", from => 1, to => 3, ast => Any, list =>
().list, hash => EnumMap.new())

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 23, 2014

From @FROGGS

Test added by bartolin​: usev6/roast@cf3bf2b

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 23, 2014

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

@p6rt p6rt closed this Sep 23, 2014
@p6rt
Copy link
Author

@p6rt p6rt commented Sep 23, 2014

From @usev6

This now has a test in S05-capture/match-object.t (cmp. Raku/roast@15cd5a8)

All credits to timotimo, who explained both test and procedure to close this ticket​: http://perl6advent.wordpress.com/2013/12/17/day-17-of-a-new-contributor/

1 similar comment
@p6rt
Copy link
Author

@p6rt p6rt commented Sep 23, 2014

From @usev6

This now has a test in S05-capture/match-object.t (cmp. Raku/roast@15cd5a8)

All credits to timotimo, who explained both test and procedure to close this ticket​: http://perl6advent.wordpress.com/2013/12/17/day-17-of-a-new-contributor/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant