Amaan Qureshi
7b8332686e
chore: add tests
3 vuotta sitten
Amaan Qureshi
bb4ab38847
feat: allow type_qualifiers after typedef specifier, alias char content
3 vuotta sitten
Amaan Qureshi
a726cb95ee
chore: add a test
3 vuotta sitten
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 vuotta sitten
Benjamin Brownlee
693d298099
feat: add gnu inline asm syntax ( #140 )
3 vuotta sitten
Jason Brown
e1359a0a54
Adding support for offsetof
3 vuotta sitten
Amaan Qureshi
4f1a01d461
chore: add a test for the new features
3 vuotta sitten
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 vuotta sitten
calixteman
2ed529f075
Add u|U|u8 string|char support ( #36 )
6 vuotta sitten
Max Brunsfeld
457a7917a1
Use new test structure, add syntax highlighting tests
6 vuotta sitten
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 vuotta sitten
Max Brunsfeld
c3965938cc
Add node fields, update tree-sitter-cli
7 vuotta sitten
calixteman
ff4fc1c785
Handle L-strings and L-chars ( #25 )
7 vuotta sitten
calixteman
2945de0173
Fix precedences of * (deref) and & (address-of) ( #21 )
7 vuotta sitten
calixteman
adf868ce9a
Fix parenthesized expression on left side of assignment ( #22 )
7 vuotta sitten
Calixte Denizet
338f99e8a0
Fix comment containing backslash
7 vuotta sitten
Max Brunsfeld
fd42e75886
Flesh out number literal parsing
Fixes atom/language-c#323
7 vuotta sitten
Max Brunsfeld
175d93b439
Handle postfix type qualifiers in compound literals
Fixes atom/language-c#312
7 vuotta sitten
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 vuotta sitten
Max Brunsfeld
1358e07759
Allow escaped newlines in single-line comments
Fixes tree-sitter/tree-sitter-cpp#26
7 vuotta sitten
Max Brunsfeld
df769721cb
Parse escape sequences
8 vuotta sitten
Max Brunsfeld
e8b6879820
Use repeat in initializer lists
8 vuotta sitten
Max Brunsfeld
0c38b9f8c9
Handle identifier starting with 'false', 'true', etc
8 vuotta sitten
Max Brunsfeld
82b62611b6
Differentiate primitive types from other type names
8 vuotta sitten
Max Brunsfeld
f433b2bf8a
Tweak identifier naming convention
9 vuotta sitten
Max Brunsfeld
66003e2afc
Rename type_clause -> type_descriptor and pull out the parens
9 vuotta sitten
Max Brunsfeld
9e7706d922
Distinguish variables, types, fields and labels using renames
9 vuotta sitten
Max Brunsfeld
42436c29ae
Allow simple abstract function declarators as in `sizeof(void * ())`
9 vuotta sitten
Max Brunsfeld
39a662907b
Make a named node for argument lists in call expressions
9 vuotta sitten
Max Brunsfeld
281e0cd60d
Add 'u' and 'l' suffixes on number literals
9 vuotta sitten
Max Brunsfeld
8e8a968e3b
Fix handling of backslashes in string literals
9 vuotta sitten
Max Brunsfeld
9b715a2620
Add concatenated strings
9 vuotta sitten
Max Brunsfeld
fb51d81c99
Add comma expressions, make parenthesized expressions named rules
9 vuotta sitten
Max Brunsfeld
be2676ed3e
Allow empty initializer lists
9 vuotta sitten
Max Brunsfeld
f4fca3e638
⬆️ tree-sitter, rename grammar_test to corpus
9 vuotta sitten
Max Brunsfeld
f9a1ffa413
Add function-like macros as type specifiers
10 vuotta sitten
Max Brunsfeld
8190b6ea7f
Add hexadecimal, binary and unsigned integer literals
10 vuotta sitten
Max Brunsfeld
fa30191e88
Update grammar to use new tree-sitter API
Also, rewrite the way declarators are handled to produce a clearer AST
10 vuotta sitten
Max Brunsfeld
9bc2e2e19f
Upgrade tree-sitter-compiler
10 vuotta sitten
Max Brunsfeld
280ff87fd0
Use latest tree-sitter-compiler
11 vuotta sitten
Max Brunsfeld
6775e737a6
Fix error in sizeof expressions
11 vuotta sitten
Max Brunsfeld
87ad2e9c69
Base grammar on existing C99 grammar
11 vuotta sitten
Max Brunsfeld
e1871c5213
Allow identifiers starting w/ underscores
11 vuotta sitten
Max Brunsfeld
cdb08d5aff
Add math assignment operators
11 vuotta sitten
Max Brunsfeld
81d2af76bd
Add subscript operator
11 vuotta sitten
Max Brunsfeld
845921d558
Add storage classes to function defs
11 vuotta sitten
Max Brunsfeld
261237e6c6
0.0.1
11 vuotta sitten
Max Brunsfeld
9964b428fd
Add pointer operations
11 vuotta sitten
Max Brunsfeld
ebd581c2bd
Add compound literals
11 vuotta sitten
Max Brunsfeld
5c22801870
Add char literals
11 vuotta sitten