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

FIX: Remove next() on backtrack, fixes #404 #441

Conversation

filipsajdak
Copy link
Contributor

When trying to parse expressions like:

(:() = 0) as t;

parameter_declaration_list() fail to succeed, which is expected but skips one symbol ('(') on returning, which makes the parser fail to process the expression successfully.

After this change above expression is parsed correctly. All regression tests pass.

Fixes #404

When trying to parse expression like:
```cpp
(:() = 0) as t;
```

`parameter_declaration_list()` fail to succed which is expected but
skips one symbol ('(') on returning that makes parser fail to process
expression succesfully.
@hsutter
Copy link
Owner

hsutter commented May 20, 2023

Ah, thanks! Right, if we backtrack we shouldn't then do another next(), good catch.

@hsutter hsutter merged commit 4f87037 into hsutter:main May 20, 2023
@filipsajdak filipsajdak deleted the fsajdak-fix-parsing-of-parameter_declaration_list branch May 31, 2023 21:28
zaucy pushed a commit to zaucy/cppfront that referenced this pull request Dec 5, 2023
When trying to parse expression like:
```cpp
(:() = 0) as t;
```

`parameter_declaration_list()` fail to succed which is expected but
skips one symbol ('(') on returning that makes parser fail to process
expression succesfully.
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] Postfix operator to parenthesized expression isn't parsed in a statement
2 participants