You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It means, the parser should be able to detect that the java syntax is doing well at each time I add one or more tokens. I tried using tree-sitter, but it did work and I do not know if there is a trick.
The code I tested is:
from tree_sitter import Language, Parser
JAVA_LANGUAGE = Language('parser/my-languages.so', 'java')
parser = Parser()
parser.set_language(JAVA_LANGUAGE)
code = 'System.' #.out.println("hello");
tree = parser.parse(bytes(code,'utf8')).root_node
subtree= [x[0] for x in get_all_sub_trees(tree)]
When code = 'System.out.println("hello"); works, but when code = 'System' fails
Thank you in advance
The text was updated successfully, but these errors were encountered:
Answer by @maxbrunsfeld
""
With Tree-sitter, you need to have the entire text available before you can start parsing. It doesn't all need to be stored in a single string/buffer, but you do need to have it available via a callback.
""
Hello, how can I use your parser to work as I explain in the following lines?
It means, the parser should be able to detect that the java syntax is doing well at each time I add one or more tokens. I tried using tree-sitter, but it did work and I do not know if there is a trick.
The code I tested is:
When
code = 'System.out.println("hello");
works, but whencode = 'System'
failsThank you in advance
The text was updated successfully, but these errors were encountered: