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

repl: backslash bug fix #2968

Closed
wants to merge 1 commit into from
Closed

Conversation

thefourtheye
Copy link
Contributor

The actual problem was with the line parsing logic for string literals.
When we use backslash in the string literals, it used to remember the
\ as the previous character even after we parsed the character next
to it. This leads to REPL thinking that the end of string literals is
not reached.

This patch replaces the previous character with null, so that it will
properly skip the character next to it.

Previous Discussion: #2952
Fixes: #2749

cc @silverwind @Fishrock123

The actual problem was with the line parsing logic for string literals.
When we use backslash in the string literals, it used to remember the
`\` as the previous character even after we parsed the character next
to it. This leads to REPL thinking that the end of string literals is
not reached.

This patch replaces the previous character with `null`, so that it will
properly skip the character next to it.

Previous Discussion: nodejs#2952
Fixes: nodejs#2749
@thefourtheye thefourtheye added the repl Issues and PRs related to the REPL subsystem. label Sep 20, 2015
@silverwind
Copy link
Contributor

Ah, this looks like the proper fix.

CI: https://ci.nodejs.org/job/node-test-pull-request/350/

@Fishrock123
Copy link
Contributor

SGTM, CI is happy.

@silverwind
Copy link
Contributor

LGTM

thefourtheye added a commit that referenced this pull request Sep 22, 2015
The actual problem was with the line parsing logic for string literals.
When we use backslash in the string literals, it used to remember the
`\` as the previous character even after we parsed the character next
to it. This leads to REPL thinking that the end of string literals is
not reached.

This patch replaces the previous character with `null`, so that it will
properly skip the character next to it.

Previous Discussion: #2952
Fixes: #2749
PR-URL: #2968
Reviewed-By: Roman Reiss <[email protected]>
@silverwind
Copy link
Contributor

Landed in fcfd87d

@silverwind silverwind closed this Sep 22, 2015
@thefourtheye thefourtheye deleted the fix-for-2749 branch September 22, 2015 17:49
thefourtheye added a commit that referenced this pull request Sep 22, 2015
The actual problem was with the line parsing logic for string literals.
When we use backslash in the string literals, it used to remember the
`\` as the previous character even after we parsed the character next
to it. This leads to REPL thinking that the end of string literals is
not reached.

This patch replaces the previous character with `null`, so that it will
properly skip the character next to it.

Previous Discussion: #2952
Fixes: #2749
PR-URL: #2968
Reviewed-By: Roman Reiss <[email protected]>
@rvagg rvagg mentioned this pull request Sep 22, 2015
@MylesBorins
Copy link
Contributor

landed in lts-v4.x-staging as cb971cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants