chore: add scanner.c to the bindings

This commit is contained in:
Uy Ha 2024-06-05 08:42:21 +00:00
parent a414a4c83d
commit 135aae6dd4
6 changed files with 10 additions and 16 deletions

View file

@ -9,12 +9,7 @@ edition = "2018"
license = "MIT" license = "MIT"
build = "bindings/rust/build.rs" build = "bindings/rust/build.rs"
include = [ include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
"bindings/rust/*",
"grammar.js",
"queries/*",
"src/*",
]
[lib] [lib]
path = "bindings/rust/lib.rs" path = "bindings/rust/lib.rs"

1
Package.swift generated
View file

@ -36,6 +36,7 @@ let package = Package(
], ],
sources: [ sources: [
"src/parser.c", "src/parser.c",
"src/scanner.c",
// NOTE: if your language has an external scanner, add it here. // NOTE: if your language has an external scanner, add it here.
], ],
resources: [ resources: [

1
binding.gyp generated
View file

@ -11,6 +11,7 @@
"sources": [ "sources": [
"bindings/node/binding.cc", "bindings/node/binding.cc",
"src/parser.c", "src/parser.c",
"src/scanner.c",
# NOTE: if your language has an external scanner, add it here. # NOTE: if your language has an external scanner, add it here.
], ],
"cflags_c": [ "cflags_c": [

View file

@ -2,6 +2,7 @@ package tree_sitter_cmake
// #cgo CFLAGS: -std=c11 -fPIC // #cgo CFLAGS: -std=c11 -fPIC
// #include "../../src/parser.c" // #include "../../src/parser.c"
// #include "../../src/scanner.c"
// // NOTE: if your language has an external scanner, add it here. // // NOTE: if your language has an external scanner, add it here.
import "C" import "C"

View file

@ -12,7 +12,7 @@ classifiers = [
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Compilers", "Topic :: Software Development :: Compilers",
"Topic :: Text Processing :: Linguistic", "Topic :: Text Processing :: Linguistic",
"Typing :: Typed" "Typing :: Typed",
] ]
requires-python = ">=3.8" requires-python = ">=3.8"
license.text = "MIT" license.text = "MIT"

14
setup.py generated
View file

@ -36,22 +36,18 @@ setup(
sources=[ sources=[
"bindings/python/tree_sitter_cmake/binding.c", "bindings/python/tree_sitter_cmake/binding.c",
"src/parser.c", "src/parser.c",
"src/scanner.c",
# NOTE: if your language uses an external scanner, add it here. # NOTE: if your language uses an external scanner, add it here.
], ],
extra_compile_args=( extra_compile_args=(["-std=c11"] if system() != "Windows" else []),
["-std=c11"] if system() != 'Windows' else []
),
define_macros=[ define_macros=[
("Py_LIMITED_API", "0x03080000"), ("Py_LIMITED_API", "0x03080000"),
("PY_SSIZE_T_CLEAN", None) ("PY_SSIZE_T_CLEAN", None),
], ],
include_dirs=["src"], include_dirs=["src"],
py_limited_api=True, py_limited_api=True,
) )
], ],
cmdclass={ cmdclass={"build": Build, "bdist_wheel": BdistWheel},
"build": Build, zip_safe=False,
"bdist_wheel": BdistWheel
},
zip_safe=False
) )