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

Fix postfix if after escaped newline #484

Merged
merged 6 commits into from
Aug 29, 2017

Conversation

aycabta
Copy link
Member

@aycabta aycabta commented Aug 9, 2017

In the identify_identifier method, if @lex_state != :EXPR_BEG && @lex_state != :EXPR_FNAME, TkIF becomes TkIF_MOD. So when "\n" comes after escaped backslash, doesn't set :EXPR_BEG to @lex_state with this commit. This commit fixes correctly handling TkIF_MOD after escaped newline.

aycabta added 2 commits August 9, 2017 12:10
In the identify_identifier method,
if "@lex_state != :EXPR_BEG && @lex_state != :EXPR_FNAME",
TkIF becomes TkIF_MOD.
So when "\n" comes after escaped backslash,
doesn't set :EXPR_BEG to @lex_state with this commit.
This commit fixes correctly handling TkIF_MOD after escaped newline.
@hsbt hsbt self-assigned this Aug 15, 2017
@@ -591,96 +591,39 @@ def test_class_tokenize_string
assert_equal expected, tokens
end

def test_class_tokenize_string_with_escape
def test_class_tokenize_postfix_if_after_escaped_newline
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_class_tokenize_string_with_escape is needless test case? It seems regression.

@aycabta aycabta force-pushed the fix-postfix-if-after-escaped-newline branch from 6e56ab6 to 62418d0 Compare August 23, 2017 04:29
@aycabta
Copy link
Member Author

aycabta commented Aug 23, 2017

I fixed merging what was handled in a rush yesterday.

@hsbt
Copy link
Member

hsbt commented Aug 29, 2017

I confirmed test-case and your patch.

@hsbt hsbt merged commit 1564f2f into ruby:master Aug 29, 2017
@aycabta aycabta deleted the fix-postfix-if-after-escaped-newline branch August 29, 2017 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants