Skip to content

Output the correct location when a statement can not be parsed. #499

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

Merged

Conversation

MaxSagebaum
Copy link
Contributor

Fixes #488

With this fix the regression tests still run.

Previous output was:

pure2-statement-parse-error.cpp2...
pure2-statement-parse-error.cpp2(1,12): error: ill-formed initializer (at '{')
pure2-statement-parse-error.cpp2(1,1): error: unexpected text at end of Cpp2 code section (at 'func')
pure2-statement-parse-error.cpp2(1,0): error: parse failed for section starting here

Current output is:

pure2-statement-parse-error.cpp2...
pure2-statement-parse-error.cpp2(3,9): error: Could not parse statement (at 'b')

MaxSagebaum and others added 2 commits June 8, 2023 10:56
Currently the start of the current compound statement is provided as a
hint.
Signed-off-by: Herb Sutter <herb.sutter@gmail.com>
@hsutter
Copy link
Owner

hsutter commented Aug 11, 2023

Looks good, thanks!

@hsutter hsutter merged commit ba8f0df into hsutter:main Aug 11, 2023
zaucy pushed a commit to zaucy/cppfront that referenced this pull request Dec 5, 2023
…ter#499)

* Output the correct location when a statement can not be parsed.

Currently the start of the current compound statement is provided as a
hint.

* Tweak error message wording

Signed-off-by: Herb Sutter <herb.sutter@gmail.com>

---------

Signed-off-by: Herb Sutter <herb.sutter@gmail.com>
Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
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.

[BUG] Wrong location for ill formed definitions
2 participants