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

Add syntax highlighting #28

Open
certik opened this issue Dec 6, 2024 · 0 comments
Open

Add syntax highlighting #28

certik opened this issue Dec 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@certik
Copy link
Contributor

certik commented Dec 6, 2024

This actually might be tricky to get right, since our tokens in lfortran are based on just a regex, so a "program" keyword and a variable are both of type "keyword". To do that, we need to have the correct type for each token. We know the correct parsing at the AST level, but we do not have tokens anymore.

It is also possible to obtain the correct tokens using our fixed-form tokenizer which is a recursive descent parser. We could write a similar parser for free-form also. However unless we use it for the actual parsing, it would be duplicate work, so not sure it is worth it.

So we can start by providing a list of tokens and their types, although some variable names might be mistyped as keywords, since that's what the tokenizer sees.

@certik certik added the enhancement New feature or request label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant