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

Handling of post-condition loops #70

Closed
whitequark opened this issue Jun 9, 2013 · 2 comments
Closed

Handling of post-condition loops #70

whitequark opened this issue Jun 9, 2013 · 2 comments
Assignees
Milestone

Comments

@whitequark
Copy link
Owner

It just came to my attention that parser currently does not handle loops with post-condition (https://github.com/whitequark/parser/blob/master/doc/AST_FORMAT.md#with-postcondition):

begin
  foo
end while true

This must be handled before 2.0 release.

@bbatsov
Copy link
Contributor

bbatsov commented Jun 10, 2013

Ah, yes - they're not quite the same as regular while/until nodes - http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/6745.

@whitequark
Copy link
Owner Author

Unfortunately, this will require some (begin) nodes to become (kwbegin)... they're not semantically equivalent. For example, if you make a rewriter which adds while foo after a (begin) node, i.e. ( ), the outcome will be different than with a (kwbegin), i.e. begin end.

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

2 participants