Amaan Qureshi
7b8332686e
chore: add tests
há 3 anos
Amaan Qureshi
c75868f8b5
feat: C23
há 3 anos
Christian Clason
6adee19458
feat: allow identifiers in string concatenations ( #145 )
* feat: allow identifiers in string concatenations
Resolves errors in strings of the form:
("failed in line %" PRIdLINENR)
---------
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
há 3 anos
Benjamin Brownlee
bb74560cd4
fix: allow preproc define without value to preceed a line with whitespace at start
há 3 anos
calixteman
c455818961
#include can be followed by a macro name or a macro call ( #38 )
* #include can be followed by a macro name or a macro call
* In preproc_include, use preproc_call_expression
há 6 anos
calixteman
d2ebd7f6c0
Macro definition can contain continuation line in the argument list ( #28 )
* Macro definition can contain continuation line in the argument list
* Reset grammar since line continuations are handled globally
Preserve the test.
há 6 anos
calixteman
362c031880
Parse expressions in preprocessor #if statement ( #29 )
* Parse expressions in preprocessor #if statement
* Make preproc_expression look like a normal expression
* Hide the wrapper rules
* Alias the rulres to match their corresponding expression rule
* Handle line continuations as extra tokens
há 6 anos
Max Brunsfeld
457a7917a1
Use new test structure, add syntax highlighting tests
há 6 anos
Max Brunsfeld
c3965938cc
Add node fields, update tree-sitter-cli
há 7 anos
Max Brunsfeld
9e21e17371
Allow preprocessor conditionals inside of field declaration lists
Co-Authored-By: Thomas Johansen <thomasjo@gmail.com>
há 8 anos
Max Brunsfeld
db8d3af84f
Add #elifs inside of #ifdefs
Signed-off-by: Nathan Sobo <nathan@github.com>
há 8 anos
Max Brunsfeld
065bee2c23
Add preprocessor elif clauses
Signed-off-by: Nathan Sobo <nathan@github.com>
há 8 anos
Max Brunsfeld
fcb4537288
Fix regex for unknown preprocessor directives
Signed-off-by: Nathan Sobo <nathan@github.com>
há 8 anos
Max Brunsfeld
82b62611b6
Differentiate primitive types from other type names
há 8 anos
Max Brunsfeld
f433b2bf8a
Tweak identifier naming convention
há 9 anos
Max Brunsfeld
9e7706d922
Distinguish variables, types, fields and labels using renames
há 9 anos
Max Brunsfeld
debe919f84
Allow whitespace after the # in preprocessor directives
há 9 anos
Max Brunsfeld
d9c324ffce
Don't try to parse #if conditions as C expressions
Doing this required treating the newline that follows these conditions as significant
in order to avoid conflicts, but this caused problems for error recovery.
há 9 anos
Max Brunsfeld
39a662907b
Make a named node for argument lists in call expressions
há 9 anos
Max Brunsfeld
eaa878ce95
Allow preprocessor conditionals inside functions
há 9 anos
Max Brunsfeld
e64b56050e
Add preprocessor if blocks
há 9 anos
Max Brunsfeld
eed36b3f88
Allow object-like defines whose values start with parentheses
há 9 anos
Max Brunsfeld
f4fca3e638
⬆️ tree-sitter, rename grammar_test to corpus
há 9 anos
Max Brunsfeld
6093f6f023
Tweak test for #defines
há 10 anos
Max Brunsfeld
fb4ace990e
Fix issues with preprocessor defininitions
há 10 anos
Max Brunsfeld
1844ad2d93
Add some error recovery points
há 10 anos
Max Brunsfeld
f6dc4d7942
Add structure to #ifdef blocks
há 10 anos
Max Brunsfeld
87ad2e9c69
Base grammar on existing C99 grammar
há 11 anos
Max Brunsfeld
afac264377
Add #ifndef et al
há 11 anos
Max Brunsfeld
705256dbba
Update tests and grammar for new tree-sitter
Now there is never a need to mark a repeat rule as optional
há 12 anos
Max Brunsfeld
474975e32b
Add unions, enums
há 12 anos
Max Brunsfeld
c91415338d
Initial commit
há 12 anos