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

Improved missing ( and { error detection. #1841

Merged
merged 3 commits into from
Feb 1, 2014
Merged

Improved missing ( and { error detection. #1841

merged 3 commits into from
Feb 1, 2014

Conversation

seven-phases-max
Copy link
Member

Improved missing ( and { error detection (#1839).

@@ -405,14 +405,19 @@ less.Parser = function Parser(env) {
case 40: // (
parenLevel++; continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think of adding a lastParen variable here:

case  40:
    parenLevel++;
    lastParen = parserCurrentIndex;
    continue;

Then on line 482:

 return fail("missing closing `)`",lastParen);

@seven-phases-max
Copy link
Member Author

@oyejorge Thanks! Good idea (I've appended a commit with this changes to the PR).

lukeapage added a commit that referenced this pull request Feb 1, 2014
…ckets-errors

Improved missing `(` and `{` error detection.
@lukeapage lukeapage merged commit b58a1ef into less:master Feb 1, 2014
@seven-phases-max seven-phases-max deleted the missing-parens-and-brackets-errors branch February 1, 2014 12:46
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

Successfully merging this pull request may close these issues.

3 participants