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

Calling .subst in a reduction method destroys the effect of make() #1454

Closed
p6rt opened this issue Dec 21, 2009 · 5 comments
Closed

Calling .subst in a reduction method destroys the effect of make() #1454

p6rt opened this issue Dec 21, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Dec 21, 2009

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

Searchable as RT71514$

@p6rt
Copy link
Author

p6rt commented Dec 21, 2009

From @moritz

grammar ActionsTestGrammar {
  token TOP {
  ^ .+ $ {*}
  }
}
class TestActions {
  method TOP($/) {
  "a\nb".subst(/\n+/, '', :g);
  make 123;
  }
}

say ActionsTestGrammar.parse("ab\ncd", :action(TestActions.new)).ast;

Prints​:
ab
cd

commenting out the line with the call to .subst makes it print 123 as
expected.

Found by takadonet++

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

From @moritz

works now, needs tests.

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

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

@p6rt
Copy link
Author

p6rt commented Mar 11, 2010

From @moritz

tested in action-stubs.t

@p6rt
Copy link
Author

p6rt commented Mar 11, 2010

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

@p6rt p6rt closed this as completed Mar 11, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant