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

Handling form feed character #117

Closed
casouri opened this issue Nov 16, 2022 · 3 comments · Fixed by #161
Closed

Handling form feed character #117

casouri opened this issue Nov 16, 2022 · 3 comments · Fixed by #161

Comments

@casouri
Copy link

casouri commented Nov 16, 2022

The parser is awesome! However, it sometimes chokes on form feed character, which is used in source files from time to time. The grammar should treat it as whitespace.

@amaanq
Copy link
Member

amaanq commented Jul 18, 2023

Do you have an example of where it could choke?

@casouri
Copy link
Author

casouri commented Jul 18, 2023

First of all, it's parsed as an error node in the parser. I remember seeing it cause some problem but I couldn't find the example now, sorry about that. I put together an example of a typical usage of form feed character in source files: put before a section header comment for delimiting sections.

int main() {
  return 0;
}


/* Section header */


int subr() {
  return 1;
}

@amaanq
Copy link
Member

amaanq commented Jul 24, 2023

Thank you! I'm a bit surprised \f & \v isn't included in \s for tree-sitter core

See tree-sitter/tree-sitter#2428

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 a pull request may close this issue.

2 participants