fluent.js icon indicating copy to clipboard operation
fluent.js copied to clipboard

WIP Broken Attributes should not break the whole Entry

Open stasm opened this issue 7 years ago • 3 comments

This is a WIP. Fix #237.

To do:

  • [ ] Runtime parser.
  • [ ] Report the proper error.

stasm avatar Jul 11 '18 15:07 stasm

@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?

stasm avatar Jul 11 '18 15:07 stasm

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

Pike avatar Jul 13 '18 10:07 Pike

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 avatar Jul 13 '18 11:07 stasm