tree-sitter / tree-sitter-html

HTML grammar for Tree-sitter
MIT License
136 stars 72 forks source link

Multiple Definitions of "scan", "deserialize", and "serialize" when linked with tree-sitter-php #63

Closed esheri3 closed 1 year ago

esheri3 commented 1 year ago

I am working on a project that links multiple tree-sitter grammar libraries together (ex: tree-sitter-go, tree-sitter-json, ...). Recently, I received "multiple definitions of" errors for "scan", "deserialize", and "serialize" between tree-sitter-html and tree-sitter-php.

Ex:

tree-sitter-php/src/scanner.c:438: multiple definition of `scan' tree-sitter-html/src/scanner.c:370: first defined here

Are you open to renaming your symbols to have a namespace-like prefix, perhaps something like "tree_sitter_html_scan"? I don't think there's anything I can do on my end short of forking and patching the tree-sitter-html codebase.

Thanks in advance for the consideration!

esheri3 commented 1 year ago

@amaanq I believe the issue was introduced here when migrating from C++ to C: https://github.com/tree-sitter/tree-sitter-html/commit/3af1bfd3a7e843c502e66025ca8ff2ae75cabf7f

amaanq commented 1 year ago

Yeah I PRed fixes to bash and php, I'll add one for this

esheri3 commented 1 year ago

Awesome! Thanks for such a quick response!Sent from my iPhoneOn Jul 8, 2023, at 9:03 PM, Amaan Qureshi @.***> wrote: Yeah I PRed fixes to bash and php, I'll add one for this

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

esheri3 commented 1 year ago

Awesome, thanks for the update!

On Mon, Jul 10, 2023 at 2:25 PM Amaan Qureshi @.***> wrote:

Closed #63 https://github.com/tree-sitter/tree-sitter-html/issues/63 as completed via #64 https://github.com/tree-sitter/tree-sitter-html/pull/64.

— Reply to this email directly, view it on GitHub https://github.com/tree-sitter/tree-sitter-html/issues/63#event-9778140809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRF6J7KKKI7NDTC5LZNRLXPRCJDANCNFSM6AAAAAA2DFAEMA . You are receiving this because you authored the thread.Message ID: @.***>