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

Toml Parser is unable recover properly from missing Starting double quote #26394

Open
xlight05 opened this issue Oct 17, 2020 · 0 comments
Open
Labels
Area/TOMLParser TOML parser related issues Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug

Comments

@xlight05
Copy link
Contributor

Description:
Toml String implementation uses ParserMode class to parse the String Content. The Starting double quote starts the mode and the ending double quote ends the parsing mode and reverts to the parsing mode back to default.

When the Starting double quote is missing, Lexer automatically recognizes the ending quote as the first quote and parse the trailing trivia as String content.

When the Starting double quotes are recovered from the Error Handler, the key-value pair recovers just fine but the remaining String content created by trailing trivia is not removed and it causes the parser to add/remove more tokens.

Steps to reproduce:
key = sdsd"

@anupama-pathirage anupama-pathirage added the Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) label Oct 29, 2020
@SupunS SupunS added the Area/TOMLParser TOML parser related issues label Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/TOMLParser TOML parser related issues Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug
Projects
None yet
Development

No branches or pull requests

3 participants