forked from tree-sitter/tree-sitter-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
182 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
======================================== | ||
Primitive types | ||
======================================== | ||
|
||
__TYPE_EXPRESSION int | ||
__TYPE_EXPRESSION uint8_t | ||
__TYPE_EXPRESSION uint16_t | ||
__TYPE_EXPRESSION uint32_t | ||
__TYPE_EXPRESSION uint64_t | ||
__TYPE_EXPRESSION uintptr_t | ||
|
||
__TYPE_EXPRESSION int8_t | ||
__TYPE_EXPRESSION int16_t | ||
__TYPE_EXPRESSION int32_t | ||
__TYPE_EXPRESSION int64_t | ||
__TYPE_EXPRESSION intptr_t | ||
|
||
__TYPE_EXPRESSION char16_t | ||
__TYPE_EXPRESSION char32_t | ||
|
||
__TYPE_EXPRESSION size_t | ||
__TYPE_EXPRESSION ssize_t | ||
|
||
--- | ||
|
||
(translation_unit | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type)) | ||
(type_expression (primitive_type))) | ||
|
||
======================================== | ||
Pointer types | ||
======================================== | ||
|
||
__TYPE_EXPRESSION int * | ||
__TYPE_EXPRESSION uint8_t * | ||
__TYPE_EXPRESSION uint16_t * | ||
__TYPE_EXPRESSION uint32_t * | ||
__TYPE_EXPRESSION uint64_t * | ||
__TYPE_EXPRESSION uintptr_t * | ||
|
||
__TYPE_EXPRESSION int8_t * | ||
__TYPE_EXPRESSION int16_t * | ||
__TYPE_EXPRESSION int32_t * | ||
__TYPE_EXPRESSION int64_t * | ||
__TYPE_EXPRESSION intptr_t * | ||
|
||
__TYPE_EXPRESSION char16_t * | ||
__TYPE_EXPRESSION char32_t * | ||
|
||
__TYPE_EXPRESSION size_t * | ||
__TYPE_EXPRESSION ssize_t * | ||
|
||
__TYPE_EXPRESSION void * | ||
|
||
--- | ||
|
||
(translation_unit | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator)) | ||
(type_expression (primitive_type) (abstract_pointer_declarator))) | ||
|
||
======================================== | ||
Array types | ||
======================================== | ||
|
||
__TYPE_EXPRESSION int [5] | ||
__TYPE_EXPRESSION uint8_t [2] | ||
__TYPE_EXPRESSION uint16_t [5] | ||
__TYPE_EXPRESSION uint32_t [20] | ||
__TYPE_EXPRESSION uint64_t [0] | ||
__TYPE_EXPRESSION uintptr_t [] | ||
|
||
--- | ||
|
||
(translation_unit | ||
(type_expression (primitive_type) (abstract_array_declarator (number_literal))) | ||
(type_expression (primitive_type) (abstract_array_declarator (number_literal))) | ||
(type_expression (primitive_type) (abstract_array_declarator (number_literal))) | ||
(type_expression (primitive_type) (abstract_array_declarator (number_literal))) | ||
(type_expression (primitive_type) (abstract_array_declarator (number_literal))) | ||
(type_expression (primitive_type) (abstract_array_declarator))) | ||
|
||
======================================== | ||
Array pointer types | ||
======================================== | ||
|
||
__TYPE_EXPRESSION int* [5] | ||
__TYPE_EXPRESSION uint8_t* [2] | ||
__TYPE_EXPRESSION uint16_t* [5] | ||
__TYPE_EXPRESSION uint32_t* [20] | ||
__TYPE_EXPRESSION uint64_t* [0] | ||
__TYPE_EXPRESSION uintptr_t* [] | ||
|
||
--- | ||
|
||
(translation_unit | ||
(type_expression (primitive_type) (abstract_pointer_declarator (abstract_array_declarator (number_literal)))) | ||
(type_expression (primitive_type) (abstract_pointer_declarator (abstract_array_declarator (number_literal)))) | ||
(type_expression (primitive_type) (abstract_pointer_declarator (abstract_array_declarator (number_literal)))) | ||
(type_expression (primitive_type) (abstract_pointer_declarator (abstract_array_declarator (number_literal)))) | ||
(type_expression (primitive_type) (abstract_pointer_declarator (abstract_array_declarator (number_literal)))) | ||
(type_expression (primitive_type) (abstract_pointer_declarator (abstract_array_declarator)))) | ||
|
||
======================================== | ||
Array pointer types with qualifiers | ||
======================================== | ||
|
||
__TYPE_EXPRESSION const int* [5] | ||
__TYPE_EXPRESSION volatile uint8_t* [2] | ||
__TYPE_EXPRESSION const uint16_t* [5] | ||
__TYPE_EXPRESSION const uintptr_t* [] | ||
|
||
--- | ||
|
||
(translation_unit | ||
(type_expression (type_qualifier) (primitive_type) (abstract_pointer_declarator (abstract_array_declarator (number_literal)))) | ||
(type_expression (type_qualifier) (primitive_type) (abstract_pointer_declarator (abstract_array_declarator (number_literal)))) | ||
(type_expression (type_qualifier) (primitive_type) (abstract_pointer_declarator (abstract_array_declarator (number_literal)))) | ||
(type_expression (type_qualifier) (primitive_type) (abstract_pointer_declarator (abstract_array_declarator)))) | ||
|
||
======================================== | ||
Complex types | ||
======================================== | ||
|
||
__TYPE_EXPRESSION struct s1 * | ||
|
||
__TYPE_EXPRESSION struct s2 { | ||
int x; | ||
float y : 5; | ||
} [5] | ||
|
||
--- | ||
|
||
(translation_unit | ||
(type_expression (struct_specifier (type_identifier)) (abstract_pointer_declarator)) | ||
(type_expression (struct_specifier (type_identifier) (field_declaration_list | ||
(field_declaration (primitive_type) (field_identifier)) (field_declaration (primitive_type) | ||
(field_identifier) (bitfield_clause (number_literal))))) (abstract_array_declarator | ||
(number_literal)))) | ||
|
||
|