ikatyang / tree-sitter-vue

Vue grammar for tree-sitter
https://ikatyang.github.io/tree-sitter-vue/
MIT License
77 stars 25 forks source link

Remove symbols starting with 'tree_sitter_html_' #30

Open mjambon opened 2 months ago

mjambon commented 2 months ago

Including the file scanner.cc from tree-sitter-html causes a duplication of symbols and parsing errors when using both tree-sitter-html and tree-sitter-vue in the same program. It was particularly hard to detect because there was no compiler warning in our application (Semgrep).

You may not want to merge this pull request as is since the changes will be overridden when we run the script scripts/update-html-scanner.sh. I would actually suggest removing the script since it's a little complicated and keep a patch file instead. I can do this if you think it's a good idea. Let us know.

Note that I didn't invest too much time into this because recent versions of tree-sitter no longer support C++ scanners. The current scanner would have to be translated to pure C (I briefly tried and failed). tree-sitter-html was already updated to provide a C scanner.