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

Parser: fixed #4608, correct to parse regex after close bracket #4610


Copy link

@makenowjust makenowjust commented Jun 23, 2017


Fixed #4608

Copy link

RX14 commented Aug 19, 2017

This change looks fine, but wants_regex seems like a reoccurring issue in the parser, perhaps there's a better way to do it? If not, just go ahead and merge this.

Copy link

Maybe someone can take a look at how is this done in Ruby's parser.

Copy link
Contributor Author

I just read parse.y in ruby/ruby. Ruby's parser has internal state and updates this on parsing, and here is to decide / is division operator or regular expression start. It looks like Crystal, however Ruby's state has more semantic name like EXPR_BEG or EXPR_END. I'm not sure which is better.

@asterite asterite merged commit 32d7e3e into crystal-lang:master Aug 20, 2017
@asterite asterite added this to the Next milestone Aug 20, 2017
@makenowjust makenowjust deleted the fix/crystal/4608-regex-after-close-bracket branch August 20, 2017 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants