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 regexp locations #125

Open
TadeasKucera opened this issue Aug 12, 2020 · 0 comments
Open

Fix regexp locations #125

TadeasKucera opened this issue Aug 12, 2020 · 0 comments

Comments

@TadeasKucera
Copy link
Contributor

In #124 we fix the locations of tokens of PlainString and HexString. We still need to do it for the Regexp class, and it's fellow classes like RegexpOr, RegexpGroup. The problem is that the Token class instances, that a particular regexp consists of are not created right in the tokenizer in parser_driver.cpp. The Token class instances in regexps are created in regexp classes constructors. Because of this, we cannot assign these tokens proper location within the parsed file. There are two possible ways to address this issue:

  • Create the tokens in the tokenizer methods with proper locations and then distribute these tokens into new regexp classes constructors.

  • Assign two locations - begin and end - to the regexp string after it is created. The locations of each token inside the regexp are not that important for us, and therefore it could be sufficient to only provide beginning and end of each regexp string. (Not necessary each of its tokens.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant