diff --git a/cli/src/templates/binding.go b/cli/src/templates/binding.go index 243a1160..9351f480 100644 --- a/cli/src/templates/binding.go +++ b/cli/src/templates/binding.go @@ -2,7 +2,9 @@ package tree_sitter_LOWER_PARSER_NAME // #cgo CFLAGS: -std=c11 -fPIC // #include "../../src/parser.c" -// // NOTE: if your language has an external scanner, add it here. +// #if __has_include("../../src/scanner.c") +// #include "../../src/scanner.c" +// #endif import "C" import "unsafe" diff --git a/cli/src/templates/binding.gyp b/cli/src/templates/binding.gyp index 9b7feebb..ebea1403 100644 --- a/cli/src/templates/binding.gyp +++ b/cli/src/templates/binding.gyp @@ -11,9 +11,14 @@ "sources": [ "bindings/node/binding.cc", "src/parser.c", - # NOTE: if your language has an external scanner, add it here. ], + "variables": { + "has_scanner": "