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 error locations. #2

Open
AskingQuestions opened this issue Jul 22, 2018 · 1 comment
Open

Fix error locations. #2

AskingQuestions opened this issue Jul 22, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@AskingQuestions
Copy link
Contributor

Most parsers are giving errors that are based on their parent position.

Carbonite example

class Abc { // <- Parse error is here
   void xyz(int parseErr@r) { // <- Parse error should be here

  }
}

The problem is in error bubbling, each error should keep track of its children, and then the parser should decide the error location.

@AskingQuestions AskingQuestions added the bug Something isn't working label Jul 22, 2018
@AskingQuestions AskingQuestions self-assigned this Jul 22, 2018
@AskingQuestions
Copy link
Contributor Author

The commit 40ae4b1 adds some more limited location detail. Simply tracking error depth and picking the deepest if the parse fails. As you might notice this is fairly naive and may lead to errors that are way off, that said, its a step up from the current error tracking and should help a little.

The next steps would be to build a more robust tracking system in the future, however a rewrite seems due and would automatically fix this issue.

Parsing performance should not be effected, but a few things were changed in this update that may break things.

It may take a while for this new feature to propagate to carbonite and carpeg itself, as our pipeline is not as feature full as it should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant