Grammar doesn't handle multiline preprocessor declarations
See original GitHub issueTried to parse tree-sitter’s parser.h and you get errors since the \
is misinterpreted as a preprocessor argument.
Output:
comment /*
* Lexer Macros
*/
preproc_function_def
identifier START_LEXER
preproc_params ()
preproc_arg \ <====
declaration
primitive_type bool
init_declarator
identifier result
false false
ERROR <====
ERROR \
declaration
primitive_type int32_t
identifier lookahead
ERROR
ERROR \
labeled_statement
statement_identifier next_state
ERROR
ERROR \
expression_statement
assignment_expression
identifier lookahead
field_expression
identifier lexer
field_identifier lookahead
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
c++ - Multiline preprocessor macro with trailing comments
The problem is that the c-preprocessor just adds another line ending character when the \ is hit and continuated.
Read more >The C Preprocessor - Math
A header file is a file containing C declarations and macro definitions (see section Macros) to be shared between several source files.
Read more >The NASM Preprocessor - NASM - The Netwide Assembler
In this step, the following preprocessor directives are processed: Multi-line macro definitions, specified by the %macro and %imacro directives.
Read more >The C Preprocessor: Macros
Macros. A macro is a fragment of code which has been given a name. Whenever the name is used, it is replaced by...
Read more >Use multi-line arguments to macros without commas with a ...
Hello, I just thought about the option to use multi-line statements for macro calls without the need to use comma in them. So...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Never mind - my mistake - looks like I had an old build for cpp still. Apologies.
Fixed.