@backbencher/brain 0.0.0-stage → 0.1.1
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/CHANGELOG.md +298 -0
- package/EMBEDDINGS.md +355 -0
- package/LICENSE +21 -0
- package/README.md +415 -2
- package/bin/bb +13 -0
- package/dist/analysis-exclusions-7ZJDXOVZ.js +35 -0
- package/dist/brain-index-health-Q5APTJQL.js +17 -0
- package/dist/brain-relationship-enrichment-MYR2AM4F.js +558 -0
- package/dist/brain.sql-EIM4WS4D.js +29 -0
- package/dist/chunk-22V37YTK.js +1758 -0
- package/dist/chunk-2BSKD7O3.js +40 -0
- package/dist/chunk-2DE27DVC.js +1314 -0
- package/dist/chunk-2RRBMNBQ.js +322 -0
- package/dist/chunk-2WXYNLBA.js +29 -0
- package/dist/chunk-3CTFIJJB.js +17 -0
- package/dist/chunk-3ZTOHHSW.js +2104 -0
- package/dist/chunk-4H22TLOT.js +543 -0
- package/dist/chunk-5BVAH26D.js +340 -0
- package/dist/chunk-62DHLYW6.js +3427 -0
- package/dist/chunk-7AN7U5IZ.js +371 -0
- package/dist/chunk-7DRPNVIN.js +782 -0
- package/dist/chunk-7MBYT777.js +174 -0
- package/dist/chunk-AHDWGM7Q.js +236 -0
- package/dist/chunk-B5GEAAYF.js +818 -0
- package/dist/chunk-BEIZZ73B.js +1479 -0
- package/dist/chunk-BQ3OVQ3P.js +125 -0
- package/dist/chunk-D2Q4Y47A.js +53 -0
- package/dist/chunk-DIYAGQJL.js +34 -0
- package/dist/chunk-DWKXZ6IF.js +336 -0
- package/dist/chunk-DYM4FQEE.js +90 -0
- package/dist/chunk-ENW4BTBA.js +930 -0
- package/dist/chunk-EWMWK7WN.js +75 -0
- package/dist/chunk-EY5ZZUUA.js +626 -0
- package/dist/chunk-GBI7V7KY.js +69 -0
- package/dist/chunk-GEFFO6O2.js +152 -0
- package/dist/chunk-HJEWO5EV.js +247 -0
- package/dist/chunk-HQSPJDHI.js +613 -0
- package/dist/chunk-KAET47ZL.js +125 -0
- package/dist/chunk-KCDECRJY.js +440 -0
- package/dist/chunk-L5TDYKYK.js +76 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-NO3U3FJQ.js +201 -0
- package/dist/chunk-OWISBAOF.js +61 -0
- package/dist/chunk-QKTRECYS.js +1119 -0
- package/dist/chunk-QLK6ED4Q.js +235 -0
- package/dist/chunk-R2GW4F6R.js +19 -0
- package/dist/chunk-RCMTFSEF.js +87 -0
- package/dist/chunk-RM3PY6TG.js +376 -0
- package/dist/chunk-ROMM6KMC.js +433 -0
- package/dist/chunk-SGGCSHAX.js +12050 -0
- package/dist/chunk-SK6YVHFZ.js +211 -0
- package/dist/chunk-SM7RFQRO.js +214 -0
- package/dist/chunk-UGR4QIGS.js +67 -0
- package/dist/chunk-UQNQZXHY.js +711 -0
- package/dist/chunk-UUNHHX4M.js +13 -0
- package/dist/chunk-VL52PL2T.js +71 -0
- package/dist/chunk-WIG36E67.js +196 -0
- package/dist/chunk-XHK3WWGB.js +7436 -0
- package/dist/chunk-XTQM2IP3.js +2863 -0
- package/dist/chunk-ZE2LG76D.js +1296 -0
- package/dist/chunk-ZETTGPAW.js +6950 -0
- package/dist/cli/index.js +37 -0
- package/dist/config-HZAAYDP3.js +10 -0
- package/dist/content-search-7XIP555Q.js +593 -0
- package/dist/database-76RP44JG.js +9 -0
- package/dist/doctor-ANGETYMN.js +395 -0
- package/dist/edit-engine-CG72LDZD.js +51 -0
- package/dist/engine-BKEOGN7N.js +11 -0
- package/dist/engine-VIW6NSKO.js +18 -0
- package/dist/fingerprint-OBLIMZLP.js +33 -0
- package/dist/framework-intelligence-3LORTPOX.js +860 -0
- package/dist/freshness-3K6VU5OT.js +174 -0
- package/dist/graph-engine-HBSQNPTB.js +21 -0
- package/dist/graph_request-Q6NKB6N2.js +350 -0
- package/dist/impact_request-LYP672WE.js +68 -0
- package/dist/index-space-IUUN5WYV.js +15 -0
- package/dist/index-status-7OVGYSGW.js +34 -0
- package/dist/index.js +159 -0
- package/dist/instance-FO6QZRLH.js +19 -0
- package/dist/language-detection-DFCAU5DZ.js +11 -0
- package/dist/lsp/server.js +4301 -0
- package/dist/mcp/server.js +132 -0
- package/dist/onboard-DIQZV2NW.js +161 -0
- package/dist/override-companion-pass-XR7MHTP7.js +117 -0
- package/dist/parallel-indexer-FK2XKZXY.js +88 -0
- package/dist/pool-worker.js +1153 -0
- package/dist/project-health-6XPENVAA.js +94 -0
- package/dist/project-index-5SDPHITE.js +57 -0
- package/dist/project-registry-ZJ3DVUGO.js +355 -0
- package/dist/real-bash-analyzer-EJAU5LW5.js +2201 -0
- package/dist/real-c-analyzer-HBD3FNNH.js +5942 -0
- package/dist/real-clean-analyzer-4EEZLPV5.js +3470 -0
- package/dist/real-clojure-analyzer-Q55EBOO2.js +2818 -0
- package/dist/real-cpp-analyzer-IVVOD25R.js +4101 -0
- package/dist/real-csharp-analyzer-ZBNLNJZJ.js +3298 -0
- package/dist/real-css-analyzer-6XRQLUN7.js +15 -0
- package/dist/real-dart-analyzer-OLR72EFW.js +3944 -0
- package/dist/real-elixir-analyzer-MQWGAH2I.js +2192 -0
- package/dist/real-erlang-analyzer-7BVPQEHO.js +1731 -0
- package/dist/real-fsharp-analyzer-C2UPFNOA.js +2390 -0
- package/dist/real-go-analyzer-UKGI43YS.js +4126 -0
- package/dist/real-graphql-analyzer-VE2EEFII.js +1442 -0
- package/dist/real-groovy-analyzer-W26VACFW.js +2285 -0
- package/dist/real-haskell-analyzer-5CVVAJRX.js +2533 -0
- package/dist/real-hcl-analyzer-5ZT4U43N.js +725 -0
- package/dist/real-html-analyzer-JWNX3C6I.js +1759 -0
- package/dist/real-java-analyzer-GU42VBGQ.js +4677 -0
- package/dist/real-javascript-analyzer-QA4QOJ6W.js +14 -0
- package/dist/real-json-analyzer-MPA6PRXL.js +1640 -0
- package/dist/real-julia-analyzer-22CWYQMN.js +2085 -0
- package/dist/real-kotlin-analyzer-QDZJLXXU.js +3956 -0
- package/dist/real-lua-analyzer-G7NHLYKS.js +1957 -0
- package/dist/real-makefile-analyzer-OCY3GT5N.js +920 -0
- package/dist/real-markdown-analyzer-TEJK2JXJ.js +1215 -0
- package/dist/real-matlab-analyzer-Q5SWLN7Z.js +480 -0
- package/dist/real-nim-analyzer-YLXSK563.js +3603 -0
- package/dist/real-objective-c-analyzer-D23ACC2R.js +1518 -0
- package/dist/real-perl-analyzer-WWTRHYDT.js +1865 -0
- package/dist/real-php-analyzer-JNKJHTCL.js +9368 -0
- package/dist/real-powershell-analyzer-XRSNQERV.js +2915 -0
- package/dist/real-protobuf-analyzer-3OKUCZ7T.js +867 -0
- package/dist/real-python-analyzer-VXAFWI72.js +4880 -0
- package/dist/real-r-analyzer-ZGAIDVI4.js +2596 -0
- package/dist/real-ruby-analyzer-X2KTLVBH.js +2429 -0
- package/dist/real-rust-analyzer-OFFHPL2A.js +3359 -0
- package/dist/real-scala-analyzer-TSTW27J6.js +3293 -0
- package/dist/real-scss-analyzer-AVWYPSOQ.js +1515 -0
- package/dist/real-solidity-analyzer-UCI2KWUB.js +2608 -0
- package/dist/real-sql-analyzer-F77ZMQXR.js +3840 -0
- package/dist/real-svelte-analyzer-SF7NRUO5.js +2532 -0
- package/dist/real-swift-analyzer-MN5QT3QN.js +2311 -0
- package/dist/real-toml-analyzer-66L7BDCQ.js +929 -0
- package/dist/real-typescript-analyzer-6KEMVDWQ.js +14 -0
- package/dist/real-vb-analyzer-VICVPOP7.js +3145 -0
- package/dist/real-vba-analyzer-HXLTTHKM.js +466 -0
- package/dist/real-vue-analyzer-QXR56CFV.js +2680 -0
- package/dist/real-xml-analyzer-YL465ZJW.js +2405 -0
- package/dist/real-yaml-analyzer-SUBCBNSI.js +3528 -0
- package/dist/real-zig-analyzer-HIQLZMGY.js +2430 -0
- package/dist/regex-search-NJKHMZNO.js +239 -0
- package/dist/rules-ACHPB7QU.js +152 -0
- package/dist/scoped-path-MJYWJZQX.js +11 -0
- package/dist/setup-show-NT5ZHYNE.js +15 -0
- package/dist/setup-wizard-G5YYR5T6.js +24 -0
- package/dist/symbol-search-GZJIM2J2.js +16 -0
- package/dist/taint-KXUHHPIE.js +202 -0
- package/dist/taint-analyzer-N7YLZU3N.js +163 -0
- package/dist/tool-handlers-OJDC35DI.js +72 -0
- package/dist/tool-registry-BPEJNSZG.js +17 -0
- package/dist/tool-validation-Q57YMMBX.js +32 -0
- package/dist/type-inference-QMT2RMLV.js +13 -0
- package/dist/vector-binary-LMY4QGAN.js +19 -0
- package/dist/version-ABP2TUL2.js +9 -0
- package/dist/wasm-NMWO3WXY.js +16 -0
- package/docs/EMBEDDINGS.md +132 -0
- package/docs/README.md +178 -0
- package/docs/data/m10-baseline.json +602 -0
- package/docs/data/m10-benchmark-baseline.json +57 -0
- package/docs/data/m10-benchmark-last-run.json +127 -0
- package/docs/data/m10-final-audit.json +215 -0
- package/docs/data/m12-final-audit.json +138 -0
- package/docs/data/m12-surface-matrix.json +50 -0
- package/docs/data/public-tools.json +1902 -0
- package/docs/indexing/DEAD-ASSETS.md +88 -0
- package/docs/indexing/INDEXER-REVIEW.md +634 -0
- package/docs/indexing/PERFORMANCE-FINDINGS.md +106 -0
- package/docs/indexing/README.md +427 -0
- package/docs/indexing/discovery-matrix.md +41 -0
- package/docs/indexing/embeddings.md +325 -0
- package/docs/indexing/environment-variables.md +77 -0
- package/docs/indexing/performance.md +323 -0
- package/docs/indexing/resume.md +345 -0
- package/docs/indexing/troubleshooting.md +391 -0
- package/docs/man/bb.1 +190 -0
- package/docs/tools/bb_analyze.md +147 -0
- package/docs/tools/bb_annotate.md +110 -0
- package/docs/tools/bb_annotations.md +106 -0
- package/docs/tools/bb_ask.md +101 -0
- package/docs/tools/bb_cross_language.md +103 -0
- package/docs/tools/bb_doc.md +169 -0
- package/docs/tools/bb_edit.md +185 -0
- package/docs/tools/bb_graph.md +169 -0
- package/docs/tools/bb_health.md +156 -0
- package/docs/tools/bb_impact.md +117 -0
- package/docs/tools/bb_index.md +108 -0
- package/docs/tools/bb_migrate.md +135 -0
- package/docs/tools/bb_patterns.md +140 -0
- package/docs/tools/bb_search.md +150 -0
- package/docs/tools/bb_security.md +100 -0
- package/docs/tools/bb_visualize.md +184 -0
- package/grammars/README.md +57 -0
- package/grammars/THIRD-PARTY-NOTICES.md +50 -0
- package/grammars/tree-sitter-c/LICENSE +21 -0
- package/grammars/tree-sitter-clojure/LICENSE.md +21 -0
- package/grammars/tree-sitter-cpp/LICENSE +21 -0
- package/grammars/tree-sitter-csharp/LICENSE +21 -0
- package/grammars/tree-sitter-css/LICENSE +21 -0
- package/grammars/tree-sitter-css/README.md +21 -0
- package/grammars/tree-sitter-dart/LICENSE +20 -0
- package/grammars/tree-sitter-dart-upstream/LICENSE +20 -0
- package/grammars/tree-sitter-dart-upstream/README.md +18 -0
- package/grammars/tree-sitter-elixir/LICENSE +176 -0
- package/grammars/tree-sitter-elixir/README.md +11 -0
- package/grammars/tree-sitter-fsharp/LICENSE +21 -0
- package/grammars/tree-sitter-fsharp/README.md +45 -0
- package/grammars/tree-sitter-graphql/LICENSE +21 -0
- package/grammars/tree-sitter-graphql/README.md +106 -0
- package/grammars/tree-sitter-groovy/LICENSE +21 -0
- package/grammars/tree-sitter-groovy/README.md +4 -0
- package/grammars/tree-sitter-haskell/LICENSE +21 -0
- package/grammars/tree-sitter-haskell/README.md +394 -0
- package/grammars/tree-sitter-hcl/CHANGELOG.md +102 -0
- package/grammars/tree-sitter-hcl/LICENSE +201 -0
- package/grammars/tree-sitter-hcl/README.md +39 -0
- package/grammars/tree-sitter-html/LICENSE +21 -0
- package/grammars/tree-sitter-html/README.md +21 -0
- package/grammars/tree-sitter-julia/LICENSE +21 -0
- package/grammars/tree-sitter-julia/README.md +24 -0
- package/grammars/tree-sitter-kotlin/LICENSE +9 -0
- package/grammars/tree-sitter-lua/LICENSE.md +21 -0
- package/grammars/tree-sitter-lua/README.md +29 -0
- package/grammars/tree-sitter-make/LICENSE +21 -0
- package/grammars/tree-sitter-matlab/LICENSE +19 -0
- package/grammars/tree-sitter-matlab/README.md +99 -0
- package/grammars/tree-sitter-nim/LICENSE +373 -0
- package/grammars/tree-sitter-nim/README.md +46 -0
- package/grammars/tree-sitter-objc/LICENSE +21 -0
- package/grammars/tree-sitter-objc/README.md +20 -0
- package/grammars/tree-sitter-perl/LICENSE +7 -0
- package/grammars/tree-sitter-perl/README.md +100 -0
- package/grammars/tree-sitter-powershell/LICENSE +21 -0
- package/grammars/tree-sitter-powershell/README.md +7 -0
- package/grammars/tree-sitter-proto/LICENSE +21 -0
- package/grammars/tree-sitter-proto/README.md +105 -0
- package/grammars/tree-sitter-r/LICENSE +9 -0
- package/grammars/tree-sitter-r/README.md +66 -0
- package/grammars/tree-sitter-ruby/LICENSE +22 -0
- package/grammars/tree-sitter-scss/LICENSE +21 -0
- package/grammars/tree-sitter-scss/README.md +17 -0
- package/grammars/tree-sitter-solidity/LICENSE +7 -0
- package/grammars/tree-sitter-sql/LICENSE +21 -0
- package/grammars/tree-sitter-typescript/LICENSE +21 -0
- package/grammars/tree-sitter-vba/LICENSE +21 -0
- package/grammars/tree-sitter-vba/README.md +738 -0
- package/grammars/tree-sitter-vbnet/LICENSE +21 -0
- package/grammars/tree-sitter-vbnet/README.md +322 -0
- package/grammars/tree-sitter-xml/LICENSE +19 -0
- package/grammars/tree-sitter-yaml/LICENSE +20 -0
- package/grammars/tree-sitter-yaml/README.md +21 -0
- package/package.json +184 -4
- package/wasm/dart.wasm +0 -0
- package/wasm/tree-sitter-bash.wasm +0 -0
- package/wasm/tree-sitter-c.wasm +0 -0
- package/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/wasm/tree-sitter-clean.wasm +0 -0
- package/wasm/tree-sitter-clojure.wasm +0 -0
- package/wasm/tree-sitter-core_schema.wasm +0 -0
- package/wasm/tree-sitter-cpp.wasm +0 -0
- package/wasm/tree-sitter-css.wasm +0 -0
- package/wasm/tree-sitter-dart.wasm +0 -0
- package/wasm/tree-sitter-elisp.wasm +0 -0
- package/wasm/tree-sitter-elixir.wasm +0 -0
- package/wasm/tree-sitter-elm.wasm +0 -0
- package/wasm/tree-sitter-embedded_template.wasm +0 -0
- package/wasm/tree-sitter-erlang.wasm +0 -0
- package/wasm/tree-sitter-fsharp.wasm +0 -0
- package/wasm/tree-sitter-fsharp_signature.wasm +0 -0
- package/wasm/tree-sitter-go.wasm +0 -0
- package/wasm/tree-sitter-graphql.wasm +0 -0
- package/wasm/tree-sitter-groovy.wasm +0 -0
- package/wasm/tree-sitter-haskell.wasm +0 -0
- package/wasm/tree-sitter-hcl.wasm +0 -0
- package/wasm/tree-sitter-html.wasm +0 -0
- package/wasm/tree-sitter-java.wasm +0 -0
- package/wasm/tree-sitter-javascript.wasm +0 -0
- package/wasm/tree-sitter-json.wasm +0 -0
- package/wasm/tree-sitter-json_schema.wasm +0 -0
- package/wasm/tree-sitter-julia.wasm +0 -0
- package/wasm/tree-sitter-kotlin.wasm +0 -0
- package/wasm/tree-sitter-lua.wasm +0 -0
- package/wasm/tree-sitter-make.wasm +0 -0
- package/wasm/tree-sitter-markdown.wasm +0 -0
- package/wasm/tree-sitter-markdown_inline.wasm +0 -0
- package/wasm/tree-sitter-matlab.wasm +0 -0
- package/wasm/tree-sitter-nim.wasm +0 -0
- package/wasm/tree-sitter-objc.wasm +0 -0
- package/wasm/tree-sitter-ocaml.wasm +0 -0
- package/wasm/tree-sitter-perl.wasm +0 -0
- package/wasm/tree-sitter-php.wasm +0 -0
- package/wasm/tree-sitter-php_only.wasm +0 -0
- package/wasm/tree-sitter-powershell.wasm +0 -0
- package/wasm/tree-sitter-protobuf.wasm +0 -0
- package/wasm/tree-sitter-python.wasm +0 -0
- package/wasm/tree-sitter-ql.wasm +0 -0
- package/wasm/tree-sitter-r.wasm +0 -0
- package/wasm/tree-sitter-rescript.wasm +0 -0
- package/wasm/tree-sitter-ruby.wasm +0 -0
- package/wasm/tree-sitter-rust.wasm +0 -0
- package/wasm/tree-sitter-scala.wasm +0 -0
- package/wasm/tree-sitter-scss.wasm +0 -0
- package/wasm/tree-sitter-solidity.wasm +0 -0
- package/wasm/tree-sitter-sql.wasm +0 -0
- package/wasm/tree-sitter-svelte.wasm +0 -0
- package/wasm/tree-sitter-swift.wasm +0 -0
- package/wasm/tree-sitter-systemrdl.wasm +0 -0
- package/wasm/tree-sitter-terraform.wasm +0 -0
- package/wasm/tree-sitter-tlaplus.wasm +0 -0
- package/wasm/tree-sitter-toml.wasm +0 -0
- package/wasm/tree-sitter-tsx.wasm +0 -0
- package/wasm/tree-sitter-typescript.wasm +0 -0
- package/wasm/tree-sitter-vba.wasm +0 -0
- package/wasm/tree-sitter-vbnet.wasm +0 -0
- package/wasm/tree-sitter-vue.wasm +0 -0
- package/wasm/tree-sitter-xml.wasm +0 -0
- package/wasm/tree-sitter-yaml.wasm +0 -0
- package/wasm/tree-sitter-zig.wasm +0 -0
- package/wasm/tree-sitter.wasm +0 -0
- package/wasm/tsx.wasm +0 -0
- package/wasm/typescript.wasm +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# tree-sitter-proto — vendored and PATCHED
|
|
2
|
+
|
|
3
|
+
This directory is the **source of the wasm the product loads**:
|
|
4
|
+
`wasm/tree-sitter-protobuf.wasm`. It is not a mirror of upstream; it is upstream
|
|
5
|
+
plus eight anchored patches, and the divergence is the point of vendoring it.
|
|
6
|
+
|
|
7
|
+
| file | role |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `grammar.js` | the **patched** grammar. This is what `tree-sitter generate` reads. |
|
|
10
|
+
| `src/grammar.json`, `src/node-types.json` | generated, and tracked **on purpose**: `script/m14/verify-grammar-pins.ts` uses the pair for its offline source↔wasm proof, and without them the check reports "not applicable" and the lane has no proof at all. |
|
|
11
|
+
| `src/parser.c` | generated, 1.3 MB, **not** tracked — `tree-sitter generate` rebuilds it. |
|
|
12
|
+
| `tree-sitter.json` | **added by us.** Upstream has none, so `tree-sitter generate` fell back to ABI 14 and `tree-sitter build --wasm` refused outright ("please ensure you have one"). With it, ABI 15 like every other lane. |
|
|
13
|
+
| `queries/` | upstream's highlighting queries, carried through untouched. |
|
|
14
|
+
| `.upstream-revision` | the exact commit this was taken from. |
|
|
15
|
+
| `LICENSE` | upstream's, MIT. |
|
|
16
|
+
|
|
17
|
+
## Provenance
|
|
18
|
+
|
|
19
|
+
* **Upstream:** `github.com/amaanq/tree-sitter-proto` @ `e9f6b43f6844bd2189b50a422d4e2094313f6aa3`
|
|
20
|
+
* **Why this one:** it is the only protobuf grammar reachable from this machine.
|
|
21
|
+
`ProtocolBuffers/tree-sitter-proto` and `tree-sitter-grammars/tree-sitter-protobuf`
|
|
22
|
+
do not exist, and **no protobuf grammar is published on npm at all** — so there
|
|
23
|
+
was no registry route, only a source route. That is why this directory is a
|
|
24
|
+
local build rather than a package, and why `tree-sitter.json` had to be written.
|
|
25
|
+
* **Upstream's own claim vs measurement.** Its README says *"The grammar should
|
|
26
|
+
be complete. I've tested the grammar against some really large and nasty proto
|
|
27
|
+
files and it passes."* Measured on the reference implementation's own 108
|
|
28
|
+
`.proto` files, unpatched: **62 files carried 527 ERROR nodes**, including
|
|
29
|
+
**70 in `descriptor.proto`** — the file every protobuf tool in existence reads.
|
|
30
|
+
The claim is recorded here rather than repeated, because it was measured false.
|
|
31
|
+
|
|
32
|
+
## What the patches bought, and the evidence for each
|
|
33
|
+
|
|
34
|
+
Every patch is anchored in `grammar.js` and refuses to apply if its anchor is
|
|
35
|
+
absent, so a grammar update cannot half-port. Error counts are on
|
|
36
|
+
`protocolbuffers/protobuf` @ the pinned revision, 108 files, 17,213 lines.
|
|
37
|
+
|
|
38
|
+
| # | patch | upstream's gap | evidence |
|
|
39
|
+
|---|---|---|---|
|
|
40
|
+
| 1 | `edition` rule | root allowed only `optional($.syntax)`, so `edition = "2023";` — which **replaces** syntax in editions, and is what Google and Kubernetes are migrating to — was 2 ERROR nodes | 52 of the 108 reference files declare an edition |
|
|
41
|
+
| 2 | negative field numbers | `field_number` was a bare `int_lit` with no sign | `int32 a = -1;` was 1 ERROR node; the field-number space is signed and negative numbers are legal |
|
|
42
|
+
| 3 | `import option "…";` | the `import` rule allowed only `weak`/`public`, so editions' option-import — the mechanism behind `features` — was an ERROR | this alone was most of `descriptor.proto`'s damage |
|
|
43
|
+
| 4 | option list on `extensions` | `extensions ranges ;` ended at `;`, so `extensions 536000000 [declaration = {…}];` was an ERROR | 3 ERROR nodes, and the aggregate inside it failed too, so one construct took 70 with it |
|
|
44
|
+
| 5 | proto2 `group` | absent entirely | **not rare**: 12 of the 108 reference files use it, so ruling it would have left the lane unable to read a quarter of protobuf's own corpus. Structured as a second `field` alternative, because a group's body is a nested message rather than a `;` and sharing the terminator needs an empty rule, which tree-sitter rejects |
|
|
45
|
+
| 6 | parenthesised option-name segment after a dot | a `(fullIdent)` segment was legal only **first**; `features.(pb.cpp).repeated_type` and `(a.b).(c.d)` were ERRORs | 16 nodes in `repeated_field_proxy_test.proto`, 19 in `unittest_custom_options.proto` — both option-heavy on purpose |
|
|
46
|
+
| 7 | leading dot on an `extend` target | `extend` used `full_ident` (no leading dot) while `message_or_enum_type` had one, so `extend .google.protobuf.FieldOptions {…}` was an ERROR — and fully qualified extend targets are the norm, not an edge case | `unittest_redaction.proto`, 12 nodes |
|
|
47
|
+
| 8 | `local` declaration modifier | a 2023-editions top-level modifier, unknown to the grammar | the reference implementation's own `cpp_file_options.proto` |
|
|
48
|
+
|
|
49
|
+
Measured progression on the same 108 files:
|
|
50
|
+
|
|
51
|
+
| grammar | error files | error nodes |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| upstream, as published | 62 | 527 |
|
|
54
|
+
| + patches 1–2 | 28 | 421 |
|
|
55
|
+
| + patches 3–5 | 12 | 79 |
|
|
56
|
+
| + patches 6–8 | **1** | **13** |
|
|
57
|
+
|
|
58
|
+
A **97.5% reduction in error nodes**, and the 70-error failure on `descriptor.proto`
|
|
59
|
+
is gone entirely.
|
|
60
|
+
|
|
61
|
+
## The one ruled gap, with its consequence
|
|
62
|
+
|
|
63
|
+
**`any { … }` — the proto2 `MessageSet` form, inside a `group`.** It is the only
|
|
64
|
+
construct in the reference corpus this grammar does not parse. Ruled, not deferred,
|
|
65
|
+
and the reason is measured rather than asserted:
|
|
66
|
+
|
|
67
|
+
* the specification **deprecates** `MessageSet` outright; it survives only for a
|
|
68
|
+
handful of legacy systems and protobuf's own guidance is not to use it;
|
|
69
|
+
* it appears in **1 file of 108**, and that file is
|
|
70
|
+
`unittest_custom_options.proto` — the reference implementation's deliberate
|
|
71
|
+
parser-breaking torture test, which exists to be hard;
|
|
72
|
+
* **consequence, measured:** 13 ERROR nodes in that one file. Every other
|
|
73
|
+
construct in that same file parses correctly in isolation — the errors reported
|
|
74
|
+
on lines 338–341 are tree-sitter's *recovery* misattributing damage from the
|
|
75
|
+
`any { }` further down, not separate defects. Verified by extracting each
|
|
76
|
+
construct and parsing it alone: all accept.
|
|
77
|
+
|
|
78
|
+
A file that uses `MessageSet` will lose that construct's fields rather than the
|
|
79
|
+
file. That is the whole consequence, and it is bounded and stated.
|
|
80
|
+
|
|
81
|
+
## Node names are a contract
|
|
82
|
+
|
|
83
|
+
Rules are **snake_case** (`message_body`, `enum_field`, `oneof_field`,
|
|
84
|
+
`map_field`, `service_name`, `rpc_name`, …), which is what this grammar publishes
|
|
85
|
+
and what nine of the ten vendored grammars in this repository also use. The
|
|
86
|
+
analyzer dispatches on those names, and so does the m12 shape-safety census.
|
|
87
|
+
**Do not rename them** — the exception is `graphql`, which was renamed to
|
|
88
|
+
PascalCase for a documented reason specific to its own history, and which is not a
|
|
89
|
+
precedent.
|
|
90
|
+
|
|
91
|
+
## Regenerating the wasm
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
cd grammars/tree-sitter-proto
|
|
95
|
+
tree-sitter generate # -> src/{parser.c,grammar.json,node-types.json}
|
|
96
|
+
tree-sitter build --wasm -o ../../wasm/tree-sitter-protobuf.wasm
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`tree-sitter build --wasm` needs emscripten; with only docker present it uses
|
|
100
|
+
`emscripten/emsdk` through docker automatically. The CLI must be ≥ 0.25 for the
|
|
101
|
+
ABI-15 path; the bb_tests copy at
|
|
102
|
+
`/home/ishaq2321/bb_tests/node_modules/tree-sitter-cli` is 0.25.1.
|
|
103
|
+
|
|
104
|
+
**After regenerating, re-run every gate** — the wasm hash is pinned, and a
|
|
105
|
+
regeneration that changed nothing must not move the recorded digests.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 tree-sitter-r authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# tree-sitter-r (vendored, patched)
|
|
2
|
+
|
|
3
|
+
Base: `@eagleoutice/tree-sitter-r@1.1.2` (MIT). Its published
|
|
4
|
+
`tree-sitter-r.wasm` was byte-identical (sha256
|
|
5
|
+
`b11a872a88ad8a9ebc85607ef3fd4cabdf6cbead51421ec1492b4591b6854553`) to the
|
|
6
|
+
`wasm/tree-sitter-r.wasm` this repository shipped, so this is the same grammar
|
|
7
|
+
with one rule changed.
|
|
8
|
+
|
|
9
|
+
## The patch
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- _hex_literal: $ => /0[xX][0-9a-fA-F]+/,
|
|
13
|
+
- _number_literal: $ => /(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:[eE][+-]?\d*)?/,
|
|
14
|
+
+ _hex_literal_exponent: $ => /0[xX](?:[0-9a-fA-F]+(?:\.[0-9a-fA-F]*)?|\.[0-9a-fA-F]+)[pP][+-]?[0-9]+/,
|
|
15
|
+
+ _hex_literal_plain: $ => /0[xX][0-9a-fA-F]+/,
|
|
16
|
+
+ _hex_literal: $ => choice($._hex_literal_exponent, $._hex_literal_plain),
|
|
17
|
+
+ _number_literal: $ => /(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:[eE][+-]?\d+)?/,
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
R parses every numeric literal with `strtod(3)`, so it accepts the C99
|
|
21
|
+
hexadecimal-float form `0x<hexdigits>[.<hexdigits>]p[+-]<decimals>`, where the
|
|
22
|
+
binary exponent is mandatory. The upstream rule knew only the integer-hex form,
|
|
23
|
+
so the lexer stopped at `0x1` and the remainder was re-read as an identifier
|
|
24
|
+
plus an addition:
|
|
25
|
+
|
|
26
|
+
| Source | Before | After |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| `v <- 0x1p+53` | two statements, `hasError=false` | one `float` |
|
|
29
|
+
| `mn <= 0x1p+53` | `ERROR` on `0x1` plus a stray `p + 53` | clean `float` |
|
|
30
|
+
| `0x.8p1` | `0` and a fabricated identifier `x.8p1` | one `float` |
|
|
31
|
+
| `0xABp-2` | `0xAB`, `p`, `2` | one `float` |
|
|
32
|
+
| `1east` | the float `1e` then `ast` | `1` then `east` |
|
|
33
|
+
|
|
34
|
+
The first row is a silent misparse with no diagnostic anywhere. `Matrix` (CRAN
|
|
35
|
+
recommended, R Core) writes `0x1p+53` in 8 places.
|
|
36
|
+
|
|
37
|
+
The `[eE][+-]?\d*` -> `[eE][+-]?\d+` tightening is the same class of defect: R's
|
|
38
|
+
own scanner requires the digits, and `\d*` let a bare `1e` lex as a float.
|
|
39
|
+
|
|
40
|
+
## Measured effect
|
|
41
|
+
|
|
42
|
+
Both builds produced with the same toolchain, so the delta is this patch alone:
|
|
43
|
+
ERROR/MISSING nodes over 1,174 corpus files **15 -> 3**; Matrix **12 -> 0**;
|
|
44
|
+
4 files improved, **0 regressed**; 0 analyzer output changes; node-type and field
|
|
45
|
+
sets otherwise unchanged (2 new hidden tokens, 0 named types, 0 fields). The 3
|
|
46
|
+
remaining are correct failures — a Go text/template file that ships inside the
|
|
47
|
+
shiny package, and a deliberate syntax-error fixture in testthat.
|
|
48
|
+
|
|
49
|
+
## Rebuilding
|
|
50
|
+
|
|
51
|
+
The vendored `src/scanner.c` is the upstream external scanner and is **required**
|
|
52
|
+
— `tree-sitter build --wasm` fails without it. It is force-added because
|
|
53
|
+
`.gitignore` excludes `grammars/tree-sitter-*/src/*` (that rule exists to keep
|
|
54
|
+
the *generated* `parser.c` / `grammar.json` / `node-types.json` out).
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npm install --no-save tree-sitter-cli@0.24.7
|
|
58
|
+
cd grammars/tree-sitter-r
|
|
59
|
+
npx tree-sitter generate
|
|
60
|
+
npx tree-sitter build --wasm
|
|
61
|
+
cp tree-sitter-r.wasm ../../wasm/tree-sitter-r.wasm
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
To A/B the patch, build the pristine `grammar.js` with the same CLI and compare
|
|
65
|
+
the two wasms over the corpora — that is how the numbers above were produced, and
|
|
66
|
+
it is the only way to separate the patch from toolchain drift.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Rob Rix
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Amaan Qureshi <amaanq12@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# tree-sitter-scss
|
|
2
|
+
|
|
3
|
+
[![CI][ci]](https://github.com/tree-sitter-grammars/tree-sitter-scss/actions/workflows/ci.yml)
|
|
4
|
+
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
|
|
5
|
+
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
|
|
6
|
+
[![crates][crates]](https://crates.io/crates/tree-sitter-scss)
|
|
7
|
+
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-scss)
|
|
8
|
+
[![pypi][pypi]](https://pypi.org/project/tree-sitter-scss)
|
|
9
|
+
|
|
10
|
+
[SCSS](https://sass-lang.com/documentation) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
|
|
11
|
+
|
|
12
|
+
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-scss/ci.yml?logo=github&label=CI
|
|
13
|
+
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
|
|
14
|
+
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
|
|
15
|
+
[npm]: https://img.shields.io/npm/v/tree-sitter-scss?logo=npm
|
|
16
|
+
[crates]: https://img.shields.io/crates/v/tree-sitter-scss?logo=rust
|
|
17
|
+
[pypi]: https://img.shields.io/pypi/v/tree-sitter-scss?logo=pypi&logoColor=ffd242
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2020 Joran Honig
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Derek Stride
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Max Brunsfeld
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 harumiWeb
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|