@colbymchenry/codegraph-darwin-x64 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/codegraph +3 -0
- package/lib/dist/bin/codegraph.d.ts +21 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -0
- package/lib/dist/bin/codegraph.js +1273 -0
- package/lib/dist/bin/codegraph.js.map +1 -0
- package/lib/dist/bin/node-version-check.d.ts +37 -0
- package/lib/dist/bin/node-version-check.d.ts.map +1 -0
- package/lib/dist/bin/node-version-check.js +79 -0
- package/lib/dist/bin/node-version-check.js.map +1 -0
- package/lib/dist/bin/uninstall.d.ts +14 -0
- package/lib/dist/bin/uninstall.d.ts.map +1 -0
- package/lib/dist/bin/uninstall.js +36 -0
- package/lib/dist/bin/uninstall.js.map +1 -0
- package/lib/dist/config.d.ts +51 -0
- package/lib/dist/config.d.ts.map +1 -0
- package/lib/dist/config.js +321 -0
- package/lib/dist/config.js.map +1 -0
- package/lib/dist/context/formatter.d.ts +30 -0
- package/lib/dist/context/formatter.d.ts.map +1 -0
- package/lib/dist/context/formatter.js +244 -0
- package/lib/dist/context/formatter.js.map +1 -0
- package/lib/dist/context/index.d.ts +97 -0
- package/lib/dist/context/index.d.ts.map +1 -0
- package/lib/dist/context/index.js +1050 -0
- package/lib/dist/context/index.js.map +1 -0
- package/lib/dist/db/index.d.ts +83 -0
- package/lib/dist/db/index.d.ts.map +1 -0
- package/lib/dist/db/index.js +219 -0
- package/lib/dist/db/index.js.map +1 -0
- package/lib/dist/db/migrations.d.ts +44 -0
- package/lib/dist/db/migrations.d.ts.map +1 -0
- package/lib/dist/db/migrations.js +131 -0
- package/lib/dist/db/migrations.js.map +1 -0
- package/lib/dist/db/queries.d.ts +253 -0
- package/lib/dist/db/queries.d.ts.map +1 -0
- package/lib/dist/db/queries.js +1207 -0
- package/lib/dist/db/queries.js.map +1 -0
- package/lib/dist/db/schema.sql +151 -0
- package/lib/dist/db/sqlite-adapter.d.ts +46 -0
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/lib/dist/db/sqlite-adapter.js +114 -0
- package/lib/dist/db/sqlite-adapter.js.map +1 -0
- package/lib/dist/directory.d.ts +57 -0
- package/lib/dist/directory.d.ts.map +1 -0
- package/lib/dist/directory.js +264 -0
- package/lib/dist/directory.js.map +1 -0
- package/lib/dist/errors.d.ts +136 -0
- package/lib/dist/errors.d.ts.map +1 -0
- package/lib/dist/errors.js +219 -0
- package/lib/dist/errors.js.map +1 -0
- package/lib/dist/extraction/dfm-extractor.d.ts +31 -0
- package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/dfm-extractor.js +151 -0
- package/lib/dist/extraction/dfm-extractor.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +78 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -0
- package/lib/dist/extraction/grammars.js +332 -0
- package/lib/dist/extraction/grammars.js.map +1 -0
- package/lib/dist/extraction/index.d.ts +130 -0
- package/lib/dist/extraction/index.d.ts.map +1 -0
- package/lib/dist/extraction/index.js +1305 -0
- package/lib/dist/extraction/index.js.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.js +126 -0
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -0
- package/lib/dist/extraction/languages/csharp.d.ts +3 -0
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/csharp.js +72 -0
- package/lib/dist/extraction/languages/csharp.js.map +1 -0
- package/lib/dist/extraction/languages/dart.d.ts +3 -0
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -0
- package/lib/dist/extraction/languages/dart.js +192 -0
- package/lib/dist/extraction/languages/dart.js.map +1 -0
- package/lib/dist/extraction/languages/go.d.ts +3 -0
- package/lib/dist/extraction/languages/go.d.ts.map +1 -0
- package/lib/dist/extraction/languages/go.js +58 -0
- package/lib/dist/extraction/languages/go.js.map +1 -0
- package/lib/dist/extraction/languages/index.d.ts +10 -0
- package/lib/dist/extraction/languages/index.d.ts.map +1 -0
- package/lib/dist/extraction/languages/index.js +49 -0
- package/lib/dist/extraction/languages/index.js.map +1 -0
- package/lib/dist/extraction/languages/java.d.ts +3 -0
- package/lib/dist/extraction/languages/java.d.ts.map +1 -0
- package/lib/dist/extraction/languages/java.js +64 -0
- package/lib/dist/extraction/languages/java.js.map +1 -0
- package/lib/dist/extraction/languages/javascript.d.ts +3 -0
- package/lib/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/javascript.js +90 -0
- package/lib/dist/extraction/languages/javascript.js.map +1 -0
- package/lib/dist/extraction/languages/kotlin.d.ts +3 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/lib/dist/extraction/languages/kotlin.js +253 -0
- package/lib/dist/extraction/languages/kotlin.js.map +1 -0
- package/lib/dist/extraction/languages/lua.d.ts +3 -0
- package/lib/dist/extraction/languages/lua.d.ts.map +1 -0
- package/lib/dist/extraction/languages/lua.js +150 -0
- package/lib/dist/extraction/languages/lua.js.map +1 -0
- package/lib/dist/extraction/languages/luau.d.ts +3 -0
- package/lib/dist/extraction/languages/luau.d.ts.map +1 -0
- package/lib/dist/extraction/languages/luau.js +37 -0
- package/lib/dist/extraction/languages/luau.js.map +1 -0
- package/lib/dist/extraction/languages/pascal.d.ts +3 -0
- package/lib/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal.js +66 -0
- package/lib/dist/extraction/languages/pascal.js.map +1 -0
- package/lib/dist/extraction/languages/php.d.ts +3 -0
- package/lib/dist/extraction/languages/php.d.ts.map +1 -0
- package/lib/dist/extraction/languages/php.js +107 -0
- package/lib/dist/extraction/languages/php.js.map +1 -0
- package/lib/dist/extraction/languages/python.d.ts +3 -0
- package/lib/dist/extraction/languages/python.d.ts.map +1 -0
- package/lib/dist/extraction/languages/python.js +56 -0
- package/lib/dist/extraction/languages/python.js.map +1 -0
- package/lib/dist/extraction/languages/ruby.d.ts +3 -0
- package/lib/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/lib/dist/extraction/languages/ruby.js +114 -0
- package/lib/dist/extraction/languages/ruby.js.map +1 -0
- package/lib/dist/extraction/languages/rust.d.ts +3 -0
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -0
- package/lib/dist/extraction/languages/rust.js +109 -0
- package/lib/dist/extraction/languages/rust.js.map +1 -0
- package/lib/dist/extraction/languages/scala.d.ts +3 -0
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -0
- package/lib/dist/extraction/languages/scala.js +139 -0
- package/lib/dist/extraction/languages/scala.js.map +1 -0
- package/lib/dist/extraction/languages/swift.d.ts +3 -0
- package/lib/dist/extraction/languages/swift.d.ts.map +1 -0
- package/lib/dist/extraction/languages/swift.js +91 -0
- package/lib/dist/extraction/languages/swift.js.map +1 -0
- package/lib/dist/extraction/languages/typescript.d.ts +3 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/typescript.js +129 -0
- package/lib/dist/extraction/languages/typescript.js.map +1 -0
- package/lib/dist/extraction/liquid-extractor.d.ts +52 -0
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/liquid-extractor.js +313 -0
- package/lib/dist/extraction/liquid-extractor.js.map +1 -0
- package/lib/dist/extraction/parse-worker.d.ts +8 -0
- package/lib/dist/extraction/parse-worker.d.ts.map +1 -0
- package/lib/dist/extraction/parse-worker.js +94 -0
- package/lib/dist/extraction/parse-worker.js.map +1 -0
- package/lib/dist/extraction/svelte-extractor.d.ts +56 -0
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/svelte-extractor.js +272 -0
- package/lib/dist/extraction/svelte-extractor.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.js +103 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts +179 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.js +10 -0
- package/lib/dist/extraction/tree-sitter-types.js.map +1 -0
- package/lib/dist/extraction/tree-sitter.d.ts +233 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter.js +2425 -0
- package/lib/dist/extraction/tree-sitter.js.map +1 -0
- package/lib/dist/extraction/vue-extractor.d.ts +36 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/vue-extractor.js +163 -0
- package/lib/dist/extraction/vue-extractor.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/graph/index.d.ts +8 -0
- package/lib/dist/graph/index.d.ts.map +1 -0
- package/lib/dist/graph/index.js +13 -0
- package/lib/dist/graph/index.js.map +1 -0
- package/lib/dist/graph/queries.d.ts +106 -0
- package/lib/dist/graph/queries.d.ts.map +1 -0
- package/lib/dist/graph/queries.js +366 -0
- package/lib/dist/graph/queries.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +127 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -0
- package/lib/dist/graph/traversal.js +493 -0
- package/lib/dist/graph/traversal.js.map +1 -0
- package/lib/dist/index.d.ts +453 -0
- package/lib/dist/index.d.ts.map +1 -0
- package/lib/dist/index.js +833 -0
- package/lib/dist/index.js.map +1 -0
- package/lib/dist/installer/claude-md-template.d.ts +14 -0
- package/lib/dist/installer/claude-md-template.d.ts.map +1 -0
- package/lib/dist/installer/claude-md-template.js +21 -0
- package/lib/dist/installer/claude-md-template.js.map +1 -0
- package/lib/dist/installer/config-writer.d.ts +29 -0
- package/lib/dist/installer/config-writer.d.ts.map +1 -0
- package/lib/dist/installer/config-writer.js +111 -0
- package/lib/dist/installer/config-writer.js.map +1 -0
- package/lib/dist/installer/index.d.ts +65 -0
- package/lib/dist/installer/index.d.ts.map +1 -0
- package/lib/dist/installer/index.js +406 -0
- package/lib/dist/installer/index.js.map +1 -0
- package/lib/dist/installer/instructions-template.d.ts +28 -0
- package/lib/dist/installer/instructions-template.d.ts.map +1 -0
- package/lib/dist/installer/instructions-template.js +64 -0
- package/lib/dist/installer/instructions-template.js.map +1 -0
- package/lib/dist/installer/targets/claude.d.ts +47 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -0
- package/lib/dist/installer/targets/claude.js +401 -0
- package/lib/dist/installer/targets/claude.js.map +1 -0
- package/lib/dist/installer/targets/codex.d.ts +18 -0
- package/lib/dist/installer/targets/codex.d.ts.map +1 -0
- package/lib/dist/installer/targets/codex.js +185 -0
- package/lib/dist/installer/targets/codex.js.map +1 -0
- package/lib/dist/installer/targets/cursor.d.ts +35 -0
- package/lib/dist/installer/targets/cursor.d.ts.map +1 -0
- package/lib/dist/installer/targets/cursor.js +229 -0
- package/lib/dist/installer/targets/cursor.js.map +1 -0
- package/lib/dist/installer/targets/opencode.d.ts +30 -0
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -0
- package/lib/dist/installer/targets/opencode.js +235 -0
- package/lib/dist/installer/targets/opencode.js.map +1 -0
- package/lib/dist/installer/targets/registry.d.ts +35 -0
- package/lib/dist/installer/targets/registry.d.ts.map +1 -0
- package/lib/dist/installer/targets/registry.js +83 -0
- package/lib/dist/installer/targets/registry.js.map +1 -0
- package/lib/dist/installer/targets/shared.d.ts +77 -0
- package/lib/dist/installer/targets/shared.d.ts.map +1 -0
- package/lib/dist/installer/targets/shared.js +246 -0
- package/lib/dist/installer/targets/shared.js.map +1 -0
- package/lib/dist/installer/targets/toml.d.ts +52 -0
- package/lib/dist/installer/targets/toml.d.ts.map +1 -0
- package/lib/dist/installer/targets/toml.js +147 -0
- package/lib/dist/installer/targets/toml.js.map +1 -0
- package/lib/dist/installer/targets/types.d.ts +116 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -0
- package/lib/dist/installer/targets/types.js +16 -0
- package/lib/dist/installer/targets/types.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +94 -0
- package/lib/dist/mcp/index.d.ts.map +1 -0
- package/lib/dist/mcp/index.js +453 -0
- package/lib/dist/mcp/index.js.map +1 -0
- package/lib/dist/mcp/server-instructions.d.ts +19 -0
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -0
- package/lib/dist/mcp/server-instructions.js +71 -0
- package/lib/dist/mcp/server-instructions.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +257 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -0
- package/lib/dist/mcp/tools.js +1646 -0
- package/lib/dist/mcp/tools.js.map +1 -0
- package/lib/dist/mcp/transport.d.ts +106 -0
- package/lib/dist/mcp/transport.d.ts.map +1 -0
- package/lib/dist/mcp/transport.js +233 -0
- package/lib/dist/mcp/transport.js.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.js +213 -0
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -0
- package/lib/dist/resolution/frameworks/express.d.ts +8 -0
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/express.js +225 -0
- package/lib/dist/resolution/frameworks/express.js.map +1 -0
- package/lib/dist/resolution/frameworks/go.d.ts +8 -0
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/go.js +158 -0
- package/lib/dist/resolution/frameworks/go.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts +42 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/index.js +133 -0
- package/lib/dist/resolution/frameworks/index.js.map +1 -0
- package/lib/dist/resolution/frameworks/java.d.ts +8 -0
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/java.js +177 -0
- package/lib/dist/resolution/frameworks/java.js.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.js +248 -0
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.js +374 -0
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/lib/dist/resolution/frameworks/python.d.ts +10 -0
- package/lib/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/python.js +278 -0
- package/lib/dist/resolution/frameworks/python.js.map +1 -0
- package/lib/dist/resolution/frameworks/react.d.ts +8 -0
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/react.js +272 -0
- package/lib/dist/resolution/frameworks/react.js.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.js +198 -0
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -0
- package/lib/dist/resolution/frameworks/rust.d.ts +8 -0
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/rust.js +207 -0
- package/lib/dist/resolution/frameworks/rust.js.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.js +249 -0
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -0
- package/lib/dist/resolution/frameworks/swift.d.ts +10 -0
- package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/swift.js +376 -0
- package/lib/dist/resolution/frameworks/swift.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue.d.ts +9 -0
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/vue.js +306 -0
- package/lib/dist/resolution/frameworks/vue.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts +40 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -0
- package/lib/dist/resolution/import-resolver.js +663 -0
- package/lib/dist/resolution/import-resolver.js.map +1 -0
- package/lib/dist/resolution/index.d.ts +106 -0
- package/lib/dist/resolution/index.d.ts.map +1 -0
- package/lib/dist/resolution/index.js +709 -0
- package/lib/dist/resolution/index.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +32 -0
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -0
- package/lib/dist/resolution/name-matcher.js +384 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -0
- package/lib/dist/resolution/path-aliases.d.ts +68 -0
- package/lib/dist/resolution/path-aliases.d.ts.map +1 -0
- package/lib/dist/resolution/path-aliases.js +238 -0
- package/lib/dist/resolution/path-aliases.js.map +1 -0
- package/lib/dist/resolution/strip-comments.d.ts +27 -0
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -0
- package/lib/dist/resolution/strip-comments.js +441 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -0
- package/lib/dist/resolution/types.d.ts +172 -0
- package/lib/dist/resolution/types.d.ts.map +1 -0
- package/lib/dist/resolution/types.js +8 -0
- package/lib/dist/resolution/types.js.map +1 -0
- package/lib/dist/search/query-parser.d.ts +57 -0
- package/lib/dist/search/query-parser.d.ts.map +1 -0
- package/lib/dist/search/query-parser.js +177 -0
- package/lib/dist/search/query-parser.js.map +1 -0
- package/lib/dist/search/query-utils.d.ts +53 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -0
- package/lib/dist/search/query-utils.js +350 -0
- package/lib/dist/search/query-utils.js.map +1 -0
- package/lib/dist/sync/git-hooks.d.ts +45 -0
- package/lib/dist/sync/git-hooks.d.ts.map +1 -0
- package/lib/dist/sync/git-hooks.js +223 -0
- package/lib/dist/sync/git-hooks.js.map +1 -0
- package/lib/dist/sync/index.d.ts +17 -0
- package/lib/dist/sync/index.d.ts.map +1 -0
- package/lib/dist/sync/index.js +28 -0
- package/lib/dist/sync/index.js.map +1 -0
- package/lib/dist/sync/watch-policy.d.ts +48 -0
- package/lib/dist/sync/watch-policy.d.ts.map +1 -0
- package/lib/dist/sync/watch-policy.js +124 -0
- package/lib/dist/sync/watch-policy.js.map +1 -0
- package/lib/dist/sync/watcher.d.ts +81 -0
- package/lib/dist/sync/watcher.d.ts.map +1 -0
- package/lib/dist/sync/watcher.js +194 -0
- package/lib/dist/sync/watcher.js.map +1 -0
- package/lib/dist/types.d.ts +423 -0
- package/lib/dist/types.d.ts.map +1 -0
- package/lib/dist/types.js +262 -0
- package/lib/dist/types.js.map +1 -0
- package/lib/dist/ui/glyphs.d.ts +42 -0
- package/lib/dist/ui/glyphs.d.ts.map +1 -0
- package/lib/dist/ui/glyphs.js +78 -0
- package/lib/dist/ui/glyphs.js.map +1 -0
- package/lib/dist/ui/shimmer-progress.d.ts +11 -0
- package/lib/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-progress.js +90 -0
- package/lib/dist/ui/shimmer-progress.js.map +1 -0
- package/lib/dist/ui/shimmer-worker.d.ts +2 -0
- package/lib/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-worker.js +118 -0
- package/lib/dist/ui/shimmer-worker.js.map +1 -0
- package/lib/dist/ui/types.d.ts +17 -0
- package/lib/dist/ui/types.d.ts.map +1 -0
- package/lib/dist/ui/types.js +3 -0
- package/lib/dist/ui/types.js.map +1 -0
- package/lib/dist/utils.d.ts +205 -0
- package/lib/dist/utils.d.ts.map +1 -0
- package/lib/dist/utils.js +549 -0
- package/lib/dist/utils.js.map +1 -0
- package/lib/node_modules/.package-lock.json +116 -0
- package/lib/node_modules/@clack/core/CHANGELOG.md +348 -0
- package/lib/node_modules/@clack/core/LICENSE +9 -0
- package/lib/node_modules/@clack/core/README.md +22 -0
- package/lib/node_modules/@clack/core/dist/index.d.mts +363 -0
- package/lib/node_modules/@clack/core/dist/index.mjs +17 -0
- package/lib/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/core/package.json +63 -0
- package/lib/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/lib/node_modules/@clack/prompts/LICENSE +9 -0
- package/lib/node_modules/@clack/prompts/README.md +375 -0
- package/lib/node_modules/@clack/prompts/dist/index.d.mts +396 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs +144 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/prompts/package.json +68 -0
- package/lib/node_modules/commander/LICENSE +22 -0
- package/lib/node_modules/commander/Readme.md +1176 -0
- package/lib/node_modules/commander/esm.mjs +16 -0
- package/lib/node_modules/commander/index.js +24 -0
- package/lib/node_modules/commander/lib/argument.js +150 -0
- package/lib/node_modules/commander/lib/command.js +2777 -0
- package/lib/node_modules/commander/lib/error.js +39 -0
- package/lib/node_modules/commander/lib/help.js +747 -0
- package/lib/node_modules/commander/lib/option.js +380 -0
- package/lib/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/lib/node_modules/commander/package-support.json +19 -0
- package/lib/node_modules/commander/package.json +82 -0
- package/lib/node_modules/commander/typings/esm.d.mts +3 -0
- package/lib/node_modules/commander/typings/index.d.ts +1113 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/lib/node_modules/fast-string-truncated-width/license +21 -0
- package/lib/node_modules/fast-string-truncated-width/package.json +35 -0
- package/lib/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/lib/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-width/dist/index.js +14 -0
- package/lib/node_modules/fast-string-width/license +21 -0
- package/lib/node_modules/fast-string-width/package.json +34 -0
- package/lib/node_modules/fast-string-width/readme.md +42 -0
- package/lib/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/lib/node_modules/fast-wrap-ansi/README.md +26 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js +219 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
- package/lib/node_modules/fast-wrap-ansi/package.json +51 -0
- package/lib/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/lib/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/lib/node_modules/jsonc-parser/README.md +364 -0
- package/lib/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/lib/node_modules/jsonc-parser/package.json +37 -0
- package/lib/node_modules/picomatch/LICENSE +21 -0
- package/lib/node_modules/picomatch/README.md +738 -0
- package/lib/node_modules/picomatch/index.js +17 -0
- package/lib/node_modules/picomatch/lib/constants.js +180 -0
- package/lib/node_modules/picomatch/lib/parse.js +1085 -0
- package/lib/node_modules/picomatch/lib/picomatch.js +341 -0
- package/lib/node_modules/picomatch/lib/scan.js +391 -0
- package/lib/node_modules/picomatch/lib/utils.js +72 -0
- package/lib/node_modules/picomatch/package.json +83 -0
- package/lib/node_modules/picomatch/posix.js +3 -0
- package/lib/node_modules/sisteransi/license +21 -0
- package/lib/node_modules/sisteransi/package.json +34 -0
- package/lib/node_modules/sisteransi/readme.md +113 -0
- package/lib/node_modules/sisteransi/src/index.js +58 -0
- package/lib/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/lib/node_modules/tree-sitter-wasms/LICENSE +24 -0
- package/lib/node_modules/tree-sitter-wasms/README.md +23 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-bash.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-cpp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-css.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-dart.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elisp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elixir.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elm.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-embedded_template.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-html.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-json.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-lua.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-objc.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ocaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ql.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-solidity.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-swift.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-systemrdl.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tlaplus.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-toml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-yaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-zig.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/package.json +64 -0
- package/lib/node_modules/web-tree-sitter/LICENSE +21 -0
- package/lib/node_modules/web-tree-sitter/README.md +269 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs +4558 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js +4516 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm.map +31 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.c +48 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.h +41 -0
- package/lib/node_modules/web-tree-sitter/lib/array.h +291 -0
- package/lib/node_modules/web-tree-sitter/lib/atomic.h +68 -0
- package/lib/node_modules/web-tree-sitter/lib/clock.h +146 -0
- package/lib/node_modules/web-tree-sitter/lib/error_costs.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.c +523 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.h +36 -0
- package/lib/node_modules/web-tree-sitter/lib/host.h +21 -0
- package/lib/node_modules/web-tree-sitter/lib/language.c +293 -0
- package/lib/node_modules/web-tree-sitter/lib/language.h +293 -0
- package/lib/node_modules/web-tree-sitter/lib/length.h +52 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.c +483 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.h +54 -0
- package/lib/node_modules/web-tree-sitter/lib/lib.c +12 -0
- package/lib/node_modules/web-tree-sitter/lib/node.c +875 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.c +2297 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.h +286 -0
- package/lib/node_modules/web-tree-sitter/lib/point.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/query.c +4347 -0
- package/lib/node_modules/web-tree-sitter/lib/reduce_action.h +34 -0
- package/lib/node_modules/web-tree-sitter/lib/reusable_node.h +95 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.c +912 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.h +133 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.c +1034 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.h +399 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.c +987 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.cjs +2988 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm.map +1 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.c +170 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.h +31 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.c +716 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/ts_assert.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/unicode.h +75 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.c +1937 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.h +31 -0
- package/lib/node_modules/web-tree-sitter/package.json +98 -0
- package/lib/node_modules/web-tree-sitter/src/bindings.ts +26 -0
- package/lib/node_modules/web-tree-sitter/src/constants.ts +133 -0
- package/lib/node_modules/web-tree-sitter/src/index.ts +31 -0
- package/lib/node_modules/web-tree-sitter/src/language.ts +291 -0
- package/lib/node_modules/web-tree-sitter/src/lookahead_iterator.ts +75 -0
- package/lib/node_modules/web-tree-sitter/src/marshal.ts +176 -0
- package/lib/node_modules/web-tree-sitter/src/node.ts +646 -0
- package/lib/node_modules/web-tree-sitter/src/parser.ts +325 -0
- package/lib/node_modules/web-tree-sitter/src/query.ts +973 -0
- package/lib/node_modules/web-tree-sitter/src/tree.ts +145 -0
- package/lib/node_modules/web-tree-sitter/src/tree_cursor.ts +318 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs +4031 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js +3980 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm.map +30 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts +1030 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +56 -0
- package/lib/package.json +55 -0
- package/node +0 -0
- package/package.json +17 -0
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
#include "./length.h"
|
|
2
|
+
#include "./lexer.h"
|
|
3
|
+
#include "./unicode.h"
|
|
4
|
+
|
|
5
|
+
#include "tree_sitter/api.h"
|
|
6
|
+
|
|
7
|
+
#include <stdarg.h>
|
|
8
|
+
#include <stdio.h>
|
|
9
|
+
|
|
10
|
+
#define LOG(message, character) \
|
|
11
|
+
if (self->logger.log) { \
|
|
12
|
+
snprintf( \
|
|
13
|
+
self->debug_buffer, \
|
|
14
|
+
TREE_SITTER_SERIALIZATION_BUFFER_SIZE, \
|
|
15
|
+
32 <= character && character < 127 ? \
|
|
16
|
+
message " character:'%c'" : \
|
|
17
|
+
message " character:%d", \
|
|
18
|
+
character \
|
|
19
|
+
); \
|
|
20
|
+
self->logger.log( \
|
|
21
|
+
self->logger.payload, \
|
|
22
|
+
TSLogTypeLex, \
|
|
23
|
+
self->debug_buffer \
|
|
24
|
+
); \
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static const int32_t BYTE_ORDER_MARK = 0xFEFF;
|
|
28
|
+
|
|
29
|
+
static const TSRange DEFAULT_RANGE = {
|
|
30
|
+
.start_point = {
|
|
31
|
+
.row = 0,
|
|
32
|
+
.column = 0,
|
|
33
|
+
},
|
|
34
|
+
.end_point = {
|
|
35
|
+
.row = UINT32_MAX,
|
|
36
|
+
.column = UINT32_MAX,
|
|
37
|
+
},
|
|
38
|
+
.start_byte = 0,
|
|
39
|
+
.end_byte = UINT32_MAX
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Sets the column data to the given value and marks it valid.
|
|
44
|
+
* @param self The lexer state.
|
|
45
|
+
* @param val The new value of the column data.
|
|
46
|
+
*/
|
|
47
|
+
static void ts_lexer__set_column_data(Lexer *self, uint32_t val) {
|
|
48
|
+
self->column_data.valid = true;
|
|
49
|
+
self->column_data.value = val;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Increments the value of the column data; no-op if invalid.
|
|
54
|
+
* @param self The lexer state.
|
|
55
|
+
*/
|
|
56
|
+
static void ts_lexer__increment_column_data(Lexer *self) {
|
|
57
|
+
if (self->column_data.valid) {
|
|
58
|
+
self->column_data.value++;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Marks the column data as invalid.
|
|
64
|
+
* @param self The lexer state.
|
|
65
|
+
*/
|
|
66
|
+
static void ts_lexer__invalidate_column_data(Lexer *self) {
|
|
67
|
+
self->column_data.valid = false;
|
|
68
|
+
self->column_data.value = 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Check if the lexer has reached EOF. This state is stored
|
|
72
|
+
// by setting the lexer's `current_included_range_index` such that
|
|
73
|
+
// it has consumed all of its available ranges.
|
|
74
|
+
static bool ts_lexer__eof(const TSLexer *_self) {
|
|
75
|
+
Lexer *self = (Lexer *)_self;
|
|
76
|
+
return self->current_included_range_index == self->included_range_count;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Clear the currently stored chunk of source code, because the lexer's
|
|
80
|
+
// position has changed.
|
|
81
|
+
static void ts_lexer__clear_chunk(Lexer *self) {
|
|
82
|
+
self->chunk = NULL;
|
|
83
|
+
self->chunk_size = 0;
|
|
84
|
+
self->chunk_start = 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Call the lexer's input callback to obtain a new chunk of source code
|
|
88
|
+
// for the current position.
|
|
89
|
+
static void ts_lexer__get_chunk(Lexer *self) {
|
|
90
|
+
self->chunk_start = self->current_position.bytes;
|
|
91
|
+
self->chunk = self->input.read(
|
|
92
|
+
self->input.payload,
|
|
93
|
+
self->current_position.bytes,
|
|
94
|
+
self->current_position.extent,
|
|
95
|
+
&self->chunk_size
|
|
96
|
+
);
|
|
97
|
+
if (!self->chunk_size) {
|
|
98
|
+
self->current_included_range_index = self->included_range_count;
|
|
99
|
+
self->chunk = NULL;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Decode the next unicode character in the current chunk of source code.
|
|
104
|
+
// This assumes that the lexer has already retrieved a chunk of source
|
|
105
|
+
// code that spans the current position.
|
|
106
|
+
static void ts_lexer__get_lookahead(Lexer *self) {
|
|
107
|
+
uint32_t position_in_chunk = self->current_position.bytes - self->chunk_start;
|
|
108
|
+
uint32_t size = self->chunk_size - position_in_chunk;
|
|
109
|
+
|
|
110
|
+
if (size == 0) {
|
|
111
|
+
self->lookahead_size = 1;
|
|
112
|
+
self->data.lookahead = '\0';
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const uint8_t *chunk = (const uint8_t *)self->chunk + position_in_chunk;
|
|
117
|
+
DecodeFunction decode =
|
|
118
|
+
self->input.encoding == TSInputEncodingUTF8 ? ts_decode_utf8 :
|
|
119
|
+
self->input.encoding == TSInputEncodingUTF16LE ? ts_decode_utf16_le :
|
|
120
|
+
self->input.encoding == TSInputEncodingUTF16BE ? ts_decode_utf16_be : self->input.decode;
|
|
121
|
+
|
|
122
|
+
self->lookahead_size = decode(chunk, size, &self->data.lookahead);
|
|
123
|
+
|
|
124
|
+
// If this chunk ended in the middle of a multi-byte character,
|
|
125
|
+
// try again with a fresh chunk.
|
|
126
|
+
if (self->data.lookahead == TS_DECODE_ERROR && size < 4) {
|
|
127
|
+
ts_lexer__get_chunk(self);
|
|
128
|
+
chunk = (const uint8_t *)self->chunk;
|
|
129
|
+
size = self->chunk_size;
|
|
130
|
+
self->lookahead_size = decode(chunk, size, &self->data.lookahead);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (self->data.lookahead == TS_DECODE_ERROR) {
|
|
134
|
+
self->lookahead_size = 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
static void ts_lexer_goto(Lexer *self, Length position) {
|
|
139
|
+
if (position.bytes != self->current_position.bytes) {
|
|
140
|
+
ts_lexer__invalidate_column_data(self);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
self->current_position = position;
|
|
144
|
+
|
|
145
|
+
// Move to the first valid position at or after the given position.
|
|
146
|
+
bool found_included_range = false;
|
|
147
|
+
for (unsigned i = 0; i < self->included_range_count; i++) {
|
|
148
|
+
TSRange *included_range = &self->included_ranges[i];
|
|
149
|
+
if (
|
|
150
|
+
included_range->end_byte > self->current_position.bytes &&
|
|
151
|
+
included_range->end_byte > included_range->start_byte
|
|
152
|
+
) {
|
|
153
|
+
if (included_range->start_byte >= self->current_position.bytes) {
|
|
154
|
+
self->current_position = (Length) {
|
|
155
|
+
.bytes = included_range->start_byte,
|
|
156
|
+
.extent = included_range->start_point,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
self->current_included_range_index = i;
|
|
161
|
+
found_included_range = true;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (found_included_range) {
|
|
167
|
+
// If the current position is outside of the current chunk of text,
|
|
168
|
+
// then clear out the current chunk of text.
|
|
169
|
+
if (self->chunk && (
|
|
170
|
+
self->current_position.bytes < self->chunk_start ||
|
|
171
|
+
self->current_position.bytes >= self->chunk_start + self->chunk_size
|
|
172
|
+
)) {
|
|
173
|
+
ts_lexer__clear_chunk(self);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
self->lookahead_size = 0;
|
|
177
|
+
self->data.lookahead = '\0';
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// If the given position is beyond any of included ranges, move to the EOF
|
|
181
|
+
// state - past the end of the included ranges.
|
|
182
|
+
else {
|
|
183
|
+
self->current_included_range_index = self->included_range_count;
|
|
184
|
+
TSRange *last_included_range = &self->included_ranges[self->included_range_count - 1];
|
|
185
|
+
self->current_position = (Length) {
|
|
186
|
+
.bytes = last_included_range->end_byte,
|
|
187
|
+
.extent = last_included_range->end_point,
|
|
188
|
+
};
|
|
189
|
+
ts_lexer__clear_chunk(self);
|
|
190
|
+
self->lookahead_size = 1;
|
|
191
|
+
self->data.lookahead = '\0';
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Actually advances the lexer. Does not log anything.
|
|
197
|
+
* @param self The lexer state.
|
|
198
|
+
* @param skip Whether to mark the consumed codepoint as whitespace.
|
|
199
|
+
*/
|
|
200
|
+
static void ts_lexer__do_advance(Lexer *self, bool skip) {
|
|
201
|
+
if (self->lookahead_size) {
|
|
202
|
+
if (self->data.lookahead == '\n') {
|
|
203
|
+
self->current_position.extent.row++;
|
|
204
|
+
self->current_position.extent.column = 0;
|
|
205
|
+
ts_lexer__set_column_data(self, 0);
|
|
206
|
+
} else {
|
|
207
|
+
bool is_bom = self->current_position.bytes == 0 &&
|
|
208
|
+
self->data.lookahead == BYTE_ORDER_MARK;
|
|
209
|
+
if (!is_bom) ts_lexer__increment_column_data(self);
|
|
210
|
+
self->current_position.extent.column += self->lookahead_size;
|
|
211
|
+
}
|
|
212
|
+
self->current_position.bytes += self->lookahead_size;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const TSRange *current_range = &self->included_ranges[self->current_included_range_index];
|
|
216
|
+
while (
|
|
217
|
+
self->current_position.bytes >= current_range->end_byte ||
|
|
218
|
+
current_range->end_byte == current_range->start_byte
|
|
219
|
+
) {
|
|
220
|
+
if (self->current_included_range_index < self->included_range_count) {
|
|
221
|
+
self->current_included_range_index++;
|
|
222
|
+
}
|
|
223
|
+
if (self->current_included_range_index < self->included_range_count) {
|
|
224
|
+
current_range++;
|
|
225
|
+
self->current_position = (Length) {
|
|
226
|
+
current_range->start_byte,
|
|
227
|
+
current_range->start_point,
|
|
228
|
+
};
|
|
229
|
+
} else {
|
|
230
|
+
current_range = NULL;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (skip) self->token_start_position = self->current_position;
|
|
236
|
+
|
|
237
|
+
if (current_range) {
|
|
238
|
+
if (
|
|
239
|
+
self->current_position.bytes < self->chunk_start ||
|
|
240
|
+
self->current_position.bytes >= self->chunk_start + self->chunk_size
|
|
241
|
+
) {
|
|
242
|
+
ts_lexer__get_chunk(self);
|
|
243
|
+
}
|
|
244
|
+
ts_lexer__get_lookahead(self);
|
|
245
|
+
} else {
|
|
246
|
+
ts_lexer__clear_chunk(self);
|
|
247
|
+
self->data.lookahead = '\0';
|
|
248
|
+
self->lookahead_size = 1;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Advance to the next character in the source code, retrieving a new
|
|
253
|
+
// chunk of source code if needed.
|
|
254
|
+
static void ts_lexer__advance(TSLexer *_self, bool skip) {
|
|
255
|
+
Lexer *self = (Lexer *)_self;
|
|
256
|
+
if (!self->chunk) return;
|
|
257
|
+
|
|
258
|
+
if (skip) {
|
|
259
|
+
LOG("skip", self->data.lookahead)
|
|
260
|
+
} else {
|
|
261
|
+
LOG("consume", self->data.lookahead)
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
ts_lexer__do_advance(self, skip);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Mark that a token match has completed. This can be called multiple
|
|
268
|
+
// times if a longer match is found later.
|
|
269
|
+
static void ts_lexer__mark_end(TSLexer *_self) {
|
|
270
|
+
Lexer *self = (Lexer *)_self;
|
|
271
|
+
if (!ts_lexer__eof(&self->data)) {
|
|
272
|
+
// If the lexer is right at the beginning of included range,
|
|
273
|
+
// then the token should be considered to end at the *end* of the
|
|
274
|
+
// previous included range, rather than here.
|
|
275
|
+
TSRange *current_included_range = &self->included_ranges[
|
|
276
|
+
self->current_included_range_index
|
|
277
|
+
];
|
|
278
|
+
if (
|
|
279
|
+
self->current_included_range_index > 0 &&
|
|
280
|
+
self->current_position.bytes == current_included_range->start_byte
|
|
281
|
+
) {
|
|
282
|
+
TSRange *previous_included_range = current_included_range - 1;
|
|
283
|
+
self->token_end_position = (Length) {
|
|
284
|
+
previous_included_range->end_byte,
|
|
285
|
+
previous_included_range->end_point,
|
|
286
|
+
};
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
self->token_end_position = self->current_position;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
static uint32_t ts_lexer__get_column(TSLexer *_self) {
|
|
294
|
+
Lexer *self = (Lexer *)_self;
|
|
295
|
+
|
|
296
|
+
self->did_get_column = true;
|
|
297
|
+
|
|
298
|
+
if (!self->column_data.valid) {
|
|
299
|
+
// Record current position
|
|
300
|
+
uint32_t goal_byte = self->current_position.bytes;
|
|
301
|
+
|
|
302
|
+
// Back up to the beginning of the line
|
|
303
|
+
Length start_of_col = {
|
|
304
|
+
self->current_position.bytes - self->current_position.extent.column,
|
|
305
|
+
{self->current_position.extent.row, 0},
|
|
306
|
+
};
|
|
307
|
+
ts_lexer_goto(self, start_of_col);
|
|
308
|
+
ts_lexer__set_column_data(self, 0);
|
|
309
|
+
ts_lexer__get_chunk(self);
|
|
310
|
+
|
|
311
|
+
if (!ts_lexer__eof(_self)) {
|
|
312
|
+
ts_lexer__get_lookahead(self);
|
|
313
|
+
|
|
314
|
+
// Advance to the recorded position
|
|
315
|
+
while (self->current_position.bytes < goal_byte && !ts_lexer__eof(_self) && self->chunk) {
|
|
316
|
+
ts_lexer__do_advance(self, false);
|
|
317
|
+
if (ts_lexer__eof(_self)) break;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
return self->column_data.value;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Is the lexer at a boundary between two disjoint included ranges of
|
|
326
|
+
// source code? This is exposed as an API because some languages' external
|
|
327
|
+
// scanners need to perform custom actions at these boundaries.
|
|
328
|
+
static bool ts_lexer__is_at_included_range_start(const TSLexer *_self) {
|
|
329
|
+
const Lexer *self = (const Lexer *)_self;
|
|
330
|
+
if (self->current_included_range_index < self->included_range_count) {
|
|
331
|
+
TSRange *current_range = &self->included_ranges[self->current_included_range_index];
|
|
332
|
+
return self->current_position.bytes == current_range->start_byte;
|
|
333
|
+
} else {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
static void ts_lexer__log(const TSLexer *_self, const char *fmt, ...) {
|
|
339
|
+
Lexer *self = (Lexer *)_self;
|
|
340
|
+
va_list args;
|
|
341
|
+
va_start(args, fmt);
|
|
342
|
+
if (self->logger.log) {
|
|
343
|
+
vsnprintf(self->debug_buffer, TREE_SITTER_SERIALIZATION_BUFFER_SIZE, fmt, args);
|
|
344
|
+
self->logger.log(self->logger.payload, TSLogTypeLex, self->debug_buffer);
|
|
345
|
+
}
|
|
346
|
+
va_end(args);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
void ts_lexer_init(Lexer *self) {
|
|
350
|
+
*self = (Lexer) {
|
|
351
|
+
.data = {
|
|
352
|
+
// The lexer's methods are stored as struct fields so that generated
|
|
353
|
+
// parsers can call them without needing to be linked against this
|
|
354
|
+
// library.
|
|
355
|
+
.advance = ts_lexer__advance,
|
|
356
|
+
.mark_end = ts_lexer__mark_end,
|
|
357
|
+
.get_column = ts_lexer__get_column,
|
|
358
|
+
.is_at_included_range_start = ts_lexer__is_at_included_range_start,
|
|
359
|
+
.eof = ts_lexer__eof,
|
|
360
|
+
.log = ts_lexer__log,
|
|
361
|
+
.lookahead = 0,
|
|
362
|
+
.result_symbol = 0,
|
|
363
|
+
},
|
|
364
|
+
.chunk = NULL,
|
|
365
|
+
.chunk_size = 0,
|
|
366
|
+
.chunk_start = 0,
|
|
367
|
+
.current_position = {0, {0, 0}},
|
|
368
|
+
.logger = {
|
|
369
|
+
.payload = NULL,
|
|
370
|
+
.log = NULL
|
|
371
|
+
},
|
|
372
|
+
.included_ranges = NULL,
|
|
373
|
+
.included_range_count = 0,
|
|
374
|
+
.current_included_range_index = 0,
|
|
375
|
+
.did_get_column = false,
|
|
376
|
+
.column_data = {
|
|
377
|
+
.valid = false,
|
|
378
|
+
.value = 0
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
ts_lexer_set_included_ranges(self, NULL, 0);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
void ts_lexer_delete(Lexer *self) {
|
|
385
|
+
ts_free(self->included_ranges);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
void ts_lexer_set_input(Lexer *self, TSInput input) {
|
|
389
|
+
self->input = input;
|
|
390
|
+
ts_lexer__clear_chunk(self);
|
|
391
|
+
ts_lexer_goto(self, self->current_position);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Move the lexer to the given position. This doesn't do any work
|
|
395
|
+
// if the parser is already at the given position.
|
|
396
|
+
void ts_lexer_reset(Lexer *self, Length position) {
|
|
397
|
+
if (position.bytes != self->current_position.bytes) {
|
|
398
|
+
ts_lexer_goto(self, position);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
void ts_lexer_start(Lexer *self) {
|
|
403
|
+
self->token_start_position = self->current_position;
|
|
404
|
+
self->token_end_position = LENGTH_UNDEFINED;
|
|
405
|
+
self->data.result_symbol = 0;
|
|
406
|
+
self->did_get_column = false;
|
|
407
|
+
if (!ts_lexer__eof(&self->data)) {
|
|
408
|
+
if (!self->chunk_size) ts_lexer__get_chunk(self);
|
|
409
|
+
if (!self->lookahead_size) ts_lexer__get_lookahead(self);
|
|
410
|
+
if (self->current_position.bytes == 0) {
|
|
411
|
+
if (self->data.lookahead == BYTE_ORDER_MARK) {
|
|
412
|
+
ts_lexer__advance(&self->data, true);
|
|
413
|
+
}
|
|
414
|
+
ts_lexer__set_column_data(self, 0);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
void ts_lexer_finish(Lexer *self, uint32_t *lookahead_end_byte) {
|
|
420
|
+
if (length_is_undefined(self->token_end_position)) {
|
|
421
|
+
ts_lexer__mark_end(&self->data);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// If the token ended at an included range boundary, then its end position
|
|
425
|
+
// will have been reset to the end of the preceding range. Reset the start
|
|
426
|
+
// position to match.
|
|
427
|
+
if (self->token_end_position.bytes < self->token_start_position.bytes) {
|
|
428
|
+
self->token_start_position = self->token_end_position;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
uint32_t current_lookahead_end_byte = self->current_position.bytes + 1;
|
|
432
|
+
|
|
433
|
+
// In order to determine that a byte sequence is invalid UTF8 or UTF16,
|
|
434
|
+
// the character decoding algorithm may have looked at the following byte.
|
|
435
|
+
// Therefore, the next byte *after* the current (invalid) character
|
|
436
|
+
// affects the interpretation of the current character.
|
|
437
|
+
if (self->data.lookahead == TS_DECODE_ERROR) {
|
|
438
|
+
current_lookahead_end_byte += 4; // the maximum number of bytes read to identify an invalid code point
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (current_lookahead_end_byte > *lookahead_end_byte) {
|
|
442
|
+
*lookahead_end_byte = current_lookahead_end_byte;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
void ts_lexer_mark_end(Lexer *self) {
|
|
447
|
+
ts_lexer__mark_end(&self->data);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
bool ts_lexer_set_included_ranges(
|
|
451
|
+
Lexer *self,
|
|
452
|
+
const TSRange *ranges,
|
|
453
|
+
uint32_t count
|
|
454
|
+
) {
|
|
455
|
+
if (count == 0 || !ranges) {
|
|
456
|
+
ranges = &DEFAULT_RANGE;
|
|
457
|
+
count = 1;
|
|
458
|
+
} else {
|
|
459
|
+
uint32_t previous_byte = 0;
|
|
460
|
+
for (unsigned i = 0; i < count; i++) {
|
|
461
|
+
const TSRange *range = &ranges[i];
|
|
462
|
+
if (
|
|
463
|
+
range->start_byte < previous_byte ||
|
|
464
|
+
range->end_byte < range->start_byte
|
|
465
|
+
) return false;
|
|
466
|
+
previous_byte = range->end_byte;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
size_t size = count * sizeof(TSRange);
|
|
471
|
+
self->included_ranges = ts_realloc(self->included_ranges, size);
|
|
472
|
+
memcpy(self->included_ranges, ranges, size);
|
|
473
|
+
self->included_range_count = count;
|
|
474
|
+
ts_lexer_goto(self, self->current_position);
|
|
475
|
+
return true;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
TSRange *ts_lexer_included_ranges(const Lexer *self, uint32_t *count) {
|
|
479
|
+
*count = self->included_range_count;
|
|
480
|
+
return self->included_ranges;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
#undef LOG
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#ifndef TREE_SITTER_LEXER_H_
|
|
2
|
+
#define TREE_SITTER_LEXER_H_
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#include "./length.h"
|
|
9
|
+
#include "./subtree.h"
|
|
10
|
+
#include "tree_sitter/api.h"
|
|
11
|
+
#include "./parser.h"
|
|
12
|
+
|
|
13
|
+
typedef struct {
|
|
14
|
+
uint32_t value;
|
|
15
|
+
bool valid;
|
|
16
|
+
} ColumnData;
|
|
17
|
+
|
|
18
|
+
typedef struct {
|
|
19
|
+
TSLexer data;
|
|
20
|
+
Length current_position;
|
|
21
|
+
Length token_start_position;
|
|
22
|
+
Length token_end_position;
|
|
23
|
+
|
|
24
|
+
TSRange *included_ranges;
|
|
25
|
+
const char *chunk;
|
|
26
|
+
TSInput input;
|
|
27
|
+
TSLogger logger;
|
|
28
|
+
|
|
29
|
+
uint32_t included_range_count;
|
|
30
|
+
uint32_t current_included_range_index;
|
|
31
|
+
uint32_t chunk_start;
|
|
32
|
+
uint32_t chunk_size;
|
|
33
|
+
uint32_t lookahead_size;
|
|
34
|
+
bool did_get_column;
|
|
35
|
+
ColumnData column_data;
|
|
36
|
+
|
|
37
|
+
char debug_buffer[TREE_SITTER_SERIALIZATION_BUFFER_SIZE];
|
|
38
|
+
} Lexer;
|
|
39
|
+
|
|
40
|
+
void ts_lexer_init(Lexer *self);
|
|
41
|
+
void ts_lexer_delete(Lexer *self);
|
|
42
|
+
void ts_lexer_set_input(Lexer *self, TSInput input);
|
|
43
|
+
void ts_lexer_reset(Lexer *self, Length position);
|
|
44
|
+
void ts_lexer_start(Lexer *self);
|
|
45
|
+
void ts_lexer_finish(Lexer *self, uint32_t *lookahead_end_byte);
|
|
46
|
+
void ts_lexer_mark_end(Lexer *self);
|
|
47
|
+
bool ts_lexer_set_included_ranges(Lexer *self, const TSRange *ranges, uint32_t count);
|
|
48
|
+
TSRange *ts_lexer_included_ranges(const Lexer *self, uint32_t *count);
|
|
49
|
+
|
|
50
|
+
#ifdef __cplusplus
|
|
51
|
+
}
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
#endif // TREE_SITTER_LEXER_H_
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#include "./alloc.c"
|
|
2
|
+
#include "./get_changed_ranges.c"
|
|
3
|
+
#include "./language.c"
|
|
4
|
+
#include "./lexer.c"
|
|
5
|
+
#include "./node.c"
|
|
6
|
+
#include "./parser.c"
|
|
7
|
+
#include "./query.c"
|
|
8
|
+
#include "./stack.c"
|
|
9
|
+
#include "./subtree.c"
|
|
10
|
+
#include "./tree_cursor.c"
|
|
11
|
+
#include "./tree.c"
|
|
12
|
+
#include "./wasm_store.c"
|