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

String parser: template expression errors #2

Open
rtlayzell opened this issue May 27, 2020 · 0 comments
Open

String parser: template expression errors #2

rtlayzell opened this issue May 27, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request invalid This doesn't seem right

Comments

@rtlayzell
Copy link
Member

rtlayzell commented May 27, 2020

The string parser generates a new set of tokens based on the template expression after the $ or ${ because it's an entirely new lexical analysis, the location of the tokens isn't exactly correct, nor does it have access to the original source object which is a problem if we need to return errors (as they reference a source object).

Currently a workaround is provided: Instead of just returning the result of parse_expr, we construct a new error with the original string literal token and only the message from the result of parsing the expression.

Eventually, a proper fix will be needed to accurately display where the error occurred.

[Consider creating hierarchical errors rather than just flat lists]

@rtlayzell rtlayzell added enhancement New feature or request invalid This doesn't seem right labels May 27, 2020
@rtlayzell rtlayzell self-assigned this May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant