Amaan Qureshi
60544dbdd2
Revert "fix: rework top level function definition pointer association"
This reverts commit eb6649e0c2 .
před 3 roky
Amaan Qureshi
0ca9561fef
fix: mostly correct sized_type_specifiers in type definitions
před 3 roky
Amaan Qureshi
929e52f2d4
feat: add attribute_specifier to the end of struct, union, enum, and field_declaration
před 3 roky
Amaan Qureshi
1e6557a90d
fix: allow numbers in preproc_directive
před 3 roky
Amaan Qureshi
eb6649e0c2
fix: rework top level function definition pointer association
Previously, pointers were associated with the function identifier, now they're associated with the return type
před 3 roky
Amaan Qureshi
34db9e4b29
fix: rework true top-level items to disallow binary expressions
This resolves conflicts with declarations that can be interpreted as binary_expressions
před 3 roky
Amaan Qureshi
c75868f8b5
feat: C23
před 3 roky
Amaan Qureshi
bb4ab38847
feat: allow type_qualifiers after typedef specifier, alias char content
před 3 roky
antoinemadec
7f678a26bb
Add else_clause
před 3 roky
TJ DeVries
6b85e8478b
fix: Add compound statement to call expression
před 5 roky
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>
před 3 roky
Benjamin Brownlee
693d298099
feat: add gnu inline asm syntax ( #140 )
před 3 roky
Benjamin Brownlee
bb74560cd4
fix: allow preproc define without value to preceed a line with whitespace at start
před 3 roky
Amaan Qureshi
5b5367c4b8
feat: add underlying types in enums, allow bitfield clauses in repeated field declarators
před 3 roky
Jason Brown
e1359a0a54
Adding support for offsetof
před 3 roky
Amaan Qureshi
20fee37fd0
feat: add _Generic expressions and missing type qualifiers
_Generic is a C11 feature, __restrict__ and _Noreturn were added to type_qualifiers
před 3 roky
Amaan Qureshi
c0b1db960d
feat: add and apply eslint formatting
před 3 roky
Amaan Qureshi
b906e05ba4
docs: document grammar.js
před 3 roky
Amaan Qureshi
16456ce9a1
fix: comments can have multiple delimiting backslashes
před 3 roky
Amaan Qureshi
d4a789bf07
feat: support omitting consequences in conditional expressions
It's allowed in gcc and clang
před 3 roky
Jade Lovelace
93135e2eb5
fix: implement Unicode identifiers
According to cppreference, identifiers are `(XID_Start | '_')
XID_Continue*`, which is the case as of C++23 and C2x. I have confirmed
this myself with the drafts of C++23 and C2x.
https://en.cppreference.com/w/cpp/language/identifiers
Clang indeed implements identifiers as `(XID_Start | '_') XID_Continue*`
in C++ mode and C2x mode, with a slight extension to the character set
to include some extra math characters:
231992d9b8/clang/lib/Lex/Lexer.cpp (L1517-L1530)
před 3 roky
Ismail A Bella
94bc261b1a
fix: allow multiple expressions inside for_statement condition
před 4 roky
John Drouhard
179b70c6be
Attributes: simplify attributed_statement by making it a valid type of non-case statement
This also lets it bind to _any_ statement, which is necessary for some
c++ attributes that can attach to the statement in if, while, and
do/while statements.
před 4 roky
Ben Dunkin
517bf92b2c
add the body label to for loops to make it the same as other loops ( #110 )
před 4 roky
John Drouhard
f71e80b9f2
Extract "..." into a named node called variadic_parameter. Fixes #73
před 4 roky
jdrouhard
9bee34500c
Support attribute statements under case statements ( #83 )
před 4 roky
John Drouhard
0aeed5578a
Fix indent-level whitespace
před 4 roky
John Drouhard
b50e693547
Separate _declaration_modifiers from _declaration_specifiers to make it overridable in the cpp grammar
před 4 roky
John Drouhard
0b714a5134
rename attribute_definition to attribute_declaration
před 4 roky
jdrouhard
8fc135a72b
Add support for C23 attributes ( #81 )
* Add support for C23 attributes
https://en.cppreference.com/w/c/language/attributes
* Use wrapper for statements with attributes to reduce state machine size
* Missed a couple _declarators that needed attributes directly after
* Use annotated_declarator for declarators that have attributes immediately following them
* Give field and type declarators the same attribute treatment
před 4 roky
berchn
008008e30a
Add operator field to field_expression ( #69 )
před 5 roky
berchn
25fb87ce98
Add operation field to assignment_expression ( #68 )
před 5 roky
Mathieu Nayrolles
88592f162e
Add support for Microsoft-specific modifiers ( #40 )
* Add support for Microsoft-specific modifiers
Microsoft-specific modifiers are keywords can be used to modify declarators to form derived types.
The specification for the modifiers themselves is here:
https://docs.microsoft.com/en-us/cpp/cpp/microsoft-specific-modifiers?view=vs-2019
* 0.16.1
před 6 roky
calixteman
6002fcd5e8
Add a rule for left part of assignment: it'll be helpful to add scope… ( #37 )
* Add a rule for left part of assignment: it'll be helpful to add scoped_name_identifier (c++)
* Inline the assignment_left_expression rule
před 6 roky
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
před 6 roky
Max Brunsfeld
b6ff8fbdaf
Handle line continuations with CRLF endings
před 6 roky
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
před 6 roky
calixteman
2ed529f075
Add u|U|u8 string|char support ( #36 )
před 6 roky
Max Brunsfeld
627806ec6a
Allow case statements separate from switch statements
Fixes #32
před 6 roky
Max Brunsfeld
916be99704
Allow comma operator in return statement
Fixes #31
před 6 roky
calixteman
c578638af2
Fix multi-statements in for initializer and update parts ( #27 )
* Fix multi-statements in for initializer and update parts
* Finally the bug was only in the initializer part
před 7 roky
calixteman
c8061429cc
Fix error with ++L (consequence of support for L strings) ( #26 )
* Fix error with ++L (consequence of support for L strings)
* Update to tree-sitter 0.15.5
před 7 roky
Max Brunsfeld
e0512072cc
Handle comments with escaped CRLF line endings
Fixes #24
před 7 roky
Max Brunsfeld
0bc1adf0c2
Tweak fields
před 7 roky
Max Brunsfeld
c3965938cc
Add node fields, update tree-sitter-cli
před 7 roky
calixteman
ff4fc1c785
Handle L-strings and L-chars ( #25 )
před 7 roky
calixteman
2945de0173
Fix precedences of * (deref) and & (address-of) ( #21 )
před 7 roky
calixteman
adf868ce9a
Fix parenthesized expression on left side of assignment ( #22 )
před 7 roky
calixteman
fb9fbd83f0
Handle __attribute__ in function declaration ( #19 )
* Handle __attribute__ in function declaration
* Fix tests in examples/
* Remove useless optional
před 7 roky
Calixte Denizet
338f99e8a0
Fix comment containing backslash
před 7 roky