tree-sitter-java
tree-sitter-java copied to clipboard
`open` used in function declaration is parsed as keyword `open` (which is used in module declaration)
Problem description
open used in function declaration is parsed as keyword open (which is used in module declaration)
An example program:
class A{
void open() {
}
}
Expected parse tree output (optional)
Actual parse tree output (optional)
I transform it to a Python object.
{'type': 'program',
'children': [{'type': 'class_declaration',
'children': [{'type': 'class', 'children': [], 'text': 'class'},
{'type': 'identifier', 'children': [], 'text': 'A'},
{'type': 'class_body',
'children': [{'type': '{', 'children': [], 'text': '{'},
{'type': 'method_declaration',
'children': [{'type': 'void_type', 'children': [], 'text': 'void'},
{'type': 'open', 'children': [], 'text': 'open'},
{'type': 'formal_parameters',
'children': [{'type': '(', 'children': [], 'text': '('},
{'type': ')', 'children': [], 'text': ')'}]},
{'type': 'block',
'children': [{'type': '{', 'children': [], 'text': '{'},
{'type': '}', 'children': [], 'text': '}'}]}]},
{'type': '}', 'children': [], 'text': '}'}]}]}]}