WolodiaM
37dc8d34fc
Renamed raw_string_* to gnu_raw_string_*
This is GNU extension and GNU extensions seems to be prefixed with
'gnu_' in other places of source code.
3 settimane fa
WolodiaM
d7f6648cc4
Added tests
4 settimane fa
Amaan Qureshi
f00bc3285f
fix: allow 1 character in hex escape sequences
1 anno fa
Amaan Qureshi
9f850b2136
fix: allow type qualifiers after sized type specifiers
1 anno fa
Amaan Qureshi
6c2cf5ed2b
fix: allow empty expression statements at the top level
1 anno fa
Amaan Qureshi
f64152e441
feat: add `extension_expression`
1 anno fa
Amaan Qureshi
0f1658320e
feat: support the `_Nonnull` clang attribute
1 anno fa
Amaan Qureshi
8e6e28c340
fix: ternary consequences can have comma expressions
2 anni fa
Lewis Russell
c325574f64
fix: improve concatenated_string
Now allows `<string> <identifier> ...` forms of concatenations.
2 anni fa
Amaan Qureshi
fea3dea7b9
feat: support missing gnu-style designated initializers
2 anni fa
Amaan Qureshi
978daf49f6
feat: allow `$` in identifiers
2 anni fa
Phil Turnbull
f1075f2d65
fix: `sizeof` precedence is incorrect
2 anni fa
Amaan Qureshi
8a41305cc0
feat: support C23 number suffixes
2 anni fa
Amaan Qureshi
8e919ab298
feat: add `alignof_expression`
2 anni fa
Amaan Qureshi
f786a822b8
feat: add `__extension__`
2 anni fa
Amaan Qureshi
08523da9d6
fix: allow string concatenations to start with an identifier
We do ensure at least one string is present though, otherwise conflicts arise
2 anni fa
Amaan Qureshi
7b8332686e
chore: add tests
3 anni fa
Amaan Qureshi
bb4ab38847
feat: allow type_qualifiers after typedef specifier, alias char content
3 anni fa
Amaan Qureshi
a726cb95ee
chore: add a test
3 anni fa
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>
3 anni fa
Benjamin Brownlee
693d298099
feat: add gnu inline asm syntax ( #140 )
3 anni fa
Jason Brown
e1359a0a54
Adding support for offsetof
3 anni fa
Amaan Qureshi
4f1a01d461
chore: add a test for the new features
3 anni fa
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)
3 anni fa
calixteman
2ed529f075
Add u|U|u8 string|char support ( #36 )
6 anni fa
Max Brunsfeld
457a7917a1
Use new test structure, add syntax highlighting tests
6 anni fa
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
7 anni fa
Max Brunsfeld
c3965938cc
Add node fields, update tree-sitter-cli
7 anni fa
calixteman
ff4fc1c785
Handle L-strings and L-chars ( #25 )
7 anni fa
calixteman
2945de0173
Fix precedences of * (deref) and & (address-of) ( #21 )
7 anni fa
calixteman
adf868ce9a
Fix parenthesized expression on left side of assignment ( #22 )
7 anni fa
Calixte Denizet
338f99e8a0
Fix comment containing backslash
7 anni fa
Max Brunsfeld
fd42e75886
Flesh out number literal parsing
Fixes atom/language-c#323
7 anni fa
Max Brunsfeld
175d93b439
Handle postfix type qualifiers in compound literals
Fixes atom/language-c#312
7 anni fa
Max Brunsfeld
95b5710ff9
Allow number literals with 'f' suffix and digit separators
Fixes tree-sitter/tree-sitter-cpp#24
Fixes tree-sitter/tree-sitter-cpp#34
7 anni fa
Max Brunsfeld
1358e07759
Allow escaped newlines in single-line comments
Fixes tree-sitter/tree-sitter-cpp#26
7 anni fa
Max Brunsfeld
df769721cb
Parse escape sequences
8 anni fa
Max Brunsfeld
e8b6879820
Use repeat in initializer lists
8 anni fa
Max Brunsfeld
0c38b9f8c9
Handle identifier starting with 'false', 'true', etc
8 anni fa
Max Brunsfeld
82b62611b6
Differentiate primitive types from other type names
8 anni fa
Max Brunsfeld
f433b2bf8a
Tweak identifier naming convention
9 anni fa
Max Brunsfeld
66003e2afc
Rename type_clause -> type_descriptor and pull out the parens
9 anni fa
Max Brunsfeld
9e7706d922
Distinguish variables, types, fields and labels using renames
9 anni fa
Max Brunsfeld
42436c29ae
Allow simple abstract function declarators as in `sizeof(void * ())`
9 anni fa
Max Brunsfeld
39a662907b
Make a named node for argument lists in call expressions
9 anni fa
Max Brunsfeld
281e0cd60d
Add 'u' and 'l' suffixes on number literals
9 anni fa
Max Brunsfeld
8e8a968e3b
Fix handling of backslashes in string literals
9 anni fa
Max Brunsfeld
9b715a2620
Add concatenated strings
9 anni fa
Max Brunsfeld
fb51d81c99
Add comma expressions, make parenthesized expressions named rules
9 anni fa
Max Brunsfeld
be2676ed3e
Allow empty initializer lists
9 anni fa