semantic icon indicating copy to clipboard operation
semantic copied to clipboard

Add C support

Open jtojnar opened this issue 4 years ago • 2 comments

Just a basic C parsing support (no tags) based on https://github.com/tree-sitter/haskell-tree-sitter/pull/294.

You can try it by checking out the haskell-tree-sitter branch from https://github.com/tree-sitter/haskell-tree-sitter/pull/294, setting the path in cabal.project.local in the semantic root (e.g. packages: ../haskell-tree-sitter/tree-sitter-c) and then run RUNFILES_DIR=path/to/haskell-tree-sitter cabal run semantic-ast -- --rootdir=. --language=C (I have no idea to make Bazel use local Haskell packages).

jtojnar avatar Dec 18 '21 00:12 jtojnar

This is very cool. How does the tree-sitter-c package handle #include facilities and the like? The preprocessor is a harsh mistress.

patrickt avatar Jan 03 '22 15:01 patrickt

Not sure, I never managed to get it working because tree sitter itself was segfaulting for me half the time so I switched to Coccinelle.

jtojnar avatar Jan 03 '22 15:01 jtojnar