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

Test with C++ multi-line string literals #58

Open
pgoodman opened this issue Nov 11, 2022 · 0 comments
Open

Test with C++ multi-line string literals #58

pgoodman opened this issue Nov 11, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@pgoodman
Copy link
Member

The way the Run method works is that each token is put into ASTImpl::preprocessed_code on its own line, so that we can map from source location line number back to index in ASTImpl::tokens. This means fiddling with embedded newlines in tokens, and thus introduces flakiness. My guess is that this approach is going to fall over when we want to handle C++ multiline string literals. Regardless, an easier approach would be to append unadulterated token data into ASTImpl::preprocessed_code, and build up a vector of token begin or token end indexes, for binary searching later. Alternatively, we could try some kind of binary search inside of ASTImpl::tokens, as they have data_offset, but that will require being clever, as the data_offset has an overloaded meaning.

@pgoodman pgoodman added enhancement New feature or request help wanted Extra attention is needed labels Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant