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

WIP Broken Attributes should not break the whole Entry #249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stasm
Copy link
Contributor

@stasm stasm commented Jul 11, 2018

This is a WIP. Fix #237.

To do:

  • Runtime parser.
  • Report the proper error.

@stasm
Copy link
Contributor Author

stasm commented Jul 11, 2018

@zbraniecki - Asking for your feedback on this. I implemented a naive approach which keeps the attributes parsed so far and the rewinds the index to the beginning of the line in which an error was found. The problem with this approach is that the error reporting is then performed by getEntryOrJunk. The original error message is lost. Do you have a recommendation for how to solve this given the current architecture of the tooling parser?

@Pike
Copy link
Contributor

Pike commented Jul 13, 2018

We could store the attribute error on the parser, and compare its error position with the entry error position, and whoever got further wins?

@stasm
Copy link
Contributor Author

stasm commented Jul 13, 2018

Yeah, that was my assumption too. I wanted to hear what @zbraniecki thinks of this approach as he is the original author of this code. I'm also not clear if it's better to store the error on the instance of FluentParser or perhaps FTLParserStream.

@stasm stasm changed the base branch from feature/syntax-0.6 to master July 24, 2018 16:18
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.

2 participants