We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
in the C language there is an ambiguity with the syntax T(a);:
T(a);
T
The tree-sitter c grammar does not handle this ambiguity correctly.
Example:
typedef int myInt; int main() { int(a); myInt(d); return 0; }
translation_unit [0, 0] - [9, 0] type_definition [0, 0] - [0, 18] type: primitive_type [0, 8] - [0, 11] declarator: type_identifier [0, 12] - [0, 17] function_definition [3, 0] - [7, 1] type: primitive_type [3, 0] - [3, 3] declarator: function_declarator [3, 4] - [3, 10] declarator: identifier [3, 4] - [3, 8] parameters: parameter_list [3, 8] - [3, 10] body: compound_statement [3, 11] - [7, 1] declaration [4, 8] - [4, 15] type: primitive_type [4, 8] - [4, 11] declarator: parenthesized_declarator [4, 11] - [4, 14] identifier [4, 12] - [4, 13] expression_statement [5, 8] - [5, 17] call_expression [5, 8] - [5, 16] function: identifier [5, 8] - [5, 13] arguments: argument_list [5, 13] - [5, 16] identifier [5, 14] - [5, 15] return_statement [6, 8] - [6, 17] number_literal [6, 15] - [6, 16]
int(a) is parsed as declaration myInt(d) is parsed as call_expression
int(a)
declaration
myInt(d)
call_expression
Is this a desired limitation of tree-sitter, or is this a bug?
The text was updated successfully, but these errors were encountered:
Misunderstood your issue. Mine is different to yours, though kinda similar. I'll move it to a different issue.
Sorry, something went wrong.
No branches or pull requests
Hi,
in the C language there is an ambiguity with the syntax
T(a);
:T
is a type, this is a variable declarationThe tree-sitter c grammar does not handle this ambiguity correctly.
Example:
int(a)
is parsed asdeclaration
myInt(d)
is parsed ascall_expression
Is this a desired limitation of tree-sitter, or is this a bug?
The text was updated successfully, but these errors were encountered: