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
Tree sitter parser provides a CST (Context Syntax Tree) that contains too much unnecessary information and is hard to traverse.
Converting this CST to an AST, will allow a more comfortable way of traversing the code and should be easier to get more accurate information about what's currently under cursor, allowing to drop logic to parse strings that is prone to be fragile and difficult to understand (which is a wasteful effort as treesitter is already parsing that for me).
This will also allow to implement a system that could run passes on the tree, calculating necessary information required for the different operations of the LSP.
Furthermore, working with the AST will prepare for when the c3 compiler can emit the AST itself.
Work with an AST instead of CST
Tree sitter parser provides a CST (Context Syntax Tree) that contains too much unnecessary information and is hard to traverse.
Converting this CST to an AST, will allow a more comfortable way of traversing the code and should be easier to get more accurate information about what's currently under cursor, allowing to drop logic to parse strings that is prone to be fragile and difficult to understand (which is a wasteful effort as treesitter is already parsing that for me).
This will also allow to implement a system that could run passes on the tree, calculating necessary information required for the different operations of the LSP.
Furthermore, working with the AST will prepare for when the c3 compiler can emit the AST itself.
## Status
The text was updated successfully, but these errors were encountered: