arceus-s 1.6.4
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/README.md +395 -0
- package/dist/_shared/graph/types.d.ts +81 -0
- package/dist/_shared/graph/types.d.ts.map +1 -0
- package/dist/_shared/graph/types.js +8 -0
- package/dist/_shared/graph/types.js.map +1 -0
- package/dist/_shared/index.d.ts +63 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/_shared/index.js +48 -0
- package/dist/_shared/index.js.map +1 -0
- package/dist/_shared/integrations/circuit-breaker.d.ts +183 -0
- package/dist/_shared/integrations/circuit-breaker.d.ts.map +1 -0
- package/dist/_shared/integrations/circuit-breaker.js +236 -0
- package/dist/_shared/integrations/circuit-breaker.js.map +1 -0
- package/dist/_shared/integrations/resilient-fetch.d.ts +99 -0
- package/dist/_shared/integrations/resilient-fetch.d.ts.map +1 -0
- package/dist/_shared/integrations/resilient-fetch.js +204 -0
- package/dist/_shared/integrations/resilient-fetch.js.map +1 -0
- package/dist/_shared/integrations/retry.d.ts +60 -0
- package/dist/_shared/integrations/retry.d.ts.map +1 -0
- package/dist/_shared/integrations/retry.js +67 -0
- package/dist/_shared/integrations/retry.js.map +1 -0
- package/dist/_shared/integrations/understand-quickly.d.ts +77 -0
- package/dist/_shared/integrations/understand-quickly.d.ts.map +1 -0
- package/dist/_shared/integrations/understand-quickly.js +176 -0
- package/dist/_shared/integrations/understand-quickly.js.map +1 -0
- package/dist/_shared/language-detection.d.ts +23 -0
- package/dist/_shared/language-detection.d.ts.map +1 -0
- package/dist/_shared/language-detection.js +139 -0
- package/dist/_shared/language-detection.js.map +1 -0
- package/dist/_shared/languages.d.ts +26 -0
- package/dist/_shared/languages.d.ts.map +1 -0
- package/dist/_shared/languages.js +27 -0
- package/dist/_shared/languages.js.map +1 -0
- package/dist/_shared/lbug/schema-constants.d.ts +16 -0
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -0
- package/dist/_shared/lbug/schema-constants.js +67 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -0
- package/dist/_shared/mro-strategy.d.ts +41 -0
- package/dist/_shared/mro-strategy.d.ts.map +1 -0
- package/dist/_shared/mro-strategy.js +2 -0
- package/dist/_shared/mro-strategy.js.map +1 -0
- package/dist/_shared/pipeline.d.ts +16 -0
- package/dist/_shared/pipeline.d.ts.map +1 -0
- package/dist/_shared/pipeline.js +5 -0
- package/dist/_shared/pipeline.js.map +1 -0
- package/dist/_shared/scope-resolution/def-index.d.ts +36 -0
- package/dist/_shared/scope-resolution/def-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/def-index.js +51 -0
- package/dist/_shared/scope-resolution/def-index.js.map +1 -0
- package/dist/_shared/scope-resolution/evidence-weights.d.ts +69 -0
- package/dist/_shared/scope-resolution/evidence-weights.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/evidence-weights.js +84 -0
- package/dist/_shared/scope-resolution/evidence-weights.js.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts +149 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js +795 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts +26 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/language-classification.js +44 -0
- package/dist/_shared/scope-resolution/language-classification.js.map +1 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts +106 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.js +98 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.js.map +1 -0
- package/dist/_shared/scope-resolution/module-scope-index.d.ts +46 -0
- package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/module-scope-index.js +58 -0
- package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -0
- package/dist/_shared/scope-resolution/origin-priority.d.ts +14 -0
- package/dist/_shared/scope-resolution/origin-priority.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/origin-priority.js +21 -0
- package/dist/_shared/scope-resolution/origin-priority.js.map +1 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts +76 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/parsed-file.js +54 -0
- package/dist/_shared/scope-resolution/parsed-file.js.map +1 -0
- package/dist/_shared/scope-resolution/position-index.d.ts +62 -0
- package/dist/_shared/scope-resolution/position-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/position-index.js +134 -0
- package/dist/_shared/scope-resolution/position-index.js.map +1 -0
- package/dist/_shared/scope-resolution/qualified-name-index.d.ts +44 -0
- package/dist/_shared/scope-resolution/qualified-name-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/qualified-name-index.js +75 -0
- package/dist/_shared/scope-resolution/qualified-name-index.js.map +1 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts +75 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/reference-site.js +24 -0
- package/dist/_shared/scope-resolution/reference-site.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/class-registry.d.ts +27 -0
- package/dist/_shared/scope-resolution/registries/class-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/class-registry.js +30 -0
- package/dist/_shared/scope-resolution/registries/class-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts +69 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/context.js +44 -0
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +56 -0
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/evidence.js +150 -0
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/field-registry.d.ts +26 -0
- package/dist/_shared/scope-resolution/registries/field-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/field-registry.js +31 -0
- package/dist/_shared/scope-resolution/registries/field-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts +81 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.js +349 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.d.ts +33 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.js +56 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/method-registry.d.ts +36 -0
- package/dist/_shared/scope-resolution/registries/method-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/method-registry.js +32 -0
- package/dist/_shared/scope-resolution/registries/method-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.d.ts +43 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.js +60 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.js.map +1 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.d.ts +53 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.js +126 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.js.map +1 -0
- package/dist/_shared/scope-resolution/scope-id.d.ts +43 -0
- package/dist/_shared/scope-resolution/scope-id.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/scope-id.js +46 -0
- package/dist/_shared/scope-resolution/scope-id.js.map +1 -0
- package/dist/_shared/scope-resolution/scope-tree.d.ts +83 -0
- package/dist/_shared/scope-resolution/scope-tree.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/scope-tree.js +220 -0
- package/dist/_shared/scope-resolution/scope-tree.js.map +1 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +63 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.js +122 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.js.map +1 -0
- package/dist/_shared/scope-resolution/shadow/diff.d.ts +59 -0
- package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/shadow/diff.js +79 -0
- package/dist/_shared/scope-resolution/shadow/diff.js.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +34 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.js +12 -0
- package/dist/_shared/scope-resolution/symbol-definition.js.map +1 -0
- package/dist/_shared/scope-resolution/types.d.ts +400 -0
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/types.js +25 -0
- package/dist/_shared/scope-resolution/types.js.map +1 -0
- package/dist/_shared/test-helpers.d.ts +13 -0
- package/dist/_shared/test-helpers.d.ts.map +1 -0
- package/dist/_shared/test-helpers.js +13 -0
- package/dist/_shared/test-helpers.js.map +1 -0
- package/dist/cli/ai-context.d.ts +28 -0
- package/dist/cli/ai-context.js +289 -0
- package/dist/cli/analyze.d.ts +80 -0
- package/dist/cli/analyze.js +525 -0
- package/dist/cli/augment.d.ts +13 -0
- package/dist/cli/augment.js +33 -0
- package/dist/cli/clean.d.ts +10 -0
- package/dist/cli/clean.js +79 -0
- package/dist/cli/cli-message.d.ts +16 -0
- package/dist/cli/cli-message.js +71 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.js +31 -0
- package/dist/cli/eval-server.d.ts +37 -0
- package/dist/cli/eval-server.js +423 -0
- package/dist/cli/group.d.ts +1 -0
- package/dist/cli/group.js +323 -0
- package/dist/cli/index-repo.d.ts +15 -0
- package/dist/cli/index-repo.js +120 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +492 -0
- package/dist/cli/lazy-action.d.ts +6 -0
- package/dist/cli/lazy-action.js +18 -0
- package/dist/cli/list.d.ts +6 -0
- package/dist/cli/list.js +40 -0
- package/dist/cli/mcp.d.ts +29 -0
- package/dist/cli/mcp.js +73 -0
- package/dist/cli/optional-grammars.d.ts +47 -0
- package/dist/cli/optional-grammars.js +87 -0
- package/dist/cli/publish.d.ts +29 -0
- package/dist/cli/publish.js +174 -0
- package/dist/cli/remove.d.ts +30 -0
- package/dist/cli/remove.js +102 -0
- package/dist/cli/serve.d.ts +4 -0
- package/dist/cli/serve.js +55 -0
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.js +642 -0
- package/dist/cli/skill-gen.d.ts +26 -0
- package/dist/cli/skill-gen.js +555 -0
- package/dist/cli/status.d.ts +6 -0
- package/dist/cli/status.js +36 -0
- package/dist/cli/tool.d.ts +43 -0
- package/dist/cli/tool.js +169 -0
- package/dist/cli/wiki.d.ts +23 -0
- package/dist/cli/wiki.js +616 -0
- package/dist/config/ignore-service.d.ts +35 -0
- package/dist/config/ignore-service.js +439 -0
- package/dist/config/supported-languages.d.ts +13 -0
- package/dist/config/supported-languages.js +13 -0
- package/dist/core/augmentation/engine.d.ts +26 -0
- package/dist/core/augmentation/engine.js +272 -0
- package/dist/core/embedding-mode.d.ts +51 -0
- package/dist/core/embedding-mode.js +48 -0
- package/dist/core/embeddings/ast-utils.d.ts +22 -0
- package/dist/core/embeddings/ast-utils.js +106 -0
- package/dist/core/embeddings/character-chunk.d.ts +12 -0
- package/dist/core/embeddings/character-chunk.js +43 -0
- package/dist/core/embeddings/chunker.d.ts +14 -0
- package/dist/core/embeddings/chunker.js +239 -0
- package/dist/core/embeddings/config.d.ts +2 -0
- package/dist/core/embeddings/config.js +36 -0
- package/dist/core/embeddings/embedder.d.ts +65 -0
- package/dist/core/embeddings/embedder.js +349 -0
- package/dist/core/embeddings/embedding-pipeline.d.ts +68 -0
- package/dist/core/embeddings/embedding-pipeline.js +552 -0
- package/dist/core/embeddings/exact-search.d.ts +15 -0
- package/dist/core/embeddings/exact-search.js +27 -0
- package/dist/core/embeddings/hf-env.d.ts +135 -0
- package/dist/core/embeddings/hf-env.js +232 -0
- package/dist/core/embeddings/http-client.d.ts +37 -0
- package/dist/core/embeddings/http-client.js +199 -0
- package/dist/core/embeddings/index.d.ts +10 -0
- package/dist/core/embeddings/index.js +10 -0
- package/dist/core/embeddings/line-index.d.ts +7 -0
- package/dist/core/embeddings/line-index.js +42 -0
- package/dist/core/embeddings/server-mapping.d.ts +15 -0
- package/dist/core/embeddings/server-mapping.js +33 -0
- package/dist/core/embeddings/structural-extractor.d.ts +15 -0
- package/dist/core/embeddings/structural-extractor.js +58 -0
- package/dist/core/embeddings/text-generator.d.ts +31 -0
- package/dist/core/embeddings/text-generator.js +208 -0
- package/dist/core/embeddings/types.d.ts +211 -0
- package/dist/core/embeddings/types.js +202 -0
- package/dist/core/git-staleness.d.ts +37 -0
- package/dist/core/git-staleness.js +167 -0
- package/dist/core/graph/graph.d.ts +2 -0
- package/dist/core/graph/graph.js +173 -0
- package/dist/core/graph/types.d.ts +36 -0
- package/dist/core/graph/types.js +1 -0
- package/dist/core/group/bridge-db.d.ts +82 -0
- package/dist/core/group/bridge-db.js +609 -0
- package/dist/core/group/bridge-schema.d.ts +27 -0
- package/dist/core/group/bridge-schema.js +55 -0
- package/dist/core/group/config-parser.d.ts +7 -0
- package/dist/core/group/config-parser.js +122 -0
- package/dist/core/group/contract-extractor.d.ts +7 -0
- package/dist/core/group/contract-extractor.js +1 -0
- package/dist/core/group/cross-impact.d.ts +85 -0
- package/dist/core/group/cross-impact.js +515 -0
- package/dist/core/group/extractors/elixir-workspace-extractor.d.ts +15 -0
- package/dist/core/group/extractors/elixir-workspace-extractor.js +204 -0
- package/dist/core/group/extractors/fs-utils.d.ts +10 -0
- package/dist/core/group/extractors/fs-utils.js +24 -0
- package/dist/core/group/extractors/go-workspace-extractor.d.ts +14 -0
- package/dist/core/group/extractors/go-workspace-extractor.js +217 -0
- package/dist/core/group/extractors/grpc-extractor.d.ts +25 -0
- package/dist/core/group/extractors/grpc-extractor.js +414 -0
- package/dist/core/group/extractors/grpc-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/go.js +97 -0
- package/dist/core/group/extractors/grpc-patterns/index.d.ts +19 -0
- package/dist/core/group/extractors/grpc-patterns/index.js +46 -0
- package/dist/core/group/extractors/grpc-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/java.js +173 -0
- package/dist/core/group/extractors/grpc-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/grpc-patterns/node.js +290 -0
- package/dist/core/group/extractors/grpc-patterns/proto.d.ts +9 -0
- package/dist/core/group/extractors/grpc-patterns/proto.js +134 -0
- package/dist/core/group/extractors/grpc-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/python.js +67 -0
- package/dist/core/group/extractors/grpc-patterns/types.d.ts +50 -0
- package/dist/core/group/extractors/grpc-patterns/types.js +1 -0
- package/dist/core/group/extractors/http-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/go.js +215 -0
- package/dist/core/group/extractors/http-patterns/index.d.ts +17 -0
- package/dist/core/group/extractors/http-patterns/index.js +44 -0
- package/dist/core/group/extractors/http-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/java.js +253 -0
- package/dist/core/group/extractors/http-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/http-patterns/node.js +484 -0
- package/dist/core/group/extractors/http-patterns/php.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/php.js +178 -0
- package/dist/core/group/extractors/http-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/python.js +308 -0
- package/dist/core/group/extractors/http-patterns/types.d.ts +61 -0
- package/dist/core/group/extractors/http-patterns/types.js +1 -0
- package/dist/core/group/extractors/http-route-extractor.d.ts +21 -0
- package/dist/core/group/extractors/http-route-extractor.js +430 -0
- package/dist/core/group/extractors/include-extractor.d.ts +39 -0
- package/dist/core/group/extractors/include-extractor.js +566 -0
- package/dist/core/group/extractors/java-workspace-extractor.d.ts +16 -0
- package/dist/core/group/extractors/java-workspace-extractor.js +204 -0
- package/dist/core/group/extractors/manifest-extractor.d.ts +54 -0
- package/dist/core/group/extractors/manifest-extractor.js +320 -0
- package/dist/core/group/extractors/node-workspace-extractor.d.ts +14 -0
- package/dist/core/group/extractors/node-workspace-extractor.js +207 -0
- package/dist/core/group/extractors/python-workspace-extractor.d.ts +15 -0
- package/dist/core/group/extractors/python-workspace-extractor.js +205 -0
- package/dist/core/group/extractors/rust-workspace-extractor.d.ts +44 -0
- package/dist/core/group/extractors/rust-workspace-extractor.js +240 -0
- package/dist/core/group/extractors/thrift-extractor.d.ts +22 -0
- package/dist/core/group/extractors/thrift-extractor.js +283 -0
- package/dist/core/group/extractors/thrift-patterns/index.d.ts +4 -0
- package/dist/core/group/extractors/thrift-patterns/index.js +10 -0
- package/dist/core/group/extractors/thrift-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/thrift-patterns/java.js +220 -0
- package/dist/core/group/extractors/thrift-patterns/types.d.ts +17 -0
- package/dist/core/group/extractors/thrift-patterns/types.js +1 -0
- package/dist/core/group/extractors/topic-extractor.d.ts +8 -0
- package/dist/core/group/extractors/topic-extractor.js +97 -0
- package/dist/core/group/extractors/topic-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/go.js +120 -0
- package/dist/core/group/extractors/topic-patterns/index.d.ts +14 -0
- package/dist/core/group/extractors/topic-patterns/index.js +38 -0
- package/dist/core/group/extractors/topic-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/java.js +80 -0
- package/dist/core/group/extractors/topic-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/topic-patterns/node.js +155 -0
- package/dist/core/group/extractors/topic-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/python.js +116 -0
- package/dist/core/group/extractors/topic-patterns/types.d.ts +25 -0
- package/dist/core/group/extractors/topic-patterns/types.js +10 -0
- package/dist/core/group/extractors/tree-sitter-scanner.d.ts +113 -0
- package/dist/core/group/extractors/tree-sitter-scanner.js +95 -0
- package/dist/core/group/extractors/workspace-extractor.d.ts +13 -0
- package/dist/core/group/extractors/workspace-extractor.js +65 -0
- package/dist/core/group/group-path-utils.d.ts +17 -0
- package/dist/core/group/group-path-utils.js +40 -0
- package/dist/core/group/matching.d.ts +13 -0
- package/dist/core/group/matching.js +284 -0
- package/dist/core/group/normalization.d.ts +3 -0
- package/dist/core/group/normalization.js +115 -0
- package/dist/core/group/resolve-at-member.d.ts +10 -0
- package/dist/core/group/resolve-at-member.js +31 -0
- package/dist/core/group/service-boundary-detector.d.ts +8 -0
- package/dist/core/group/service-boundary-detector.js +155 -0
- package/dist/core/group/service.d.ts +56 -0
- package/dist/core/group/service.js +395 -0
- package/dist/core/group/storage.d.ts +9 -0
- package/dist/core/group/storage.js +157 -0
- package/dist/core/group/sync.d.ts +21 -0
- package/dist/core/group/sync.js +267 -0
- package/dist/core/group/types.d.ts +181 -0
- package/dist/core/group/types.js +1 -0
- package/dist/core/incremental/shadow-candidates.d.ts +44 -0
- package/dist/core/incremental/shadow-candidates.js +74 -0
- package/dist/core/incremental/subgraph-extract.d.ts +64 -0
- package/dist/core/incremental/subgraph-extract.js +111 -0
- package/dist/core/ingestion/ast-cache.d.ts +26 -0
- package/dist/core/ingestion/ast-cache.js +48 -0
- package/dist/core/ingestion/binding-accumulator.d.ts +212 -0
- package/dist/core/ingestion/binding-accumulator.js +336 -0
- package/dist/core/ingestion/call-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/c-cpp.js +8 -0
- package/dist/core/ingestion/call-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/csharp.js +6 -0
- package/dist/core/ingestion/call-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/dart.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/go.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/jvm.js +51 -0
- package/dist/core/ingestion/call-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/php.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/python.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/ruby.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/rust.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/swift.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/typescript-javascript.js +8 -0
- package/dist/core/ingestion/call-extractors/generic.d.ts +5 -0
- package/dist/core/ingestion/call-extractors/generic.js +59 -0
- package/dist/core/ingestion/call-processor.d.ts +235 -0
- package/dist/core/ingestion/call-processor.js +2754 -0
- package/dist/core/ingestion/call-routing.d.ts +55 -0
- package/dist/core/ingestion/call-routing.js +95 -0
- package/dist/core/ingestion/call-types.d.ts +135 -0
- package/dist/core/ingestion/call-types.js +2 -0
- package/dist/core/ingestion/class-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +11 -0
- package/dist/core/ingestion/class-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/csharp.js +21 -0
- package/dist/core/ingestion/class-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/dart.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/go.js +20 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.js +35 -0
- package/dist/core/ingestion/class-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/php.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/python.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/ruby.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/rust.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/swift.js +18 -0
- package/dist/core/ingestion/class-extractors/configs/typescript-javascript.d.ts +4 -0
- package/dist/core/ingestion/class-extractors/configs/typescript-javascript.js +28 -0
- package/dist/core/ingestion/class-extractors/generic.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/generic.js +135 -0
- package/dist/core/ingestion/class-types.d.ts +34 -0
- package/dist/core/ingestion/class-types.js +1 -0
- package/dist/core/ingestion/cluster-enricher.d.ts +38 -0
- package/dist/core/ingestion/cluster-enricher.js +169 -0
- package/dist/core/ingestion/cobol/cobol-copy-expander.d.ts +57 -0
- package/dist/core/ingestion/cobol/cobol-copy-expander.js +376 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +212 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +1727 -0
- package/dist/core/ingestion/cobol/jcl-parser.d.ts +68 -0
- package/dist/core/ingestion/cobol/jcl-parser.js +217 -0
- package/dist/core/ingestion/cobol/jcl-processor.d.ts +33 -0
- package/dist/core/ingestion/cobol/jcl-processor.js +229 -0
- package/dist/core/ingestion/cobol-processor.d.ts +54 -0
- package/dist/core/ingestion/cobol-processor.js +1232 -0
- package/dist/core/ingestion/community-processor.d.ts +39 -0
- package/dist/core/ingestion/community-processor.js +336 -0
- package/dist/core/ingestion/constants.d.ts +17 -0
- package/dist/core/ingestion/constants.js +21 -0
- package/dist/core/ingestion/cpp-ue-preprocessor.d.ts +12 -0
- package/dist/core/ingestion/cpp-ue-preprocessor.js +260 -0
- package/dist/core/ingestion/emit-references.d.ts +88 -0
- package/dist/core/ingestion/emit-references.js +229 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +40 -0
- package/dist/core/ingestion/entry-point-scoring.js +196 -0
- package/dist/core/ingestion/export-detection.d.ts +57 -0
- package/dist/core/ingestion/export-detection.js +233 -0
- package/dist/core/ingestion/field-extractor.d.ts +29 -0
- package/dist/core/ingestion/field-extractor.js +25 -0
- package/dist/core/ingestion/field-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/c-cpp.js +104 -0
- package/dist/core/ingestion/field-extractors/configs/csharp.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/csharp.js +121 -0
- package/dist/core/ingestion/field-extractors/configs/dart.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/dart.js +78 -0
- package/dist/core/ingestion/field-extractors/configs/go.d.ts +11 -0
- package/dist/core/ingestion/field-extractors/configs/go.js +60 -0
- package/dist/core/ingestion/field-extractors/configs/helpers.d.ts +53 -0
- package/dist/core/ingestion/field-extractors/configs/helpers.js +158 -0
- package/dist/core/ingestion/field-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/jvm.js +118 -0
- package/dist/core/ingestion/field-extractors/configs/php.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/php.js +65 -0
- package/dist/core/ingestion/field-extractors/configs/python.d.ts +12 -0
- package/dist/core/ingestion/field-extractors/configs/python.js +91 -0
- package/dist/core/ingestion/field-extractors/configs/ruby.d.ts +16 -0
- package/dist/core/ingestion/field-extractors/configs/ruby.js +76 -0
- package/dist/core/ingestion/field-extractors/configs/rust.d.ts +9 -0
- package/dist/core/ingestion/field-extractors/configs/rust.js +52 -0
- package/dist/core/ingestion/field-extractors/configs/swift.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/swift.js +65 -0
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.js +56 -0
- package/dist/core/ingestion/field-extractors/generic.d.ts +49 -0
- package/dist/core/ingestion/field-extractors/generic.js +117 -0
- package/dist/core/ingestion/field-extractors/typescript.d.ts +77 -0
- package/dist/core/ingestion/field-extractors/typescript.js +291 -0
- package/dist/core/ingestion/field-types.d.ts +61 -0
- package/dist/core/ingestion/field-types.js +2 -0
- package/dist/core/ingestion/filesystem-walker.d.ts +28 -0
- package/dist/core/ingestion/filesystem-walker.js +92 -0
- package/dist/core/ingestion/finalize-orchestrator.d.ts +63 -0
- package/dist/core/ingestion/finalize-orchestrator.js +142 -0
- package/dist/core/ingestion/framework-detection.d.ts +30 -0
- package/dist/core/ingestion/framework-detection.js +428 -0
- package/dist/core/ingestion/heritage-extractors/configs/go.d.ts +13 -0
- package/dist/core/ingestion/heritage-extractors/configs/go.js +20 -0
- package/dist/core/ingestion/heritage-extractors/configs/ruby.d.ts +18 -0
- package/dist/core/ingestion/heritage-extractors/configs/ruby.js +65 -0
- package/dist/core/ingestion/heritage-extractors/generic.d.ts +23 -0
- package/dist/core/ingestion/heritage-extractors/generic.js +47 -0
- package/dist/core/ingestion/heritage-processor.d.ts +54 -0
- package/dist/core/ingestion/heritage-processor.js +367 -0
- package/dist/core/ingestion/heritage-types.d.ts +73 -0
- package/dist/core/ingestion/heritage-types.js +2 -0
- package/dist/core/ingestion/import-processor.d.ts +23 -0
- package/dist/core/ingestion/import-processor.js +377 -0
- package/dist/core/ingestion/import-resolvers/configs/c-cpp.d.ts +7 -0
- package/dist/core/ingestion/import-resolvers/configs/c-cpp.js +14 -0
- package/dist/core/ingestion/import-resolvers/configs/csharp.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/csharp.js +27 -0
- package/dist/core/ingestion/import-resolvers/configs/dart.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/configs/dart.js +54 -0
- package/dist/core/ingestion/import-resolvers/configs/go.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/go.js +26 -0
- package/dist/core/ingestion/import-resolvers/configs/jvm.d.ts +13 -0
- package/dist/core/ingestion/import-resolvers/configs/jvm.js +68 -0
- package/dist/core/ingestion/import-resolvers/configs/php.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/php.js +15 -0
- package/dist/core/ingestion/import-resolvers/configs/python.d.ts +12 -0
- package/dist/core/ingestion/import-resolvers/configs/python.js +41 -0
- package/dist/core/ingestion/import-resolvers/configs/ruby.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/ruby.js +16 -0
- package/dist/core/ingestion/import-resolvers/configs/rust.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/rust.js +54 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.js +29 -0
- package/dist/core/ingestion/import-resolvers/configs/typescript-javascript.d.ts +9 -0
- package/dist/core/ingestion/import-resolvers/configs/typescript-javascript.js +23 -0
- package/dist/core/ingestion/import-resolvers/csharp.d.ts +18 -0
- package/dist/core/ingestion/import-resolvers/csharp.js +115 -0
- package/dist/core/ingestion/import-resolvers/go.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/go.js +46 -0
- package/dist/core/ingestion/import-resolvers/jvm.d.ts +27 -0
- package/dist/core/ingestion/import-resolvers/jvm.js +106 -0
- package/dist/core/ingestion/import-resolvers/php.d.ts +24 -0
- package/dist/core/ingestion/import-resolvers/php.js +77 -0
- package/dist/core/ingestion/import-resolvers/python.d.ts +22 -0
- package/dist/core/ingestion/import-resolvers/python.js +72 -0
- package/dist/core/ingestion/import-resolvers/resolver-factory.d.ts +24 -0
- package/dist/core/ingestion/import-resolvers/resolver-factory.js +33 -0
- package/dist/core/ingestion/import-resolvers/ruby.d.ts +14 -0
- package/dist/core/ingestion/import-resolvers/ruby.js +17 -0
- package/dist/core/ingestion/import-resolvers/rust.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/rust.js +75 -0
- package/dist/core/ingestion/import-resolvers/standard.d.ts +35 -0
- package/dist/core/ingestion/import-resolvers/standard.js +168 -0
- package/dist/core/ingestion/import-resolvers/types.d.ts +68 -0
- package/dist/core/ingestion/import-resolvers/types.js +6 -0
- package/dist/core/ingestion/import-resolvers/utils.d.ts +35 -0
- package/dist/core/ingestion/import-resolvers/utils.js +153 -0
- package/dist/core/ingestion/import-target-adapter.d.ts +73 -0
- package/dist/core/ingestion/import-target-adapter.js +95 -0
- package/dist/core/ingestion/language-config.d.ts +52 -0
- package/dist/core/ingestion/language-config.js +182 -0
- package/dist/core/ingestion/language-provider.d.ts +465 -0
- package/dist/core/ingestion/language-provider.js +24 -0
- package/dist/core/ingestion/languages/c/arity-metadata.d.ts +14 -0
- package/dist/core/ingestion/languages/c/arity-metadata.js +94 -0
- package/dist/core/ingestion/languages/c/arity.d.ts +6 -0
- package/dist/core/ingestion/languages/c/arity.js +18 -0
- package/dist/core/ingestion/languages/c/captures.d.ts +2 -0
- package/dist/core/ingestion/languages/c/captures.js +105 -0
- package/dist/core/ingestion/languages/c/header-scan.d.ts +7 -0
- package/dist/core/ingestion/languages/c/header-scan.js +55 -0
- package/dist/core/ingestion/languages/c/import-decomposer.d.ts +8 -0
- package/dist/core/ingestion/languages/c/import-decomposer.js +50 -0
- package/dist/core/ingestion/languages/c/import-target.d.ts +14 -0
- package/dist/core/ingestion/languages/c/import-target.js +57 -0
- package/dist/core/ingestion/languages/c/index.d.ts +11 -0
- package/dist/core/ingestion/languages/c/index.js +11 -0
- package/dist/core/ingestion/languages/c/interpret.d.ts +14 -0
- package/dist/core/ingestion/languages/c/interpret.js +48 -0
- package/dist/core/ingestion/languages/c/merge-bindings.d.ts +7 -0
- package/dist/core/ingestion/languages/c/merge-bindings.js +23 -0
- package/dist/core/ingestion/languages/c/query.d.ts +3 -0
- package/dist/core/ingestion/languages/c/query.js +161 -0
- package/dist/core/ingestion/languages/c/scope-resolver.d.ts +13 -0
- package/dist/core/ingestion/languages/c/scope-resolver.js +60 -0
- package/dist/core/ingestion/languages/c/simple-hooks.d.ts +14 -0
- package/dist/core/ingestion/languages/c/simple-hooks.js +19 -0
- package/dist/core/ingestion/languages/c/static-linkage.d.ts +13 -0
- package/dist/core/ingestion/languages/c/static-linkage.js +57 -0
- package/dist/core/ingestion/languages/c-cpp.d.ts +12 -0
- package/dist/core/ingestion/languages/c-cpp.js +411 -0
- package/dist/core/ingestion/languages/cobol.d.ts +1 -0
- package/dist/core/ingestion/languages/cobol.js +28 -0
- package/dist/core/ingestion/languages/csharp/accessor-unwrap.d.ts +21 -0
- package/dist/core/ingestion/languages/csharp/accessor-unwrap.js +56 -0
- package/dist/core/ingestion/languages/csharp/arity-metadata.d.ts +26 -0
- package/dist/core/ingestion/languages/csharp/arity-metadata.js +46 -0
- package/dist/core/ingestion/languages/csharp/arity.d.ts +23 -0
- package/dist/core/ingestion/languages/csharp/arity.js +37 -0
- package/dist/core/ingestion/languages/csharp/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/csharp/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/csharp/captures.d.ts +19 -0
- package/dist/core/ingestion/languages/csharp/captures.js +346 -0
- package/dist/core/ingestion/languages/csharp/import-decomposer.d.ts +19 -0
- package/dist/core/ingestion/languages/csharp/import-decomposer.js +93 -0
- package/dist/core/ingestion/languages/csharp/import-target.d.ts +25 -0
- package/dist/core/ingestion/languages/csharp/import-target.js +123 -0
- package/dist/core/ingestion/languages/csharp/index.d.ts +82 -0
- package/dist/core/ingestion/languages/csharp/index.js +82 -0
- package/dist/core/ingestion/languages/csharp/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/csharp/interpret.js +132 -0
- package/dist/core/ingestion/languages/csharp/merge-bindings.d.ts +27 -0
- package/dist/core/ingestion/languages/csharp/merge-bindings.js +55 -0
- package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +51 -0
- package/dist/core/ingestion/languages/csharp/namespace-siblings.js +387 -0
- package/dist/core/ingestion/languages/csharp/query.d.ts +35 -0
- package/dist/core/ingestion/languages/csharp/query.js +521 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.d.ts +31 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.js +135 -0
- package/dist/core/ingestion/languages/csharp/scope-resolver.d.ts +10 -0
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +63 -0
- package/dist/core/ingestion/languages/csharp/simple-hooks.d.ts +53 -0
- package/dist/core/ingestion/languages/csharp/simple-hooks.js +76 -0
- package/dist/core/ingestion/languages/csharp.d.ts +8 -0
- package/dist/core/ingestion/languages/csharp.js +201 -0
- package/dist/core/ingestion/languages/dart.d.ts +12 -0
- package/dist/core/ingestion/languages/dart.js +138 -0
- package/dist/core/ingestion/languages/go/arity-metadata.d.ts +8 -0
- package/dist/core/ingestion/languages/go/arity-metadata.js +37 -0
- package/dist/core/ingestion/languages/go/arity.d.ts +2 -0
- package/dist/core/ingestion/languages/go/arity.js +14 -0
- package/dist/core/ingestion/languages/go/cache-stats.d.ts +7 -0
- package/dist/core/ingestion/languages/go/cache-stats.js +15 -0
- package/dist/core/ingestion/languages/go/captures.d.ts +2 -0
- package/dist/core/ingestion/languages/go/captures.js +129 -0
- package/dist/core/ingestion/languages/go/expand-wildcards.d.ts +15 -0
- package/dist/core/ingestion/languages/go/expand-wildcards.js +93 -0
- package/dist/core/ingestion/languages/go/import-decomposer.d.ts +3 -0
- package/dist/core/ingestion/languages/go/import-decomposer.js +44 -0
- package/dist/core/ingestion/languages/go/import-target.d.ts +21 -0
- package/dist/core/ingestion/languages/go/import-target.js +67 -0
- package/dist/core/ingestion/languages/go/index.d.ts +17 -0
- package/dist/core/ingestion/languages/go/index.js +17 -0
- package/dist/core/ingestion/languages/go/interface-impls.d.ts +4 -0
- package/dist/core/ingestion/languages/go/interface-impls.js +72 -0
- package/dist/core/ingestion/languages/go/interpret.d.ts +11 -0
- package/dist/core/ingestion/languages/go/interpret.js +146 -0
- package/dist/core/ingestion/languages/go/merge-bindings.d.ts +2 -0
- package/dist/core/ingestion/languages/go/merge-bindings.js +18 -0
- package/dist/core/ingestion/languages/go/method-owners.d.ts +17 -0
- package/dist/core/ingestion/languages/go/method-owners.js +96 -0
- package/dist/core/ingestion/languages/go/namespace-mirror.d.ts +15 -0
- package/dist/core/ingestion/languages/go/namespace-mirror.js +53 -0
- package/dist/core/ingestion/languages/go/package-siblings.d.ts +11 -0
- package/dist/core/ingestion/languages/go/package-siblings.js +84 -0
- package/dist/core/ingestion/languages/go/query.d.ts +3 -0
- package/dist/core/ingestion/languages/go/query.js +207 -0
- package/dist/core/ingestion/languages/go/range-binding.d.ts +8 -0
- package/dist/core/ingestion/languages/go/range-binding.js +109 -0
- package/dist/core/ingestion/languages/go/receiver-binding.d.ts +3 -0
- package/dist/core/ingestion/languages/go/receiver-binding.js +21 -0
- package/dist/core/ingestion/languages/go/scope-resolver.d.ts +2 -0
- package/dist/core/ingestion/languages/go/scope-resolver.js +33 -0
- package/dist/core/ingestion/languages/go/simple-hooks.d.ts +4 -0
- package/dist/core/ingestion/languages/go/simple-hooks.js +21 -0
- package/dist/core/ingestion/languages/go/type-binding.d.ts +3 -0
- package/dist/core/ingestion/languages/go/type-binding.js +237 -0
- package/dist/core/ingestion/languages/go.d.ts +11 -0
- package/dist/core/ingestion/languages/go.js +94 -0
- package/dist/core/ingestion/languages/index.d.ts +39 -0
- package/dist/core/ingestion/languages/index.js +64 -0
- package/dist/core/ingestion/languages/java/arity-metadata.d.ts +18 -0
- package/dist/core/ingestion/languages/java/arity-metadata.js +40 -0
- package/dist/core/ingestion/languages/java/arity.d.ts +10 -0
- package/dist/core/ingestion/languages/java/arity.js +24 -0
- package/dist/core/ingestion/languages/java/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/java/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/java/captures.d.ts +17 -0
- package/dist/core/ingestion/languages/java/captures.js +187 -0
- package/dist/core/ingestion/languages/java/import-decomposer.d.ts +18 -0
- package/dist/core/ingestion/languages/java/import-decomposer.js +85 -0
- package/dist/core/ingestion/languages/java/import-target.d.ts +17 -0
- package/dist/core/ingestion/languages/java/import-target.js +100 -0
- package/dist/core/ingestion/languages/java/index.d.ts +29 -0
- package/dist/core/ingestion/languages/java/index.js +29 -0
- package/dist/core/ingestion/languages/java/interpret.d.ts +13 -0
- package/dist/core/ingestion/languages/java/interpret.js +131 -0
- package/dist/core/ingestion/languages/java/merge-bindings.d.ts +12 -0
- package/dist/core/ingestion/languages/java/merge-bindings.js +40 -0
- package/dist/core/ingestion/languages/java/query.d.ts +30 -0
- package/dist/core/ingestion/languages/java/query.js +192 -0
- package/dist/core/ingestion/languages/java/receiver-binding.d.ts +11 -0
- package/dist/core/ingestion/languages/java/receiver-binding.js +95 -0
- package/dist/core/ingestion/languages/java/scope-resolver.d.ts +50 -0
- package/dist/core/ingestion/languages/java/scope-resolver.js +74 -0
- package/dist/core/ingestion/languages/java/simple-hooks.d.ts +13 -0
- package/dist/core/ingestion/languages/java/simple-hooks.js +34 -0
- package/dist/core/ingestion/languages/java.d.ts +9 -0
- package/dist/core/ingestion/languages/java.js +76 -0
- package/dist/core/ingestion/languages/kotlin.d.ts +9 -0
- package/dist/core/ingestion/languages/kotlin.js +164 -0
- package/dist/core/ingestion/languages/php/arity-metadata.d.ts +28 -0
- package/dist/core/ingestion/languages/php/arity-metadata.js +63 -0
- package/dist/core/ingestion/languages/php/arity.d.ts +25 -0
- package/dist/core/ingestion/languages/php/arity.js +40 -0
- package/dist/core/ingestion/languages/php/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/php/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/php/captures.d.ts +34 -0
- package/dist/core/ingestion/languages/php/captures.js +739 -0
- package/dist/core/ingestion/languages/php/import-decomposer.d.ts +28 -0
- package/dist/core/ingestion/languages/php/import-decomposer.js +265 -0
- package/dist/core/ingestion/languages/php/import-target.d.ts +47 -0
- package/dist/core/ingestion/languages/php/import-target.js +100 -0
- package/dist/core/ingestion/languages/php/index.d.ts +68 -0
- package/dist/core/ingestion/languages/php/index.js +72 -0
- package/dist/core/ingestion/languages/php/interpret.d.ts +36 -0
- package/dist/core/ingestion/languages/php/interpret.js +241 -0
- package/dist/core/ingestion/languages/php/merge-bindings.d.ts +19 -0
- package/dist/core/ingestion/languages/php/merge-bindings.js +47 -0
- package/dist/core/ingestion/languages/php/namespace-siblings.d.ts +51 -0
- package/dist/core/ingestion/languages/php/namespace-siblings.js +288 -0
- package/dist/core/ingestion/languages/php/query.d.ts +32 -0
- package/dist/core/ingestion/languages/php/query.js +326 -0
- package/dist/core/ingestion/languages/php/receiver-binding.d.ts +36 -0
- package/dist/core/ingestion/languages/php/receiver-binding.js +128 -0
- package/dist/core/ingestion/languages/php/scope-resolver.d.ts +23 -0
- package/dist/core/ingestion/languages/php/scope-resolver.js +358 -0
- package/dist/core/ingestion/languages/php/simple-hooks.d.ts +42 -0
- package/dist/core/ingestion/languages/php/simple-hooks.js +111 -0
- package/dist/core/ingestion/languages/php.d.ts +1 -0
- package/dist/core/ingestion/languages/php.js +290 -0
- package/dist/core/ingestion/languages/python/arity-metadata.d.ts +24 -0
- package/dist/core/ingestion/languages/python/arity-metadata.js +45 -0
- package/dist/core/ingestion/languages/python/arity.d.ts +22 -0
- package/dist/core/ingestion/languages/python/arity.js +38 -0
- package/dist/core/ingestion/languages/python/cache-stats.d.ts +17 -0
- package/dist/core/ingestion/languages/python/cache-stats.js +28 -0
- package/dist/core/ingestion/languages/python/captures.d.ts +19 -0
- package/dist/core/ingestion/languages/python/captures.js +130 -0
- package/dist/core/ingestion/languages/python/import-decomposer.d.ts +15 -0
- package/dist/core/ingestion/languages/python/import-decomposer.js +112 -0
- package/dist/core/ingestion/languages/python/import-target.d.ts +21 -0
- package/dist/core/ingestion/languages/python/import-target.js +195 -0
- package/dist/core/ingestion/languages/python/index.d.ts +80 -0
- package/dist/core/ingestion/languages/python/index.js +80 -0
- package/dist/core/ingestion/languages/python/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/python/interpret.js +191 -0
- package/dist/core/ingestion/languages/python/merge-bindings.d.ts +16 -0
- package/dist/core/ingestion/languages/python/merge-bindings.js +44 -0
- package/dist/core/ingestion/languages/python/query.d.ts +9 -0
- package/dist/core/ingestion/languages/python/query.js +267 -0
- package/dist/core/ingestion/languages/python/receiver-binding.d.ts +21 -0
- package/dist/core/ingestion/languages/python/receiver-binding.js +116 -0
- package/dist/core/ingestion/languages/python/scope-resolver.d.ts +16 -0
- package/dist/core/ingestion/languages/python/scope-resolver.js +53 -0
- package/dist/core/ingestion/languages/python/simple-hooks.d.ts +25 -0
- package/dist/core/ingestion/languages/python/simple-hooks.js +43 -0
- package/dist/core/ingestion/languages/python.d.ts +12 -0
- package/dist/core/ingestion/languages/python.js +133 -0
- package/dist/core/ingestion/languages/ruby.d.ts +9 -0
- package/dist/core/ingestion/languages/ruby.js +235 -0
- package/dist/core/ingestion/languages/rust.d.ts +12 -0
- package/dist/core/ingestion/languages/rust.js +167 -0
- package/dist/core/ingestion/languages/swift.d.ts +12 -0
- package/dist/core/ingestion/languages/swift.js +312 -0
- package/dist/core/ingestion/languages/typescript/arity-metadata.d.ts +59 -0
- package/dist/core/ingestion/languages/typescript/arity-metadata.js +103 -0
- package/dist/core/ingestion/languages/typescript/arity.d.ts +37 -0
- package/dist/core/ingestion/languages/typescript/arity.js +54 -0
- package/dist/core/ingestion/languages/typescript/cache-stats.d.ts +17 -0
- package/dist/core/ingestion/languages/typescript/cache-stats.js +28 -0
- package/dist/core/ingestion/languages/typescript/captures.d.ts +28 -0
- package/dist/core/ingestion/languages/typescript/captures.js +474 -0
- package/dist/core/ingestion/languages/typescript/import-decomposer.d.ts +49 -0
- package/dist/core/ingestion/languages/typescript/import-decomposer.js +371 -0
- package/dist/core/ingestion/languages/typescript/import-target.d.ts +50 -0
- package/dist/core/ingestion/languages/typescript/import-target.js +61 -0
- package/dist/core/ingestion/languages/typescript/index.d.ts +94 -0
- package/dist/core/ingestion/languages/typescript/index.js +94 -0
- package/dist/core/ingestion/languages/typescript/interpret.d.ts +35 -0
- package/dist/core/ingestion/languages/typescript/interpret.js +317 -0
- package/dist/core/ingestion/languages/typescript/merge-bindings.d.ts +62 -0
- package/dist/core/ingestion/languages/typescript/merge-bindings.js +158 -0
- package/dist/core/ingestion/languages/typescript/query.d.ts +84 -0
- package/dist/core/ingestion/languages/typescript/query.js +978 -0
- package/dist/core/ingestion/languages/typescript/receiver-binding.d.ts +59 -0
- package/dist/core/ingestion/languages/typescript/receiver-binding.js +171 -0
- package/dist/core/ingestion/languages/typescript/scope-resolver.d.ts +16 -0
- package/dist/core/ingestion/languages/typescript/scope-resolver.js +113 -0
- package/dist/core/ingestion/languages/typescript/simple-hooks.d.ts +71 -0
- package/dist/core/ingestion/languages/typescript/simple-hooks.js +131 -0
- package/dist/core/ingestion/languages/typescript.d.ts +11 -0
- package/dist/core/ingestion/languages/typescript.js +324 -0
- package/dist/core/ingestion/languages/vue.d.ts +13 -0
- package/dist/core/ingestion/languages/vue.js +79 -0
- package/dist/core/ingestion/markdown-processor.d.ts +17 -0
- package/dist/core/ingestion/markdown-processor.js +124 -0
- package/dist/core/ingestion/method-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/c-cpp.js +387 -0
- package/dist/core/ingestion/method-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/csharp.js +287 -0
- package/dist/core/ingestion/method-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/dart.js +376 -0
- package/dist/core/ingestion/method-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/go.js +176 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.js +336 -0
- package/dist/core/ingestion/method-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/php.js +304 -0
- package/dist/core/ingestion/method-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/python.js +309 -0
- package/dist/core/ingestion/method-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/ruby.js +286 -0
- package/dist/core/ingestion/method-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/rust.js +195 -0
- package/dist/core/ingestion/method-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/swift.js +276 -0
- package/dist/core/ingestion/method-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/typescript-javascript.js +338 -0
- package/dist/core/ingestion/method-extractors/generic.d.ts +11 -0
- package/dist/core/ingestion/method-extractors/generic.js +205 -0
- package/dist/core/ingestion/method-types.d.ts +90 -0
- package/dist/core/ingestion/method-types.js +2 -0
- package/dist/core/ingestion/model/field-registry.d.ts +18 -0
- package/dist/core/ingestion/model/field-registry.js +22 -0
- package/dist/core/ingestion/model/heritage-map.d.ts +105 -0
- package/dist/core/ingestion/model/heritage-map.js +260 -0
- package/dist/core/ingestion/model/index.d.ts +20 -0
- package/dist/core/ingestion/model/index.js +43 -0
- package/dist/core/ingestion/model/method-registry.d.ts +71 -0
- package/dist/core/ingestion/model/method-registry.js +134 -0
- package/dist/core/ingestion/model/registration-table.d.ts +138 -0
- package/dist/core/ingestion/model/registration-table.js +224 -0
- package/dist/core/ingestion/model/resolution-context.d.ts +93 -0
- package/dist/core/ingestion/model/resolution-context.js +337 -0
- package/dist/core/ingestion/model/resolve.d.ts +61 -0
- package/dist/core/ingestion/model/resolve.js +401 -0
- package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +72 -0
- package/dist/core/ingestion/model/scope-resolution-indexes.js +42 -0
- package/dist/core/ingestion/model/semantic-model.d.ts +150 -0
- package/dist/core/ingestion/model/semantic-model.js +175 -0
- package/dist/core/ingestion/model/symbol-table.d.ts +200 -0
- package/dist/core/ingestion/model/symbol-table.js +206 -0
- package/dist/core/ingestion/model/type-registry.d.ts +39 -0
- package/dist/core/ingestion/model/type-registry.js +62 -0
- package/dist/core/ingestion/mro-processor.d.ts +46 -0
- package/dist/core/ingestion/mro-processor.js +597 -0
- package/dist/core/ingestion/named-bindings/csharp.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/csharp.js +37 -0
- package/dist/core/ingestion/named-bindings/java.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/java.js +29 -0
- package/dist/core/ingestion/named-bindings/kotlin.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/kotlin.js +36 -0
- package/dist/core/ingestion/named-bindings/php.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/php.js +61 -0
- package/dist/core/ingestion/named-bindings/python.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/python.js +49 -0
- package/dist/core/ingestion/named-bindings/rust.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/rust.js +66 -0
- package/dist/core/ingestion/named-bindings/types.d.ts +16 -0
- package/dist/core/ingestion/named-bindings/types.js +6 -0
- package/dist/core/ingestion/named-bindings/typescript.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/typescript.js +58 -0
- package/dist/core/ingestion/parsing-processor.d.ts +60 -0
- package/dist/core/ingestion/parsing-processor.js +627 -0
- package/dist/core/ingestion/pipeline-phases/cobol.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/cobol.js +46 -0
- package/dist/core/ingestion/pipeline-phases/communities.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/communities.js +63 -0
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +157 -0
- package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +37 -0
- package/dist/core/ingestion/pipeline-phases/cross-file.js +64 -0
- package/dist/core/ingestion/pipeline-phases/index.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/index.js +23 -0
- package/dist/core/ingestion/pipeline-phases/markdown.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/markdown.js +34 -0
- package/dist/core/ingestion/pipeline-phases/mro.d.ts +18 -0
- package/dist/core/ingestion/pipeline-phases/mro.js +37 -0
- package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/orm-extraction.js +92 -0
- package/dist/core/ingestion/pipeline-phases/orm.d.ts +15 -0
- package/dist/core/ingestion/pipeline-phases/orm.js +75 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +63 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +567 -0
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +88 -0
- package/dist/core/ingestion/pipeline-phases/parse.js +33 -0
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/processes.js +149 -0
- package/dist/core/ingestion/pipeline-phases/routes.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/routes.js +244 -0
- package/dist/core/ingestion/pipeline-phases/runner.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/runner.js +204 -0
- package/dist/core/ingestion/pipeline-phases/scan.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/scan.js +46 -0
- package/dist/core/ingestion/pipeline-phases/structure.d.ts +27 -0
- package/dist/core/ingestion/pipeline-phases/structure.js +35 -0
- package/dist/core/ingestion/pipeline-phases/tools.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/tools.js +86 -0
- package/dist/core/ingestion/pipeline-phases/types.d.ts +79 -0
- package/dist/core/ingestion/pipeline-phases/types.js +37 -0
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.d.ts +70 -0
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.js +312 -0
- package/dist/core/ingestion/pipeline.d.ts +49 -0
- package/dist/core/ingestion/pipeline.js +89 -0
- package/dist/core/ingestion/process-processor.d.ts +51 -0
- package/dist/core/ingestion/process-processor.js +318 -0
- package/dist/core/ingestion/registry-primary-flag.d.ts +88 -0
- package/dist/core/ingestion/registry-primary-flag.js +117 -0
- package/dist/core/ingestion/resolve-references.d.ts +63 -0
- package/dist/core/ingestion/resolve-references.js +175 -0
- package/dist/core/ingestion/route-extractors/expo.d.ts +1 -0
- package/dist/core/ingestion/route-extractors/expo.js +36 -0
- package/dist/core/ingestion/route-extractors/middleware.d.ts +47 -0
- package/dist/core/ingestion/route-extractors/middleware.js +167 -0
- package/dist/core/ingestion/route-extractors/nextjs.d.ts +3 -0
- package/dist/core/ingestion/route-extractors/nextjs.js +76 -0
- package/dist/core/ingestion/route-extractors/php.d.ts +7 -0
- package/dist/core/ingestion/route-extractors/php.js +22 -0
- package/dist/core/ingestion/route-extractors/response-shapes.d.ts +20 -0
- package/dist/core/ingestion/route-extractors/response-shapes.js +294 -0
- package/dist/core/ingestion/scope-extractor-bridge.d.ts +35 -0
- package/dist/core/ingestion/scope-extractor-bridge.js +49 -0
- package/dist/core/ingestion/scope-extractor.d.ts +86 -0
- package/dist/core/ingestion/scope-extractor.js +772 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +558 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +250 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.d.ts +43 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +79 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +57 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +142 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.d.ts +17 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.js +46 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.d.ts +19 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +40 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.d.ts +37 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +118 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.d.ts +38 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +73 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.d.ts +42 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.js +467 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +53 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +251 -0
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.d.ts +75 -0
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +202 -0
- package/dist/core/ingestion/scope-resolution/passes/mro.d.ts +42 -0
- package/dist/core/ingestion/scope-resolution/passes/mro.js +102 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +30 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +81 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +46 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +377 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +47 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +152 -0
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.d.ts +68 -0
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +125 -0
- package/dist/core/ingestion/scope-resolution/pipeline/registry.d.ts +17 -0
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +31 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +91 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +218 -0
- package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.d.ts +39 -0
- package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +65 -0
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.d.ts +36 -0
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.js +58 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +170 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +447 -0
- package/dist/core/ingestion/scope-resolution/workspace-index.d.ts +52 -0
- package/dist/core/ingestion/scope-resolution/workspace-index.js +61 -0
- package/dist/core/ingestion/shadow-harness.d.ts +113 -0
- package/dist/core/ingestion/shadow-harness.js +148 -0
- package/dist/core/ingestion/structure-processor.d.ts +2 -0
- package/dist/core/ingestion/structure-processor.js +36 -0
- package/dist/core/ingestion/tree-sitter-queries.d.ts +16 -0
- package/dist/core/ingestion/tree-sitter-queries.js +1497 -0
- package/dist/core/ingestion/type-env.d.ts +86 -0
- package/dist/core/ingestion/type-env.js +1129 -0
- package/dist/core/ingestion/type-extractors/c-cpp.d.ts +7 -0
- package/dist/core/ingestion/type-extractors/c-cpp.js +532 -0
- package/dist/core/ingestion/type-extractors/csharp.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/csharp.js +583 -0
- package/dist/core/ingestion/type-extractors/dart.d.ts +15 -0
- package/dist/core/ingestion/type-extractors/dart.js +369 -0
- package/dist/core/ingestion/type-extractors/go.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/go.js +513 -0
- package/dist/core/ingestion/type-extractors/jvm.d.ts +3 -0
- package/dist/core/ingestion/type-extractors/jvm.js +856 -0
- package/dist/core/ingestion/type-extractors/php.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/php.js +534 -0
- package/dist/core/ingestion/type-extractors/python.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/python.js +474 -0
- package/dist/core/ingestion/type-extractors/ruby.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/ruby.js +377 -0
- package/dist/core/ingestion/type-extractors/rust.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/rust.js +515 -0
- package/dist/core/ingestion/type-extractors/shared.d.ts +131 -0
- package/dist/core/ingestion/type-extractors/shared.js +796 -0
- package/dist/core/ingestion/type-extractors/swift.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/swift.js +487 -0
- package/dist/core/ingestion/type-extractors/types.d.ts +172 -0
- package/dist/core/ingestion/type-extractors/types.js +1 -0
- package/dist/core/ingestion/type-extractors/typescript.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/typescript.js +661 -0
- package/dist/core/ingestion/utils/ast-helpers.d.ts +102 -0
- package/dist/core/ingestion/utils/ast-helpers.js +561 -0
- package/dist/core/ingestion/utils/call-analysis.d.ts +75 -0
- package/dist/core/ingestion/utils/call-analysis.js +574 -0
- package/dist/core/ingestion/utils/env.d.ts +20 -0
- package/dist/core/ingestion/utils/env.js +24 -0
- package/dist/core/ingestion/utils/event-loop.d.ts +5 -0
- package/dist/core/ingestion/utils/event-loop.js +5 -0
- package/dist/core/ingestion/utils/graph-sort.d.ts +58 -0
- package/dist/core/ingestion/utils/graph-sort.js +100 -0
- package/dist/core/ingestion/utils/max-file-size.d.ts +20 -0
- package/dist/core/ingestion/utils/max-file-size.js +53 -0
- package/dist/core/ingestion/utils/method-props.d.ts +32 -0
- package/dist/core/ingestion/utils/method-props.js +147 -0
- package/dist/core/ingestion/utils/ruby-self-call.d.ts +52 -0
- package/dist/core/ingestion/utils/ruby-self-call.js +59 -0
- package/dist/core/ingestion/utils/verbose.d.ts +1 -0
- package/dist/core/ingestion/utils/verbose.js +7 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.js +81 -0
- package/dist/core/ingestion/variable-extractors/configs/csharp.d.ts +9 -0
- package/dist/core/ingestion/variable-extractors/configs/csharp.js +63 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.js +94 -0
- package/dist/core/ingestion/variable-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/go.js +83 -0
- package/dist/core/ingestion/variable-extractors/configs/jvm.d.ts +18 -0
- package/dist/core/ingestion/variable-extractors/configs/jvm.js +115 -0
- package/dist/core/ingestion/variable-extractors/configs/php.d.ts +14 -0
- package/dist/core/ingestion/variable-extractors/configs/php.js +58 -0
- package/dist/core/ingestion/variable-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/python.js +101 -0
- package/dist/core/ingestion/variable-extractors/configs/ruby.d.ts +11 -0
- package/dist/core/ingestion/variable-extractors/configs/ruby.js +52 -0
- package/dist/core/ingestion/variable-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/rust.js +76 -0
- package/dist/core/ingestion/variable-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/swift.js +88 -0
- package/dist/core/ingestion/variable-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/variable-extractors/configs/typescript-javascript.js +83 -0
- package/dist/core/ingestion/variable-extractors/generic.d.ts +5 -0
- package/dist/core/ingestion/variable-extractors/generic.js +80 -0
- package/dist/core/ingestion/variable-types.d.ts +82 -0
- package/dist/core/ingestion/variable-types.js +2 -0
- package/dist/core/ingestion/vue-sfc-extractor.d.ts +44 -0
- package/dist/core/ingestion/vue-sfc-extractor.js +111 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +199 -0
- package/dist/core/ingestion/workers/parse-worker.js +1940 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +23 -0
- package/dist/core/ingestion/workers/worker-pool.js +380 -0
- package/dist/core/lbug/csv-generator.d.ts +33 -0
- package/dist/core/lbug/csv-generator.js +463 -0
- package/dist/core/lbug/extension-loader.d.ts +86 -0
- package/dist/core/lbug/extension-loader.js +186 -0
- package/dist/core/lbug/lbug-adapter.d.ts +243 -0
- package/dist/core/lbug/lbug-adapter.js +1377 -0
- package/dist/core/lbug/lbug-config.d.ts +102 -0
- package/dist/core/lbug/lbug-config.js +303 -0
- package/dist/core/lbug/pool-adapter.d.ts +90 -0
- package/dist/core/lbug/pool-adapter.js +592 -0
- package/dist/core/lbug/schema.d.ts +62 -0
- package/dist/core/lbug/schema.js +495 -0
- package/dist/core/logger.d.ts +125 -0
- package/dist/core/logger.js +323 -0
- package/dist/core/platform/capabilities.d.ts +24 -0
- package/dist/core/platform/capabilities.js +54 -0
- package/dist/core/run-analyze.d.ts +92 -0
- package/dist/core/run-analyze.js +672 -0
- package/dist/core/search/bm25-index.d.ts +29 -0
- package/dist/core/search/bm25-index.js +118 -0
- package/dist/core/search/fts-indexes.d.ts +1 -0
- package/dist/core/search/fts-indexes.js +7 -0
- package/dist/core/search/fts-schema.d.ts +6 -0
- package/dist/core/search/fts-schema.js +7 -0
- package/dist/core/search/hybrid-search.d.ts +53 -0
- package/dist/core/search/hybrid-search.js +136 -0
- package/dist/core/search/phase-timer.d.ts +72 -0
- package/dist/core/search/phase-timer.js +106 -0
- package/dist/core/tree-sitter/parser-loader.d.ts +8 -0
- package/dist/core/tree-sitter/parser-loader.js +189 -0
- package/dist/core/tree-sitter/safe-parse.d.ts +6 -0
- package/dist/core/tree-sitter/safe-parse.js +32 -0
- package/dist/core/wiki/cursor-client.d.ts +31 -0
- package/dist/core/wiki/cursor-client.js +123 -0
- package/dist/core/wiki/generator.d.ts +129 -0
- package/dist/core/wiki/generator.js +899 -0
- package/dist/core/wiki/graph-queries.d.ts +84 -0
- package/dist/core/wiki/graph-queries.js +244 -0
- package/dist/core/wiki/html-viewer.d.ts +10 -0
- package/dist/core/wiki/html-viewer.js +304 -0
- package/dist/core/wiki/llm-client.d.ts +83 -0
- package/dist/core/wiki/llm-client.js +267 -0
- package/dist/core/wiki/mermaid-sanitizer.d.ts +2 -0
- package/dist/core/wiki/mermaid-sanitizer.js +100 -0
- package/dist/core/wiki/prompts.d.ts +53 -0
- package/dist/core/wiki/prompts.js +181 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.js +3 -0
- package/dist/mcp/compatible-stdio-transport.d.ts +25 -0
- package/dist/mcp/compatible-stdio-transport.js +206 -0
- package/dist/mcp/core/embedder.d.ts +27 -0
- package/dist/mcp/core/embedder.js +145 -0
- package/dist/mcp/core/lbug-adapter.d.ts +11 -0
- package/dist/mcp/core/lbug-adapter.js +11 -0
- package/dist/mcp/local/local-backend.d.ts +356 -0
- package/dist/mcp/local/local-backend.js +3251 -0
- package/dist/mcp/resources.d.ts +62 -0
- package/dist/mcp/resources.js +512 -0
- package/dist/mcp/server.d.ts +23 -0
- package/dist/mcp/server.js +314 -0
- package/dist/mcp/staleness.d.ts +5 -0
- package/dist/mcp/staleness.js +4 -0
- package/dist/mcp/stdio-capture.d.ts +40 -0
- package/dist/mcp/stdio-capture.js +53 -0
- package/dist/mcp/stdio-context.d.ts +47 -0
- package/dist/mcp/stdio-context.js +145 -0
- package/dist/mcp/tools.d.ts +29 -0
- package/dist/mcp/tools.js +506 -0
- package/dist/server/analyze-job.d.ts +55 -0
- package/dist/server/analyze-job.js +150 -0
- package/dist/server/analyze-worker.d.ts +13 -0
- package/dist/server/analyze-worker.js +59 -0
- package/dist/server/api.d.ts +72 -0
- package/dist/server/api.js +1638 -0
- package/dist/server/git-clone.d.ts +99 -0
- package/dist/server/git-clone.js +397 -0
- package/dist/server/mcp-http.d.ts +13 -0
- package/dist/server/mcp-http.js +101 -0
- package/dist/server/validation.d.ts +98 -0
- package/dist/server/validation.js +142 -0
- package/dist/storage/file-hash.d.ts +47 -0
- package/dist/storage/file-hash.js +86 -0
- package/dist/storage/git.d.ts +148 -0
- package/dist/storage/git.js +346 -0
- package/dist/storage/parse-cache.d.ts +67 -0
- package/dist/storage/parse-cache.js +182 -0
- package/dist/storage/repo-manager.d.ts +467 -0
- package/dist/storage/repo-manager.js +804 -0
- package/dist/types/pipeline.d.ts +18 -0
- package/dist/types/pipeline.js +1 -0
- package/hooks/claude/arc-hook.cjs +334 -0
- package/hooks/claude/hook-lock.cjs +119 -0
- package/hooks/claude/pre-tool-use.sh +79 -0
- package/hooks/claude/session-start.sh +42 -0
- package/package.json +122 -0
- package/scripts/bench-scope-resolution.ts +134 -0
- package/scripts/build-tree-sitter-dart.cjs +53 -0
- package/scripts/build-tree-sitter-proto.cjs +93 -0
- package/scripts/build.js +99 -0
- package/scripts/ci-list-migrated-languages.ts +24 -0
- package/scripts/install-duckdb-extension.mjs +48 -0
- package/skills/arc-cli.md +83 -0
- package/skills/arc-debugging.md +89 -0
- package/skills/arc-exploring.md +78 -0
- package/skills/arc-guide.md +64 -0
- package/skills/arc-impact-analysis.md +97 -0
- package/skills/arc-pr-review.md +163 -0
- package/skills/arc-refactoring.md +121 -0
- package/vendor/leiden/index.cjs +355 -0
- package/vendor/leiden/utils.cjs +392 -0
- package/vendor/tree-sitter-dart/README.md +18 -0
- package/vendor/tree-sitter-dart/binding.gyp +31 -0
- package/vendor/tree-sitter-dart/bindings/node/binding.cc +20 -0
- package/vendor/tree-sitter-dart/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-dart/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-dart/grammar.js +2895 -0
- package/vendor/tree-sitter-dart/package.json +18 -0
- package/vendor/tree-sitter-dart/queries/highlights.scm +246 -0
- package/vendor/tree-sitter-dart/queries/tags.scm +92 -0
- package/vendor/tree-sitter-dart/queries/test.scm +1 -0
- package/vendor/tree-sitter-dart/src/grammar.json +12459 -0
- package/vendor/tree-sitter-dart/src/node-types.json +15055 -0
- package/vendor/tree-sitter-dart/src/parser.c +196127 -0
- package/vendor/tree-sitter-dart/src/scanner.c +130 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/alloc.h +54 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/array.h +290 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/parser.h +265 -0
- package/vendor/tree-sitter-proto/binding.gyp +30 -0
- package/vendor/tree-sitter-proto/bindings/node/binding.cc +20 -0
- package/vendor/tree-sitter-proto/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-proto/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-proto/package.json +12 -0
- package/vendor/tree-sitter-proto/src/node-types.json +1145 -0
- package/vendor/tree-sitter-proto/src/parser.c +10149 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/alloc.h +54 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/array.h +291 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/parser.h +266 -0
- package/vendor/tree-sitter-swift/LICENSE +21 -0
- package/vendor/tree-sitter-swift/README.md +139 -0
- package/vendor/tree-sitter-swift/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-swift/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-swift/package.json +28 -0
- package/vendor/tree-sitter-swift/prebuilds/darwin-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/darwin-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/linux-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/linux-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/win32-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/win32-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/src/node-types.json +30694 -0
- package/web/assets/__vite-browser-external-CLwMvL_q.js +1 -0
- package/web/assets/agent-DaYmiVrk.js +601 -0
- package/web/assets/architecture-7EHR7CIX-6QZW5X65-aGTGQQQG.js +1 -0
- package/web/assets/architectureDiagram-UL44E2DR-613o-OfM.js +36 -0
- package/web/assets/blockDiagram-7IZFK4PR-BBJRt4vF.js +132 -0
- package/web/assets/c4Diagram-Y2BXMSZH-BhR2CErx.js +10 -0
- package/web/assets/chunk-3SSMPTDK-DWfEAoKy.js +321 -0
- package/web/assets/chunk-6764PJDD-NOXEgi3n.js +1 -0
- package/web/assets/chunk-AZZRMDJM-DVvcxwI7.js +15 -0
- package/web/assets/chunk-JQRUD6KW-CQgkrimK.js +1 -0
- package/web/assets/chunk-KGYTTC2M-DxOdSoAJ.js +161 -0
- package/web/assets/chunk-KRXBNO2N-BlnQTnxv.js +1 -0
- package/web/assets/chunk-LCXTWHL2-Dhf_u-1F.js +231 -0
- package/web/assets/chunk-LII3EMHJ-Cb3HLCZX.js +1 -0
- package/web/assets/chunk-RG4AUYOV-DLCfNede.js +206 -0
- package/web/assets/chunk-T5OCTHI4-B0CGAG7q.js +1 -0
- package/web/assets/chunk-W44A43WB-ZyrAMwtT.js +1 -0
- package/web/assets/chunk-ZXARS5L4-B0TJPmj5.js +1 -0
- package/web/assets/classDiagram-KGZ6W3CR-CvSnsfJD.js +1 -0
- package/web/assets/classDiagram-v2-72OJOZXJ-CvSnsfJD.js +1 -0
- package/web/assets/context-builder-BREgwful.js +15 -0
- package/web/assets/cose-bilkent-UX7MHV2Q-BsPIaeag.js +1 -0
- package/web/assets/dagre-ND4H6XIP-CV4l9vOZ.js +4 -0
- package/web/assets/diagram-3NCE3AQN-9kSzEbS8.js +43 -0
- package/web/assets/diagram-GF46GFSD-qRvqbex6.js +24 -0
- package/web/assets/diagram-HNR7UZ2L-Dj_ye4Ua.js +3 -0
- package/web/assets/diagram-QXG6HAR7-COwBV6B0.js +24 -0
- package/web/assets/diagram-WEQXMOUZ-C9xjn5dU.js +10 -0
- package/web/assets/erDiagram-L5TCEMPS-fRp0t1Yd.js +85 -0
- package/web/assets/eventmodeling-FCH6USID-MREXMVOE-BR0Ygfrw.js +1 -0
- package/web/assets/flowDiagram-H6V6AXG4-Ccr8FDLD.js +162 -0
- package/web/assets/ganttDiagram-JCBTUEKG-DfBPqAGN.js +292 -0
- package/web/assets/gitGraph-WXDBUCRP-R675I2BI-CYihBz6Z.js +1 -0
- package/web/assets/gitGraphDiagram-S2ZK5IYY-CHvG_UQ0.js +106 -0
- package/web/assets/index-B7cw1L6-.css +2 -0
- package/web/assets/index-CJJQgfSH.js +886 -0
- package/web/assets/info-J43DQDTF-KCYPFFUO-BmmoeX4D.js +1 -0
- package/web/assets/infoDiagram-3YFTVSEB-C7cMy-GP.js +2 -0
- package/web/assets/ishikawaDiagram-BNXS4ZKH-C80yCPYi.js +70 -0
- package/web/assets/journeyDiagram-M6C3CM3L-BHxH1zjE.js +139 -0
- package/web/assets/kanban-definition-75IXJCU3-DNZo1hOE.js +89 -0
- package/web/assets/katex-K3KEBU37-CbyuvTf1.js +261 -0
- package/web/assets/mindmap-definition-2TDM6QVE-Dpgl3Elt.js +96 -0
- package/web/assets/packet-YPE3B663-LP52Z2RK-7JAqDnUy.js +1 -0
- package/web/assets/pie-LRSECV5Y-TCRJHUBD-Bv9vE7io.js +1 -0
- package/web/assets/pieDiagram-CU6KROY3-BW0mr0ek.js +30 -0
- package/web/assets/quadrantDiagram-VICAPDV7-C1dCMBbk.js +7 -0
- package/web/assets/radar-GUYGQ44K-RDLRG3WG-dtZpcOZd.js +1 -0
- package/web/assets/requirementDiagram-JXO7QTGE-Dyqqny4j.js +84 -0
- package/web/assets/sankeyDiagram-URQDO5SZ-B3FGr5SL.js +40 -0
- package/web/assets/sequenceDiagram-VS2MUI6T-B4LlGP9C.js +162 -0
- package/web/assets/stateDiagram-7D4R322I-V9F-klBP.js +1 -0
- package/web/assets/stateDiagram-v2-36443NZ5-CKDYYzqR.js +1 -0
- package/web/assets/timeline-definition-O6YCAMPW-CX2WjkZA.js +120 -0
- package/web/assets/treeView-BLDUP644-QA4HXRO3-BQaKTdhr.js +1 -0
- package/web/assets/treemap-LRROVOQU-LLAWBHMP-Bqlxdyrq.js +1 -0
- package/web/assets/vennDiagram-MWXL3ELB-BxZPYqOF.js +34 -0
- package/web/assets/wardley-L42UT6IY-5TKZOOLJ-dofeprUr.js +1 -0
- package/web/assets/wardleyDiagram-CUQ6CDDI-BLdJJYkV.js +78 -0
- package/web/assets/xychartDiagram-N2JHSOCM-DqDgigLa.js +7 -0
- package/web/index.html +19 -0
|
@@ -0,0 +1,2895 @@
|
|
|
1
|
+
/// <reference types="tree-sitter-cli/dsl" />
|
|
2
|
+
|
|
3
|
+
// Using the informal draft spec to support the newest features of dart
|
|
4
|
+
// https://spec.dart.dev/DartLangSpecDraft.pdf
|
|
5
|
+
|
|
6
|
+
const DIGITS = token(sep1(/[0-9]+/, /_+/))
|
|
7
|
+
const HEX_DIGITS = token(sep1(/[A-Fa-f0-9]+/, '_'))
|
|
8
|
+
|
|
9
|
+
//Everything above RelationalTypeCast was incremented from its original value
|
|
10
|
+
//This was to get type casting issues finally fixed.
|
|
11
|
+
|
|
12
|
+
const DART_PREC = {
|
|
13
|
+
IMPORT_EXPORT: 19,
|
|
14
|
+
TYPE_IDENTIFIER: 18, //was: 17
|
|
15
|
+
DOT_IDENTIFIER: 19, //was: 18
|
|
16
|
+
UNARY_POSTFIX: 17,
|
|
17
|
+
UNARY_PREFIX: 16,
|
|
18
|
+
Multiplicative: 15, // *, /, ˜/, % Left
|
|
19
|
+
Additive: 14, // +, - Left
|
|
20
|
+
Shift: 13, // <<, >>, >>> Left
|
|
21
|
+
TYPE_ARGUMENTS: 13,
|
|
22
|
+
Bitwise_AND: 12, // & Left
|
|
23
|
+
Bitwise_XOR: 11, // ˆ Left
|
|
24
|
+
Bitwise_Or: 10, // | Left
|
|
25
|
+
RelationalTypeCast: 9, // <, >, <=, >=, as, is, is! None 8
|
|
26
|
+
RelationalTypeTest: 9,
|
|
27
|
+
Relational: 8, // <, >, <=, >=, as, is, is! None 8
|
|
28
|
+
Equality: 7, // ==, != None 7
|
|
29
|
+
Logical_AND: 6, // AND && Left
|
|
30
|
+
Logical_OR: 5, // Or || Left
|
|
31
|
+
If: 4, //-null ?? Left
|
|
32
|
+
Conditional: 3, // e1?e2:e3 Right 3
|
|
33
|
+
Cascade: 2, // .. Left
|
|
34
|
+
Assignment: 1, // =, *=, /=, +=, -=, &=, ˆ=, etc. Right
|
|
35
|
+
BUILTIN: 0,
|
|
36
|
+
TRY: 0,
|
|
37
|
+
// Added by Ben for experimentation.
|
|
38
|
+
SELECTOR_IN_PRIMARY: 1,
|
|
39
|
+
SELECTOR_IN_ASSIGNMENT: 0,
|
|
40
|
+
TYPE_ARGS: 1
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// TODO: general things to add
|
|
44
|
+
// both string types
|
|
45
|
+
//get protocols in classes?
|
|
46
|
+
// todo: type test operators: as, is, and is!
|
|
47
|
+
//todo: assignment operators: ??=, and ~/=
|
|
48
|
+
//todo: ?? operator
|
|
49
|
+
// todo: cascade notation: dot dot accesses each object
|
|
50
|
+
//todo: conditional member access: blah?.foo
|
|
51
|
+
//todo: rethrow keyword
|
|
52
|
+
//todo: override operator notations
|
|
53
|
+
//todo: correct import statements to be strings
|
|
54
|
+
//todo: sync* and async* functions, plus yields
|
|
55
|
+
|
|
56
|
+
//DONE: override shorter constructor notations?
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
module.exports = grammar({
|
|
60
|
+
name: 'dart',
|
|
61
|
+
|
|
62
|
+
externals: $ => [
|
|
63
|
+
$._template_chars_double,
|
|
64
|
+
$._template_chars_single,
|
|
65
|
+
$._template_chars_double_single,
|
|
66
|
+
$._template_chars_single_single,
|
|
67
|
+
$._template_chars_raw_slash,
|
|
68
|
+
$._block_comment,
|
|
69
|
+
$._documentation_block_comment,
|
|
70
|
+
],
|
|
71
|
+
|
|
72
|
+
extras: $ => [
|
|
73
|
+
$.comment,
|
|
74
|
+
$.documentation_comment,
|
|
75
|
+
/\s/
|
|
76
|
+
],
|
|
77
|
+
|
|
78
|
+
supertypes: $ => [
|
|
79
|
+
// $._expression,
|
|
80
|
+
$._declaration,
|
|
81
|
+
$._statement,
|
|
82
|
+
$._literal,
|
|
83
|
+
// $._element
|
|
84
|
+
// $._primary_pattern
|
|
85
|
+
// $._primary,
|
|
86
|
+
// $._type,
|
|
87
|
+
],
|
|
88
|
+
|
|
89
|
+
inline: $ => [
|
|
90
|
+
$._ambiguous_name,
|
|
91
|
+
$._class_member_definition,
|
|
92
|
+
$._if_null_expression,
|
|
93
|
+
],
|
|
94
|
+
|
|
95
|
+
conflicts: $ => [
|
|
96
|
+
[$._record_literal_no_const, $.record_field],
|
|
97
|
+
[$.block, $.set_or_map_literal],
|
|
98
|
+
[$._type_name, $._primary, $.function_signature],
|
|
99
|
+
[$._primary, $._type_name],
|
|
100
|
+
[$._primary, $._simple_formal_parameter],
|
|
101
|
+
[$._primary, $._type_name, $._function_formal_parameter],
|
|
102
|
+
[$._primary, $.constructor_param],
|
|
103
|
+
[$._normal_formal_parameters],
|
|
104
|
+
[$._declared_identifier],
|
|
105
|
+
[$.equality_expression],
|
|
106
|
+
[$.record_type_field, $._function_formal_parameter, $._var_or_type],
|
|
107
|
+
[$.typed_identifier, $._var_or_type, $._function_formal_parameter],
|
|
108
|
+
[$._type_name, $._simple_formal_parameter],
|
|
109
|
+
[$._type_not_function, $._type_not_void],
|
|
110
|
+
[$.switch_statement_case],
|
|
111
|
+
// [$._argument_list],
|
|
112
|
+
[$.declaration, $._external_and_static],
|
|
113
|
+
[$.constructor_signature, $._formal_parameter_part],
|
|
114
|
+
// [$._type_not_function, $._type_not_void],
|
|
115
|
+
[$._cascade_subsection],
|
|
116
|
+
[$._expression],
|
|
117
|
+
// [$._real_expression, $._below_relational_expression],
|
|
118
|
+
[$._postfix_expression],
|
|
119
|
+
[$.pattern_variable_declaration, $._var_or_type],
|
|
120
|
+
[$._final_const_var_or_type, $.pattern_variable_declaration],
|
|
121
|
+
[$.type_arguments, $.relational_operator],
|
|
122
|
+
[$.prefix_operator, $.constant_pattern],
|
|
123
|
+
[$._primary, $.constant_pattern, $._type_name],
|
|
124
|
+
[$._literal, $.constant_pattern],
|
|
125
|
+
[$._primary, $.constant_pattern],
|
|
126
|
+
[$._final_var_or_type],
|
|
127
|
+
[$._primary, $.constant_pattern, $._type_name, $._simple_formal_parameter],
|
|
128
|
+
[$._parenthesized_pattern, $._pattern_field],
|
|
129
|
+
[$.record_type_field, $._var_or_type, $._final_var_or_type, $._function_formal_parameter],
|
|
130
|
+
[$._var_or_type, $._final_var_or_type],
|
|
131
|
+
[$._final_const_var_or_type, $._final_var_or_type],
|
|
132
|
+
[$._var_or_type, $._for_loop_parts, $.pattern_variable_declaration],
|
|
133
|
+
[$.pattern_variable_declaration, $._for_loop_parts, $._final_const_var_or_type],
|
|
134
|
+
[$._var_or_type, $._final_var_or_type, $._function_formal_parameter],
|
|
135
|
+
[$.set_or_map_literal, $.map_pattern],
|
|
136
|
+
[$.list_literal, $.list_pattern],
|
|
137
|
+
[$.constant_pattern, $._type_name],
|
|
138
|
+
[$._pattern_field, $.label],
|
|
139
|
+
[$.constructor_tearoff, $._identifier_or_new],
|
|
140
|
+
[$._primary, $.constant_pattern, $._simple_formal_parameter],
|
|
141
|
+
[$.record_type_field, $._final_var_or_type],
|
|
142
|
+
[$.set_or_map_literal, $.constant_pattern],
|
|
143
|
+
[$.list_literal, $.constant_pattern],
|
|
144
|
+
[$._var_or_type, $.function_signature],
|
|
145
|
+
[$._var_or_type, $._function_formal_parameter],
|
|
146
|
+
[$.relational_operator, $.type_arguments, $.type_parameters],
|
|
147
|
+
[$._var_or_type],
|
|
148
|
+
[$._final_const_var_or_type, $.const_object_expression],
|
|
149
|
+
[$._final_const_var_or_type],
|
|
150
|
+
[$.type_parameter, $._type_name],
|
|
151
|
+
[$._normal_formal_parameter],
|
|
152
|
+
[$._assignable_selector_part, $.selector],
|
|
153
|
+
[$._assignable_selector_part, $._postfix_expression],
|
|
154
|
+
[$._primary, $.assignable_expression],
|
|
155
|
+
[$._simple_formal_parameter, $.assignable_expression],
|
|
156
|
+
// [$._type_name, $._primary, $.assignable_expression],
|
|
157
|
+
[$.assignable_expression, $._postfix_expression],
|
|
158
|
+
// [$._type_name, $.assignable_expression],
|
|
159
|
+
// [$._type_name, $.function_signature],
|
|
160
|
+
[$._type_name, $._function_formal_parameter],
|
|
161
|
+
[$._type_name],
|
|
162
|
+
// [$.assignment_expression, $._expression],
|
|
163
|
+
[$._primary, $._type_name, $.assignable_expression],
|
|
164
|
+
[$._type_name, $.function_signature],
|
|
165
|
+
// [$.relational_operator, $._shift_operator],
|
|
166
|
+
[$.declaration, $._external],
|
|
167
|
+
[$.relational_expression],
|
|
168
|
+
[$._function_type_tail],
|
|
169
|
+
[$._type_not_void_not_function, $._function_type_tail],
|
|
170
|
+
[$._type_not_void],
|
|
171
|
+
[$._type_not_void_not_function],
|
|
172
|
+
[$.super_formal_parameter, $.unconditional_assignable_selector],
|
|
173
|
+
],
|
|
174
|
+
|
|
175
|
+
word: $ => $.identifier,
|
|
176
|
+
|
|
177
|
+
rules: {
|
|
178
|
+
|
|
179
|
+
// Page 188 libraryDeclaration
|
|
180
|
+
program: $ => seq(
|
|
181
|
+
optional($.script_tag),
|
|
182
|
+
optional($.library_name),
|
|
183
|
+
repeat($.import_or_export),
|
|
184
|
+
repeat($.part_directive),
|
|
185
|
+
repeat($.part_of_directive),
|
|
186
|
+
repeat($._top_level_definition),
|
|
187
|
+
),
|
|
188
|
+
|
|
189
|
+
// Page 187 topLevelDefinition
|
|
190
|
+
_top_level_definition: $ => choice(
|
|
191
|
+
$.class_definition,
|
|
192
|
+
$.mixin_declaration,
|
|
193
|
+
$.extension_declaration,
|
|
194
|
+
$.enum_declaration,
|
|
195
|
+
$.type_alias,
|
|
196
|
+
seq(
|
|
197
|
+
optional($._metadata),
|
|
198
|
+
optional($._external_builtin),
|
|
199
|
+
$.function_signature,
|
|
200
|
+
$._semicolon
|
|
201
|
+
),
|
|
202
|
+
seq(
|
|
203
|
+
optional($._metadata),
|
|
204
|
+
optional($._external_builtin),
|
|
205
|
+
$.getter_signature,
|
|
206
|
+
$._semicolon
|
|
207
|
+
),
|
|
208
|
+
seq(
|
|
209
|
+
optional($._metadata),
|
|
210
|
+
optional($._external_builtin),
|
|
211
|
+
$.setter_signature,
|
|
212
|
+
$._semicolon
|
|
213
|
+
),
|
|
214
|
+
seq(
|
|
215
|
+
optional($._metadata),
|
|
216
|
+
$.getter_signature,
|
|
217
|
+
$.function_body
|
|
218
|
+
),
|
|
219
|
+
seq(
|
|
220
|
+
optional($._metadata),
|
|
221
|
+
$.setter_signature,
|
|
222
|
+
$.function_body
|
|
223
|
+
),
|
|
224
|
+
seq(
|
|
225
|
+
optional($._metadata),
|
|
226
|
+
$.function_signature,
|
|
227
|
+
$.function_body
|
|
228
|
+
),
|
|
229
|
+
// final or const static final declaration list
|
|
230
|
+
seq(
|
|
231
|
+
optional($._metadata),
|
|
232
|
+
choice(
|
|
233
|
+
$.final_builtin,
|
|
234
|
+
$.const_builtin
|
|
235
|
+
),
|
|
236
|
+
optional($._type),
|
|
237
|
+
$.static_final_declaration_list,
|
|
238
|
+
$._semicolon
|
|
239
|
+
),
|
|
240
|
+
seq(
|
|
241
|
+
optional($._metadata),
|
|
242
|
+
$._late_builtin,
|
|
243
|
+
$.final_builtin,
|
|
244
|
+
optional($._type),
|
|
245
|
+
$.initialized_identifier_list,
|
|
246
|
+
$._semicolon
|
|
247
|
+
),
|
|
248
|
+
seq(
|
|
249
|
+
optional($._metadata),
|
|
250
|
+
optional($._late_builtin),
|
|
251
|
+
choice($._type, $.inferred_type),
|
|
252
|
+
$.initialized_identifier_list,
|
|
253
|
+
$._semicolon
|
|
254
|
+
)
|
|
255
|
+
),
|
|
256
|
+
|
|
257
|
+
/**************************************************************************************************
|
|
258
|
+
*********************************Literals**********************************************************
|
|
259
|
+
***************************************************************************************************
|
|
260
|
+
****These are the Literals from section 16.4-9 (Page 84-110) of the dart specification*************
|
|
261
|
+
***************************************************************************************************
|
|
262
|
+
***************************************************************************************************/
|
|
263
|
+
|
|
264
|
+
_bool_literal: $ => choice($.true, $.false),
|
|
265
|
+
|
|
266
|
+
_numeric_literal: $ => choice(
|
|
267
|
+
$.decimal_integer_literal,
|
|
268
|
+
$.decimal_floating_point_literal,
|
|
269
|
+
$.hex_integer_literal,
|
|
270
|
+
),
|
|
271
|
+
|
|
272
|
+
_literal: $ => choice(
|
|
273
|
+
$.null_literal,
|
|
274
|
+
$._bool_literal,
|
|
275
|
+
$._numeric_literal,
|
|
276
|
+
$.string_literal,
|
|
277
|
+
$.symbol_literal,
|
|
278
|
+
$.set_or_map_literal,
|
|
279
|
+
$.list_literal,
|
|
280
|
+
$.record_literal,
|
|
281
|
+
),
|
|
282
|
+
|
|
283
|
+
/****This is the symbol literals from section 16.8 (Page 99) of the dart specification****************/
|
|
284
|
+
symbol_literal: $ => seq('#', $.identifier),
|
|
285
|
+
//symbol literal can also be an operator?
|
|
286
|
+
|
|
287
|
+
/**************************************************************************************************
|
|
288
|
+
*********************************Numeric Literals**************************************************
|
|
289
|
+
***************************************************************************************************
|
|
290
|
+
****These are the Numeric Literals from section 16.5 (Page 84-85) of the dart specification********
|
|
291
|
+
***************************************************************************************************
|
|
292
|
+
***************************************************************************************************/
|
|
293
|
+
|
|
294
|
+
decimal_integer_literal: $ => token(DIGITS),
|
|
295
|
+
|
|
296
|
+
hex_integer_literal: $ => token(seq(
|
|
297
|
+
choice('0x', '0X'),
|
|
298
|
+
HEX_DIGITS
|
|
299
|
+
)),
|
|
300
|
+
|
|
301
|
+
decimal_floating_point_literal: $ => token(choice(
|
|
302
|
+
seq(DIGITS, '.', DIGITS, optional(seq((/[eE]/), optional(choice('-', '+')), DIGITS))),
|
|
303
|
+
seq('.', DIGITS, optional(seq((/[eE]/), optional(choice('-', '+')), DIGITS))),
|
|
304
|
+
seq(DIGITS, /[eE]/, optional(choice('-', '+')), DIGITS),
|
|
305
|
+
seq(DIGITS, optional(seq((/[eE]/), optional(choice('-', '+')), DIGITS)))
|
|
306
|
+
)),
|
|
307
|
+
|
|
308
|
+
/**************************************************************************************************
|
|
309
|
+
*********************************Boolean Literals**************************************************
|
|
310
|
+
***************************************************************************************************
|
|
311
|
+
****These are the boolean from section 16.6 (Page 86) of the dart specification********************
|
|
312
|
+
***************************************************************************************************
|
|
313
|
+
***************************************************************************************************/
|
|
314
|
+
true: $ => prec(
|
|
315
|
+
DART_PREC.BUILTIN,
|
|
316
|
+
'true',
|
|
317
|
+
),
|
|
318
|
+
|
|
319
|
+
false: $ => prec(
|
|
320
|
+
DART_PREC.BUILTIN,
|
|
321
|
+
'false',
|
|
322
|
+
),
|
|
323
|
+
|
|
324
|
+
/**************************************************************************************************
|
|
325
|
+
*********************************String Parts******************************************************
|
|
326
|
+
***************************************************************************************************
|
|
327
|
+
****These are the parts of String from section 16.7 (Page 86-92) of the dart specification*********
|
|
328
|
+
***************************************************************************************************
|
|
329
|
+
***************************************************************************************************/
|
|
330
|
+
string_literal: $ => repeat1(
|
|
331
|
+
choice(
|
|
332
|
+
$._string_literal_double_quotes,
|
|
333
|
+
$._string_literal_single_quotes,
|
|
334
|
+
$._string_literal_double_quotes_multiple,
|
|
335
|
+
$._string_literal_single_quotes_multiple,
|
|
336
|
+
//raw, separate later
|
|
337
|
+
$._raw_string_literal_double_quotes,
|
|
338
|
+
$._raw_string_literal_single_quotes,
|
|
339
|
+
$._raw_string_literal_double_quotes_multiple,
|
|
340
|
+
$._raw_string_literal_single_quotes_multiple,
|
|
341
|
+
),
|
|
342
|
+
),
|
|
343
|
+
_string_literal_double_quotes: $ => seq(
|
|
344
|
+
'"',
|
|
345
|
+
repeat(
|
|
346
|
+
choice(
|
|
347
|
+
$._template_chars_double_single,
|
|
348
|
+
'\'',
|
|
349
|
+
$.escape_sequence,
|
|
350
|
+
$._sub_string_test,
|
|
351
|
+
$.template_substitution
|
|
352
|
+
)
|
|
353
|
+
),
|
|
354
|
+
'"'
|
|
355
|
+
),
|
|
356
|
+
_string_literal_single_quotes: $ => seq(
|
|
357
|
+
'\'',
|
|
358
|
+
repeat(choice(
|
|
359
|
+
$._template_chars_single_single,
|
|
360
|
+
'"',
|
|
361
|
+
$.escape_sequence,
|
|
362
|
+
$._sub_string_test,
|
|
363
|
+
$.template_substitution
|
|
364
|
+
)),
|
|
365
|
+
'\''
|
|
366
|
+
),
|
|
367
|
+
_string_literal_double_quotes_multiple: $ => prec.left(
|
|
368
|
+
seq(
|
|
369
|
+
'"""',
|
|
370
|
+
repeat(choice(
|
|
371
|
+
$._template_chars_double,
|
|
372
|
+
'\'',
|
|
373
|
+
'\"',
|
|
374
|
+
$.escape_sequence,
|
|
375
|
+
$._sub_string_test,
|
|
376
|
+
$.template_substitution
|
|
377
|
+
)),
|
|
378
|
+
'"""'
|
|
379
|
+
),
|
|
380
|
+
),
|
|
381
|
+
_string_literal_single_quotes_multiple: $ => prec.left(
|
|
382
|
+
seq(
|
|
383
|
+
'\'\'\'',
|
|
384
|
+
repeat(choice(
|
|
385
|
+
$._template_chars_single,
|
|
386
|
+
'"',
|
|
387
|
+
'\'',
|
|
388
|
+
$.escape_sequence,
|
|
389
|
+
$._sub_string_test,
|
|
390
|
+
$.template_substitution
|
|
391
|
+
)),
|
|
392
|
+
'\'\'\''
|
|
393
|
+
),
|
|
394
|
+
),
|
|
395
|
+
_raw_string_literal_double_quotes: $ => seq(
|
|
396
|
+
'r"',
|
|
397
|
+
repeat(choice(
|
|
398
|
+
$._template_chars_double_single,
|
|
399
|
+
// /[^\n"]*/,
|
|
400
|
+
'\'',
|
|
401
|
+
$._template_chars_raw_slash,
|
|
402
|
+
// '\\',
|
|
403
|
+
$._unused_escape_sequence,
|
|
404
|
+
$._sub_string_test,
|
|
405
|
+
'$'
|
|
406
|
+
)),
|
|
407
|
+
'"'
|
|
408
|
+
),
|
|
409
|
+
_raw_string_literal_single_quotes: $ => seq(
|
|
410
|
+
'r\'',
|
|
411
|
+
repeat(choice(
|
|
412
|
+
$._template_chars_single_single,
|
|
413
|
+
// /[^\n']/,
|
|
414
|
+
'"',
|
|
415
|
+
$._template_chars_raw_slash,
|
|
416
|
+
// '\\',
|
|
417
|
+
$._unused_escape_sequence,
|
|
418
|
+
$._sub_string_test,
|
|
419
|
+
'$'
|
|
420
|
+
)),
|
|
421
|
+
'\''
|
|
422
|
+
),
|
|
423
|
+
_raw_string_literal_double_quotes_multiple: $ => prec.left(
|
|
424
|
+
seq(
|
|
425
|
+
'r"""',
|
|
426
|
+
// $._triple_double_quote_end,
|
|
427
|
+
repeat(choice(
|
|
428
|
+
$._template_chars_double,
|
|
429
|
+
'\'',
|
|
430
|
+
// '\\',
|
|
431
|
+
$._template_chars_raw_slash,
|
|
432
|
+
'"',
|
|
433
|
+
$._unused_escape_sequence,
|
|
434
|
+
$._sub_string_test,
|
|
435
|
+
'$'
|
|
436
|
+
)),
|
|
437
|
+
'"""'
|
|
438
|
+
// $._triple_double_quote_end
|
|
439
|
+
),
|
|
440
|
+
),
|
|
441
|
+
_raw_string_literal_single_quotes_multiple: $ => prec.left(
|
|
442
|
+
seq(
|
|
443
|
+
'r\'\'\'',
|
|
444
|
+
// $._triple_quote_end,
|
|
445
|
+
repeat(choice(
|
|
446
|
+
$._template_chars_single,
|
|
447
|
+
'"',
|
|
448
|
+
'\'',
|
|
449
|
+
// '\\',
|
|
450
|
+
$._template_chars_raw_slash,
|
|
451
|
+
$._unused_escape_sequence,
|
|
452
|
+
$._sub_string_test,
|
|
453
|
+
'$'
|
|
454
|
+
)),
|
|
455
|
+
'\'\'\''
|
|
456
|
+
// $._triple_quote_end
|
|
457
|
+
),
|
|
458
|
+
),
|
|
459
|
+
_triple_quote_end: $ => token('\'\'\''),
|
|
460
|
+
_triple_double_quote_end: $ => token('"""'),
|
|
461
|
+
template_substitution: $ => seq(
|
|
462
|
+
'$',
|
|
463
|
+
choice(
|
|
464
|
+
seq('{',
|
|
465
|
+
$._expression,
|
|
466
|
+
'}'),
|
|
467
|
+
$.identifier_dollar_escaped
|
|
468
|
+
)
|
|
469
|
+
),
|
|
470
|
+
_sub_string_test: $ => seq('$', /[^a-zA-Z_{]/),
|
|
471
|
+
_string_interp: $ => /\$((\w+)|\{([^{}]+)\})/, // represents $word or ${word} for now
|
|
472
|
+
_unused_escape_sequence: $ => token.immediate(seq(
|
|
473
|
+
'\\',
|
|
474
|
+
choice(
|
|
475
|
+
/[^xu0-7]/,
|
|
476
|
+
/[0-7]{1,3}/,
|
|
477
|
+
/x[0-9a-fA-F]{2}/,
|
|
478
|
+
/u[0-9a-fA-F]{4}/,
|
|
479
|
+
/u\{[0-9a-fA-F]+\}/
|
|
480
|
+
)
|
|
481
|
+
)),
|
|
482
|
+
escape_sequence: $ => $._unused_escape_sequence,
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
/**************************************************************************************************
|
|
486
|
+
*********************************Collection Literals***********************************************
|
|
487
|
+
***************************************************************************************************
|
|
488
|
+
****These are the collection literals from section 16.9 (Page 92-108) of the dart specification****
|
|
489
|
+
***************************************************************************************************
|
|
490
|
+
***************************************************************************************************/
|
|
491
|
+
list_literal: $ => seq(
|
|
492
|
+
optional($.const_builtin), optional($.type_arguments), '[',
|
|
493
|
+
commaSepTrailingComma($._element),
|
|
494
|
+
']'
|
|
495
|
+
),
|
|
496
|
+
set_or_map_literal: $ => seq(
|
|
497
|
+
optional($.const_builtin), optional($.type_arguments), '{',
|
|
498
|
+
commaSepTrailingComma(
|
|
499
|
+
$._element
|
|
500
|
+
),
|
|
501
|
+
'}'
|
|
502
|
+
),
|
|
503
|
+
|
|
504
|
+
pair: $ => seq(
|
|
505
|
+
field('key', $._expression),
|
|
506
|
+
':',
|
|
507
|
+
field('value', $._expression)
|
|
508
|
+
),
|
|
509
|
+
// pair_or_element: $ => seq(
|
|
510
|
+
// field('key', $._expression),
|
|
511
|
+
// optional(
|
|
512
|
+
// seq(
|
|
513
|
+
// ':',
|
|
514
|
+
// field('value', $._expression)
|
|
515
|
+
// )
|
|
516
|
+
// )
|
|
517
|
+
// ),
|
|
518
|
+
|
|
519
|
+
_element: $ => choice(
|
|
520
|
+
$._expression,
|
|
521
|
+
$.pair,
|
|
522
|
+
$.spread_element,
|
|
523
|
+
$.if_element,
|
|
524
|
+
$.for_element
|
|
525
|
+
),
|
|
526
|
+
|
|
527
|
+
/****This is the null literal from section 16.4 (Page 84) of the dart specification****/
|
|
528
|
+
null_literal: $ => prec(
|
|
529
|
+
DART_PREC.BUILTIN,
|
|
530
|
+
'null',
|
|
531
|
+
),
|
|
532
|
+
|
|
533
|
+
/// Record literal (from Dart.g)
|
|
534
|
+
record_literal: $ => seq(
|
|
535
|
+
optional($.const_builtin),
|
|
536
|
+
$._record_literal_no_const,
|
|
537
|
+
),
|
|
538
|
+
|
|
539
|
+
_record_literal_no_const: $ => seq(
|
|
540
|
+
'(',
|
|
541
|
+
choice(
|
|
542
|
+
seq($.label, $._expression),
|
|
543
|
+
seq($._expression, ','),
|
|
544
|
+
commaSep2TrailingComma($.record_field),
|
|
545
|
+
),
|
|
546
|
+
')'
|
|
547
|
+
),
|
|
548
|
+
|
|
549
|
+
record_field: $ => seq(optional($.label), $._expression),
|
|
550
|
+
|
|
551
|
+
/**************************************************************************************************
|
|
552
|
+
*********************************Expressions*******************************************************
|
|
553
|
+
***************************************************************************************************
|
|
554
|
+
****These are the expressions from section 16.9 (Page 110-166) of the dart specification***********
|
|
555
|
+
***************************************************************************************************
|
|
556
|
+
***************************************************************************************************/
|
|
557
|
+
_expression: $ => choice(
|
|
558
|
+
$.pattern_assignment,
|
|
559
|
+
$.assignment_expression,
|
|
560
|
+
$.throw_expression,
|
|
561
|
+
$.rethrow_expression,
|
|
562
|
+
seq(
|
|
563
|
+
$._real_expression,
|
|
564
|
+
repeat($.cascade_section)
|
|
565
|
+
)
|
|
566
|
+
),
|
|
567
|
+
_expression_without_cascade: $ => choice(
|
|
568
|
+
$.assignment_expression_without_cascade,
|
|
569
|
+
$._real_expression,
|
|
570
|
+
$.throw_expression_without_cascade
|
|
571
|
+
),
|
|
572
|
+
_real_expression: $ => choice(
|
|
573
|
+
$.conditional_expression,
|
|
574
|
+
$.logical_or_expression,
|
|
575
|
+
$.if_null_expression,
|
|
576
|
+
$.additive_expression,
|
|
577
|
+
$.multiplicative_expression,
|
|
578
|
+
$.relational_expression,
|
|
579
|
+
$.equality_expression,
|
|
580
|
+
$.logical_and_expression,
|
|
581
|
+
$.bitwise_and_expression,
|
|
582
|
+
$.bitwise_or_expression,
|
|
583
|
+
$.bitwise_xor_expression,
|
|
584
|
+
$.shift_expression,
|
|
585
|
+
$.type_cast_expression,
|
|
586
|
+
$.type_test_expression,
|
|
587
|
+
$._unary_expression
|
|
588
|
+
),
|
|
589
|
+
|
|
590
|
+
// _below_relational_expression: $ => choice(
|
|
591
|
+
// // UNARY_POSTFIX: 16,
|
|
592
|
+
// // UNARY_PREFIX: 15,
|
|
593
|
+
// // Multiplicative: 14, // *, /, ˜/, % Left
|
|
594
|
+
// // Additive: 13, // +, - Left
|
|
595
|
+
// // Shift: 12, // <<, >>, >>> Left
|
|
596
|
+
// // Bitwise_AND: 11, // & Left
|
|
597
|
+
// // Bitwise_XOR: 10, // ˆ Left
|
|
598
|
+
// // Bitwise_Or: 9 , // | Left
|
|
599
|
+
// // $.type_cast_expression,
|
|
600
|
+
// $._unary_expression,
|
|
601
|
+
// $.multiplicative_expression,
|
|
602
|
+
// $.additive_expression,
|
|
603
|
+
// $.shift_expression,
|
|
604
|
+
// $.bitwise_and_expression,
|
|
605
|
+
// $.bitwise_or_expression,
|
|
606
|
+
// $.bitwise_xor_expression,
|
|
607
|
+
//
|
|
608
|
+
// ),
|
|
609
|
+
//
|
|
610
|
+
// _below_relational_type_cast_expression: $ => prec(
|
|
611
|
+
// DART_PREC.RelationalTypeCast,
|
|
612
|
+
// choice(
|
|
613
|
+
// // UNARY_POSTFIX: 16,
|
|
614
|
+
// // UNARY_PREFIX: 15,
|
|
615
|
+
// // Multiplicative: 14, // *, /, ˜/, % Left
|
|
616
|
+
// // Additive: 13, // +, - Left
|
|
617
|
+
// // Shift: 12, // <<, >>, >>> Left
|
|
618
|
+
// // Bitwise_AND: 11, // & Left
|
|
619
|
+
// // Bitwise_XOR: 10, // ˆ Left
|
|
620
|
+
// // Bitwise_Or: 9 , // | Left
|
|
621
|
+
// $._unary_expression,
|
|
622
|
+
// $.multiplicative_expression,
|
|
623
|
+
// $.additive_expression,
|
|
624
|
+
// $.shift_expression,
|
|
625
|
+
// $.bitwise_and_expression,
|
|
626
|
+
// $.bitwise_or_expression,
|
|
627
|
+
// $.bitwise_xor_expression,
|
|
628
|
+
//
|
|
629
|
+
// )
|
|
630
|
+
// ),
|
|
631
|
+
|
|
632
|
+
throw_expression: $ => seq(
|
|
633
|
+
'throw',
|
|
634
|
+
$._expression
|
|
635
|
+
),
|
|
636
|
+
throw_expression_without_cascade: $ => seq(
|
|
637
|
+
'throw',
|
|
638
|
+
$._expression_without_cascade
|
|
639
|
+
),
|
|
640
|
+
|
|
641
|
+
rethrow_expression: $ => $.rethrow_builtin,
|
|
642
|
+
|
|
643
|
+
/**************************************************************************************************
|
|
644
|
+
***********************Assignment Expressions*****************************************************
|
|
645
|
+
***************************************************************************************************
|
|
646
|
+
****These are the assignment expressions from section 16.34 (Page 159) of the dart DRAFT**********
|
|
647
|
+
* specification. (Very different from the formal spec in this instance)****************************
|
|
648
|
+
***************************************************************************************************
|
|
649
|
+
***************************************************************************************************/
|
|
650
|
+
|
|
651
|
+
assignment_expression: $ => prec.right(DART_PREC.Assignment, seq( //right
|
|
652
|
+
field('left', $.assignable_expression),
|
|
653
|
+
field('operator', $._assignment_operator),
|
|
654
|
+
field('right', $._expression)
|
|
655
|
+
)),
|
|
656
|
+
|
|
657
|
+
assignment_expression_without_cascade: $ => prec.right(DART_PREC.Assignment, seq( //right
|
|
658
|
+
field('left', $.assignable_expression),
|
|
659
|
+
field('operator', $._assignment_operator),
|
|
660
|
+
field('right', $._expression_without_cascade)
|
|
661
|
+
)),
|
|
662
|
+
|
|
663
|
+
assignable_expression: $ => choice(
|
|
664
|
+
seq($._primary, $._assignable_selector_part), // dart issue?
|
|
665
|
+
seq($.super, $.unconditional_assignable_selector),
|
|
666
|
+
seq($.constructor_invocation, $._assignable_selector_part),
|
|
667
|
+
$.identifier
|
|
668
|
+
),
|
|
669
|
+
_assignable_selector_part: $ => seq(
|
|
670
|
+
repeat($.selector),
|
|
671
|
+
$._assignable_selector
|
|
672
|
+
),
|
|
673
|
+
//'+=', '-=', '*=', '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>=', '??='
|
|
674
|
+
//todo: use the op names in place of these.
|
|
675
|
+
_assignment_operator: $ => choice(
|
|
676
|
+
'=',
|
|
677
|
+
// additive operator
|
|
678
|
+
'+=',
|
|
679
|
+
'-=',
|
|
680
|
+
// multiplicative operator
|
|
681
|
+
'*=',
|
|
682
|
+
'/=',
|
|
683
|
+
'%=',
|
|
684
|
+
'~/=',
|
|
685
|
+
// shift operator
|
|
686
|
+
'<<=',
|
|
687
|
+
'>>=',
|
|
688
|
+
'>>>=',
|
|
689
|
+
'&=',
|
|
690
|
+
'^=',
|
|
691
|
+
'|=',
|
|
692
|
+
'??=',
|
|
693
|
+
),
|
|
694
|
+
|
|
695
|
+
// binary_expression: $ => choice(
|
|
696
|
+
// ...[
|
|
697
|
+
// ['>', PREC.REL],
|
|
698
|
+
// ['<', PREC.REL],
|
|
699
|
+
// ['==', PREC.REL],
|
|
700
|
+
// ['>=', PREC.REL],
|
|
701
|
+
// ['<=', PREC.REL],
|
|
702
|
+
// ['!=', PREC.REL],
|
|
703
|
+
// ['&&', PREC.AND],
|
|
704
|
+
// ['||', PREC.OR],
|
|
705
|
+
// ['+', PREC.PLUS],
|
|
706
|
+
// ['-', PREC.PLUS],
|
|
707
|
+
// ['*', PREC.TIMES],
|
|
708
|
+
// ['/', PREC.TIMES],
|
|
709
|
+
// ['&', PREC.AND],
|
|
710
|
+
// ['|', PREC.OR],
|
|
711
|
+
// ['^', PREC.OR],
|
|
712
|
+
// ['%', PREC.TIMES],
|
|
713
|
+
// ['<<', PREC.TIMES],
|
|
714
|
+
// ['>>', PREC.TIMES],
|
|
715
|
+
// ['>>>', PREC.TIMES],
|
|
716
|
+
// ].map(([operator, precedence]) =>
|
|
717
|
+
// prec.left(precedence, seq(
|
|
718
|
+
// field('left', $._expression),
|
|
719
|
+
// field('operator', operator),
|
|
720
|
+
// field('right', $._expression)
|
|
721
|
+
// ))
|
|
722
|
+
// )),
|
|
723
|
+
|
|
724
|
+
// instanceof_expression: $ => prec(PREC.REL, seq(
|
|
725
|
+
// field('left', $._expression),
|
|
726
|
+
// 'instanceof',
|
|
727
|
+
// field('right', $._type)
|
|
728
|
+
// )),
|
|
729
|
+
|
|
730
|
+
lambda_expression: $ => seq(
|
|
731
|
+
field('parameters', $.function_signature),
|
|
732
|
+
field(
|
|
733
|
+
'body',
|
|
734
|
+
$.function_body
|
|
735
|
+
)
|
|
736
|
+
),
|
|
737
|
+
|
|
738
|
+
function_expression: $ => seq(
|
|
739
|
+
field('parameters', $._formal_parameter_part),
|
|
740
|
+
field(
|
|
741
|
+
'body',
|
|
742
|
+
$.function_expression_body
|
|
743
|
+
)
|
|
744
|
+
),
|
|
745
|
+
|
|
746
|
+
inferred_parameters: $ => seq(
|
|
747
|
+
'(',
|
|
748
|
+
commaSep1($.identifier),
|
|
749
|
+
')'
|
|
750
|
+
),
|
|
751
|
+
|
|
752
|
+
if_null_expression: $ => prec.left( //left
|
|
753
|
+
DART_PREC.If,
|
|
754
|
+
seq(
|
|
755
|
+
field('first',
|
|
756
|
+
$._real_expression // logical_or_expression
|
|
757
|
+
),
|
|
758
|
+
$._if_null_expression
|
|
759
|
+
// optional(
|
|
760
|
+
// $._if_null_expression
|
|
761
|
+
// )
|
|
762
|
+
)
|
|
763
|
+
),
|
|
764
|
+
|
|
765
|
+
_if_null_expression: $ => repeat1(
|
|
766
|
+
seq(
|
|
767
|
+
'??',
|
|
768
|
+
field('second', $._real_expression)
|
|
769
|
+
)
|
|
770
|
+
),
|
|
771
|
+
|
|
772
|
+
conditional_expression: $ => prec.left( //left
|
|
773
|
+
DART_PREC.Conditional,
|
|
774
|
+
seq(
|
|
775
|
+
// $.if_null_expression,
|
|
776
|
+
$._real_expression,
|
|
777
|
+
seq(
|
|
778
|
+
'?',
|
|
779
|
+
field('consequence', $._expression_without_cascade),
|
|
780
|
+
':',
|
|
781
|
+
field('alternative', $._expression_without_cascade)
|
|
782
|
+
)
|
|
783
|
+
)
|
|
784
|
+
),
|
|
785
|
+
|
|
786
|
+
logical_or_expression: $ => prec.left( //left
|
|
787
|
+
DART_PREC.Logical_OR,
|
|
788
|
+
sep2($._real_expression, $.logical_or_operator)
|
|
789
|
+
),
|
|
790
|
+
|
|
791
|
+
logical_and_expression: $ => prec.left( //left
|
|
792
|
+
DART_PREC.Logical_AND,
|
|
793
|
+
sep2($._real_expression, $.logical_and_operator)
|
|
794
|
+
),
|
|
795
|
+
|
|
796
|
+
equality_expression: $ => prec( //neither
|
|
797
|
+
DART_PREC.Equality,
|
|
798
|
+
choice(
|
|
799
|
+
seq(
|
|
800
|
+
// $.relational_expression,
|
|
801
|
+
$._real_expression,
|
|
802
|
+
// optional(
|
|
803
|
+
//
|
|
804
|
+
// )
|
|
805
|
+
|
|
806
|
+
$.equality_operator,
|
|
807
|
+
$._real_expression
|
|
808
|
+
// $.relational_expression
|
|
809
|
+
|
|
810
|
+
),
|
|
811
|
+
seq(
|
|
812
|
+
$.super,
|
|
813
|
+
$.equality_operator,
|
|
814
|
+
// $.relational_expression
|
|
815
|
+
$._real_expression
|
|
816
|
+
)
|
|
817
|
+
)
|
|
818
|
+
),
|
|
819
|
+
|
|
820
|
+
equality_operator: $ => token(
|
|
821
|
+
choice(
|
|
822
|
+
'==',
|
|
823
|
+
'!='
|
|
824
|
+
)
|
|
825
|
+
),
|
|
826
|
+
type_cast_expression: $ => prec.left(
|
|
827
|
+
DART_PREC.RelationalTypeCast,
|
|
828
|
+
seq(
|
|
829
|
+
// $._below_relational_type_cast_expression,
|
|
830
|
+
$._real_expression,
|
|
831
|
+
$.type_cast,
|
|
832
|
+
)
|
|
833
|
+
),
|
|
834
|
+
type_test_expression: $ => prec(
|
|
835
|
+
DART_PREC.RelationalTypeTest,
|
|
836
|
+
seq(
|
|
837
|
+
// $._below_relational_type_cast_expression,
|
|
838
|
+
$._real_expression,
|
|
839
|
+
$.type_test,
|
|
840
|
+
)
|
|
841
|
+
),
|
|
842
|
+
// _raw_type_cast: $ => prec.right(
|
|
843
|
+
// seq(
|
|
844
|
+
// $._below_relational_type_cast_expression,
|
|
845
|
+
// $.type_cast,
|
|
846
|
+
// )
|
|
847
|
+
// ),
|
|
848
|
+
|
|
849
|
+
relational_expression: $ => prec( // neither
|
|
850
|
+
DART_PREC.Relational,
|
|
851
|
+
choice(
|
|
852
|
+
// $._raw_type_cast,
|
|
853
|
+
seq(
|
|
854
|
+
// $.bitwise_or_expression,
|
|
855
|
+
// $._below_relational_type_cast_expression,
|
|
856
|
+
// TODO: The spec says optional but it breaks tests, and I'm not sure in a good way.
|
|
857
|
+
// Modified to account for type casts being compared relationally!
|
|
858
|
+
// I am not certain this is what designers intended. (see other comments on github)
|
|
859
|
+
// optional(
|
|
860
|
+
$._real_expression,
|
|
861
|
+
$.relational_operator,
|
|
862
|
+
$._real_expression
|
|
863
|
+
// choice(
|
|
864
|
+
// $.type_test,
|
|
865
|
+
// $.type_cast,
|
|
866
|
+
// seq(
|
|
867
|
+
// $.relational_operator,
|
|
868
|
+
// $._real_expression
|
|
869
|
+
// )
|
|
870
|
+
// )
|
|
871
|
+
// ),
|
|
872
|
+
),
|
|
873
|
+
// seq(
|
|
874
|
+
// // $.bitwise_or_expression,
|
|
875
|
+
// choice(
|
|
876
|
+
// $._raw_type_cast,
|
|
877
|
+
// $._below_relational_type_cast_expression
|
|
878
|
+
// ),
|
|
879
|
+
// $.relational_operator,
|
|
880
|
+
// choice(
|
|
881
|
+
// $._raw_type_cast,
|
|
882
|
+
// $._below_relational_type_cast_expression
|
|
883
|
+
// )
|
|
884
|
+
// ),
|
|
885
|
+
seq(
|
|
886
|
+
$.super,
|
|
887
|
+
$.relational_operator,
|
|
888
|
+
$._real_expression
|
|
889
|
+
),
|
|
890
|
+
)
|
|
891
|
+
),
|
|
892
|
+
|
|
893
|
+
relational_operator: $ => choice(
|
|
894
|
+
'<',
|
|
895
|
+
'>',
|
|
896
|
+
'<=',
|
|
897
|
+
'>='
|
|
898
|
+
),
|
|
899
|
+
|
|
900
|
+
//BITWISE EXPRESSIONS
|
|
901
|
+
bitwise_or_expression: $ => binaryRunLeft($._real_expression, '|', $.super, DART_PREC.Bitwise_Or),
|
|
902
|
+
bitwise_xor_expression: $ => binaryRunLeft($._real_expression, '^', $.super, DART_PREC.Bitwise_XOR),
|
|
903
|
+
bitwise_and_expression: $ => binaryRunLeft($._real_expression, '&', $.super, DART_PREC.Bitwise_AND),
|
|
904
|
+
shift_expression: $ => binaryRunLeft($._real_expression, $.shift_operator, $.super, DART_PREC.Shift),
|
|
905
|
+
additive_expression: $ => binaryRunLeft($._real_expression, $.additive_operator, $.super, DART_PREC.Additive),
|
|
906
|
+
multiplicative_expression: $ => binaryRunLeft($._unary_expression, $.multiplicative_operator, $.super, DART_PREC.Multiplicative),
|
|
907
|
+
bitwise_operator: $ => $._bitwise_operator,
|
|
908
|
+
_bitwise_operator: $ => choice(
|
|
909
|
+
'&',
|
|
910
|
+
'^',
|
|
911
|
+
'|'
|
|
912
|
+
),
|
|
913
|
+
shift_operator: $ => $._shift_operator,
|
|
914
|
+
_shift_operator: $ => choice(
|
|
915
|
+
'<<',
|
|
916
|
+
'>>',
|
|
917
|
+
'>>>'
|
|
918
|
+
),
|
|
919
|
+
additive_operator: $ => $._additive_operator,
|
|
920
|
+
_additive_operator: $ => token(
|
|
921
|
+
choice(
|
|
922
|
+
'+',
|
|
923
|
+
'-'
|
|
924
|
+
)
|
|
925
|
+
),
|
|
926
|
+
multiplicative_operator: $ => $._multiplicative_operator,
|
|
927
|
+
_multiplicative_operator: $ => choice(
|
|
928
|
+
'*',
|
|
929
|
+
'/',
|
|
930
|
+
'%',
|
|
931
|
+
'~/'
|
|
932
|
+
),
|
|
933
|
+
|
|
934
|
+
_unary_expression: $ => prec(
|
|
935
|
+
DART_PREC.UNARY_PREFIX,
|
|
936
|
+
choice(
|
|
937
|
+
$._postfix_expression,
|
|
938
|
+
$.unary_expression,
|
|
939
|
+
)
|
|
940
|
+
),
|
|
941
|
+
|
|
942
|
+
unary_expression: $ => prec( //neither
|
|
943
|
+
DART_PREC.UNARY_PREFIX,
|
|
944
|
+
choice(
|
|
945
|
+
|
|
946
|
+
seq($.prefix_operator, $._unary_expression),
|
|
947
|
+
$.await_expression,
|
|
948
|
+
// prec(DART_PREC.UNARY_POSTFIX, $._postfix_expression),
|
|
949
|
+
seq(
|
|
950
|
+
choice(
|
|
951
|
+
$.minus_operator,
|
|
952
|
+
$.tilde_operator
|
|
953
|
+
),
|
|
954
|
+
$.super
|
|
955
|
+
),
|
|
956
|
+
seq(
|
|
957
|
+
$.increment_operator,
|
|
958
|
+
$.assignable_expression
|
|
959
|
+
)
|
|
960
|
+
)
|
|
961
|
+
),
|
|
962
|
+
|
|
963
|
+
_postfix_expression: $ => choice(
|
|
964
|
+
seq(
|
|
965
|
+
$._primary,
|
|
966
|
+
repeat(
|
|
967
|
+
$.selector
|
|
968
|
+
)
|
|
969
|
+
),
|
|
970
|
+
$.postfix_expression
|
|
971
|
+
),
|
|
972
|
+
|
|
973
|
+
postfix_expression: $ => prec.right(choice(
|
|
974
|
+
seq(
|
|
975
|
+
$.assignable_expression,
|
|
976
|
+
$.postfix_operator
|
|
977
|
+
),
|
|
978
|
+
seq(
|
|
979
|
+
$.constructor_invocation,
|
|
980
|
+
repeat(
|
|
981
|
+
$.selector
|
|
982
|
+
)
|
|
983
|
+
)
|
|
984
|
+
)),
|
|
985
|
+
|
|
986
|
+
postfix_operator: $ => $.increment_operator,
|
|
987
|
+
|
|
988
|
+
increment_operator: $ => token(choice(
|
|
989
|
+
'++',
|
|
990
|
+
'--'
|
|
991
|
+
)),
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
spread_element: $ => seq(
|
|
995
|
+
'...',
|
|
996
|
+
optional('?'),
|
|
997
|
+
$._expression
|
|
998
|
+
),
|
|
999
|
+
|
|
1000
|
+
selector: $ => prec.right(choice(
|
|
1001
|
+
// '!',
|
|
1002
|
+
$._exclamation_operator,
|
|
1003
|
+
$._assignable_selector,
|
|
1004
|
+
$.argument_part,
|
|
1005
|
+
$.type_arguments,
|
|
1006
|
+
)),
|
|
1007
|
+
|
|
1008
|
+
prefix_operator: $ => choice(
|
|
1009
|
+
$.minus_operator,
|
|
1010
|
+
$.negation_operator,
|
|
1011
|
+
$.tilde_operator
|
|
1012
|
+
),
|
|
1013
|
+
|
|
1014
|
+
minus_operator: $ => '-',
|
|
1015
|
+
negation_operator: $ => $._exclamation_operator,
|
|
1016
|
+
_exclamation_operator: $ => '!',
|
|
1017
|
+
tilde_operator: $ => '~',
|
|
1018
|
+
|
|
1019
|
+
await_expression: $ => seq(
|
|
1020
|
+
'await',
|
|
1021
|
+
$._unary_expression
|
|
1022
|
+
),
|
|
1023
|
+
|
|
1024
|
+
type_test: $ => seq(
|
|
1025
|
+
$.is_operator,
|
|
1026
|
+
$._type_not_void
|
|
1027
|
+
),
|
|
1028
|
+
|
|
1029
|
+
is_operator: $ => seq(
|
|
1030
|
+
token('is'),
|
|
1031
|
+
optional(
|
|
1032
|
+
$._exclamation_operator
|
|
1033
|
+
)
|
|
1034
|
+
),
|
|
1035
|
+
|
|
1036
|
+
type_cast: $ => seq(
|
|
1037
|
+
$.as_operator,
|
|
1038
|
+
$._type_not_void
|
|
1039
|
+
),
|
|
1040
|
+
|
|
1041
|
+
as_operator: $ => token('as'),
|
|
1042
|
+
|
|
1043
|
+
new_expression: $ => seq(
|
|
1044
|
+
$._new_builtin,
|
|
1045
|
+
$._type_not_void,
|
|
1046
|
+
optional(
|
|
1047
|
+
$._dot_identifier
|
|
1048
|
+
),
|
|
1049
|
+
$.arguments
|
|
1050
|
+
),
|
|
1051
|
+
|
|
1052
|
+
_dot_identifier: $ => prec.dynamic(
|
|
1053
|
+
DART_PREC.DOT_IDENTIFIER,
|
|
1054
|
+
seq(
|
|
1055
|
+
'.',
|
|
1056
|
+
$.identifier
|
|
1057
|
+
)
|
|
1058
|
+
),
|
|
1059
|
+
const_object_expression: $ => seq(
|
|
1060
|
+
$.const_builtin,
|
|
1061
|
+
$._type_not_void,
|
|
1062
|
+
optional(
|
|
1063
|
+
$._dot_identifier
|
|
1064
|
+
),
|
|
1065
|
+
$.arguments
|
|
1066
|
+
),
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
_primary: $ => choice(
|
|
1070
|
+
$._literal,
|
|
1071
|
+
$.identifier,
|
|
1072
|
+
$.function_expression,
|
|
1073
|
+
$.new_expression,
|
|
1074
|
+
$.const_object_expression,
|
|
1075
|
+
$.parenthesized_expression,
|
|
1076
|
+
// $.class_literal,
|
|
1077
|
+
$.this,
|
|
1078
|
+
seq(
|
|
1079
|
+
$.super,
|
|
1080
|
+
$.unconditional_assignable_selector
|
|
1081
|
+
),
|
|
1082
|
+
$.constructor_tearoff,
|
|
1083
|
+
$.switch_expression,
|
|
1084
|
+
// $.object_creation_expression,
|
|
1085
|
+
// $.field_access,
|
|
1086
|
+
// $.array_access,
|
|
1087
|
+
// $.method_invocation,
|
|
1088
|
+
// $.method_reference,
|
|
1089
|
+
),
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
parenthesized_expression: $ => seq('(', $._expression, ')'),
|
|
1093
|
+
|
|
1094
|
+
_compound_access: $ => choice('.', '?.'),
|
|
1095
|
+
|
|
1096
|
+
constructor_invocation: $ => prec.right(choice(
|
|
1097
|
+
seq($._type_name, $.type_arguments, '.', $.identifier, $.arguments),
|
|
1098
|
+
seq($._type_name, '.', $._new_builtin, $.arguments),
|
|
1099
|
+
)),
|
|
1100
|
+
|
|
1101
|
+
constructor_tearoff: $ => prec.right(seq(
|
|
1102
|
+
$._type_name, optional($.type_arguments), '.', $._new_builtin,
|
|
1103
|
+
)),
|
|
1104
|
+
|
|
1105
|
+
arguments: $ => seq('(', optional($._argument_list), ')'),
|
|
1106
|
+
|
|
1107
|
+
_argument_list: $ => prec.right(commaSep1TrailingComma($._any_argument)),
|
|
1108
|
+
|
|
1109
|
+
_any_argument: $ => choice($.argument, $.named_argument),
|
|
1110
|
+
|
|
1111
|
+
argument: $ => $._expression,
|
|
1112
|
+
|
|
1113
|
+
named_argument: $ => seq($.label, $._expression),
|
|
1114
|
+
|
|
1115
|
+
cascade_section: $ => prec.left(
|
|
1116
|
+
DART_PREC.Cascade,
|
|
1117
|
+
seq(
|
|
1118
|
+
choice('..', '?..'),
|
|
1119
|
+
$.cascade_selector,
|
|
1120
|
+
repeat($.argument_part),
|
|
1121
|
+
repeat(
|
|
1122
|
+
$._cascade_subsection
|
|
1123
|
+
),
|
|
1124
|
+
optional(
|
|
1125
|
+
$._cascade_assignment_section
|
|
1126
|
+
)
|
|
1127
|
+
)
|
|
1128
|
+
),
|
|
1129
|
+
|
|
1130
|
+
// prec.left(
|
|
1131
|
+
// DART_PREC.Cascade,
|
|
1132
|
+
// ),
|
|
1133
|
+
_cascade_subsection: $ => seq(
|
|
1134
|
+
$._assignable_selector,
|
|
1135
|
+
repeat($.argument_part)
|
|
1136
|
+
),
|
|
1137
|
+
_cascade_assignment_section: $ => seq(
|
|
1138
|
+
$._assignment_operator,
|
|
1139
|
+
$._expression_without_cascade
|
|
1140
|
+
),
|
|
1141
|
+
index_selector: $ => seq('[', $._expression, ']'),
|
|
1142
|
+
cascade_selector: $ => choice(
|
|
1143
|
+
seq(
|
|
1144
|
+
optional($.nullable_selector),
|
|
1145
|
+
$.index_selector,
|
|
1146
|
+
),
|
|
1147
|
+
$.identifier
|
|
1148
|
+
),
|
|
1149
|
+
argument_part: $ => seq(
|
|
1150
|
+
optional(
|
|
1151
|
+
$.type_arguments
|
|
1152
|
+
),
|
|
1153
|
+
// seq(
|
|
1154
|
+
// $.type_arguments,
|
|
1155
|
+
// $.arguments
|
|
1156
|
+
// ),
|
|
1157
|
+
$.arguments
|
|
1158
|
+
),
|
|
1159
|
+
|
|
1160
|
+
unconditional_assignable_selector: $ => choice(
|
|
1161
|
+
$.index_selector,
|
|
1162
|
+
seq('.', $.identifier)
|
|
1163
|
+
),
|
|
1164
|
+
|
|
1165
|
+
conditional_assignable_selector: $ => choice(
|
|
1166
|
+
seq('?.', $.identifier),
|
|
1167
|
+
seq('?', $.index_selector)
|
|
1168
|
+
),
|
|
1169
|
+
|
|
1170
|
+
_assignable_selector: $ => choice(
|
|
1171
|
+
$.unconditional_assignable_selector,
|
|
1172
|
+
$.conditional_assignable_selector
|
|
1173
|
+
),
|
|
1174
|
+
|
|
1175
|
+
type_arguments: $ => choice( // was prec.right
|
|
1176
|
+
// seq(
|
|
1177
|
+
// '<',
|
|
1178
|
+
// '>',
|
|
1179
|
+
// optional($.nullable_type)
|
|
1180
|
+
// ),
|
|
1181
|
+
seq(
|
|
1182
|
+
'<',
|
|
1183
|
+
commaSep($._type),
|
|
1184
|
+
'>',
|
|
1185
|
+
// optional($.nullable_type)
|
|
1186
|
+
)
|
|
1187
|
+
),
|
|
1188
|
+
|
|
1189
|
+
wildcard: $ => seq(
|
|
1190
|
+
optional($._metadata),
|
|
1191
|
+
'?',
|
|
1192
|
+
optional($._wildcard_bounds)
|
|
1193
|
+
),
|
|
1194
|
+
|
|
1195
|
+
_wildcard_bounds: $ => choice(
|
|
1196
|
+
seq('extends', $._type),
|
|
1197
|
+
seq($.super, $._type)
|
|
1198
|
+
),
|
|
1199
|
+
|
|
1200
|
+
dimensions: $ => prec.right(repeat1(
|
|
1201
|
+
seq(optional($._metadata), '[', ']')
|
|
1202
|
+
)),
|
|
1203
|
+
|
|
1204
|
+
// Statements
|
|
1205
|
+
_statement: $ => choice(
|
|
1206
|
+
$.block,
|
|
1207
|
+
prec.dynamic(1, $.local_function_declaration),
|
|
1208
|
+
prec.dynamic(2, $.local_variable_declaration),
|
|
1209
|
+
$.for_statement,
|
|
1210
|
+
$.while_statement,
|
|
1211
|
+
$.do_statement,
|
|
1212
|
+
$.switch_statement,
|
|
1213
|
+
$.if_statement,
|
|
1214
|
+
//TODO: add rethrow statement.
|
|
1215
|
+
// $._declaration,
|
|
1216
|
+
|
|
1217
|
+
$.try_statement,
|
|
1218
|
+
$.break_statement,
|
|
1219
|
+
$.continue_statement,
|
|
1220
|
+
$.return_statement,
|
|
1221
|
+
$.yield_statement,
|
|
1222
|
+
$.yield_each_statement,
|
|
1223
|
+
$.expression_statement,
|
|
1224
|
+
$.assert_statement,
|
|
1225
|
+
// $.labeled_statement,
|
|
1226
|
+
),
|
|
1227
|
+
|
|
1228
|
+
local_function_declaration: $ => seq(
|
|
1229
|
+
optional($._metadata),
|
|
1230
|
+
$.lambda_expression
|
|
1231
|
+
),
|
|
1232
|
+
|
|
1233
|
+
block: $ => seq(
|
|
1234
|
+
'{', repeat($._statement), '}'
|
|
1235
|
+
),
|
|
1236
|
+
|
|
1237
|
+
expression_statement: $ => seq(
|
|
1238
|
+
$._expression,
|
|
1239
|
+
$._semicolon
|
|
1240
|
+
),
|
|
1241
|
+
|
|
1242
|
+
labeled_statement: $ => seq(
|
|
1243
|
+
$.identifier, ':', $._statement
|
|
1244
|
+
),
|
|
1245
|
+
|
|
1246
|
+
assert_statement: $ => seq($.assertion, ';'),
|
|
1247
|
+
|
|
1248
|
+
assertion: $ => seq(
|
|
1249
|
+
$.assert_builtin,
|
|
1250
|
+
$.assertion_arguments,
|
|
1251
|
+
),
|
|
1252
|
+
|
|
1253
|
+
assertion_arguments: $ => seq(
|
|
1254
|
+
'(',
|
|
1255
|
+
$._expression,
|
|
1256
|
+
optional(
|
|
1257
|
+
seq(
|
|
1258
|
+
',',
|
|
1259
|
+
$._expression
|
|
1260
|
+
),
|
|
1261
|
+
),
|
|
1262
|
+
optional(','),
|
|
1263
|
+
')',
|
|
1264
|
+
),
|
|
1265
|
+
|
|
1266
|
+
switch_statement: $ => seq(
|
|
1267
|
+
'switch',
|
|
1268
|
+
field('condition', $.parenthesized_expression),
|
|
1269
|
+
field('body', $.switch_block)
|
|
1270
|
+
),
|
|
1271
|
+
|
|
1272
|
+
switch_expression: $ => seq(
|
|
1273
|
+
'switch',
|
|
1274
|
+
field('condition', $.parenthesized_expression),
|
|
1275
|
+
field('body',
|
|
1276
|
+
seq('{',
|
|
1277
|
+
commaSep1TrailingComma($.switch_expression_case),
|
|
1278
|
+
'}'
|
|
1279
|
+
))
|
|
1280
|
+
),
|
|
1281
|
+
|
|
1282
|
+
switch_expression_case: $ => seq($._guarded_pattern, '=>', $._expression),
|
|
1283
|
+
|
|
1284
|
+
_guarded_pattern: $ => seq(
|
|
1285
|
+
$._pattern, optional(seq('when', $._expression))
|
|
1286
|
+
),
|
|
1287
|
+
|
|
1288
|
+
_pattern: $ => choice(
|
|
1289
|
+
$._logical_or_pattern,
|
|
1290
|
+
),
|
|
1291
|
+
|
|
1292
|
+
_logical_or_pattern: $ => seq($._logical_and_pattern, repeat(seq($.logical_or_operator, $._logical_and_pattern))),
|
|
1293
|
+
_logical_and_pattern: $ => seq($._relational_pattern, repeat(seq($.logical_and_operator, $._relational_pattern))),
|
|
1294
|
+
_relational_pattern: $ =>
|
|
1295
|
+
prec(DART_PREC.Relational, choice(
|
|
1296
|
+
seq(choice($.relational_operator, $.equality_operator), $._real_expression),
|
|
1297
|
+
$._unary_pattern,
|
|
1298
|
+
)
|
|
1299
|
+
),
|
|
1300
|
+
|
|
1301
|
+
_unary_pattern: $ => choice(
|
|
1302
|
+
$.cast_pattern,
|
|
1303
|
+
$.null_check_pattern,
|
|
1304
|
+
$.null_assert_pattern,
|
|
1305
|
+
$._primary_pattern,
|
|
1306
|
+
),
|
|
1307
|
+
|
|
1308
|
+
_primary_pattern: $ => choice(
|
|
1309
|
+
$.constant_pattern,
|
|
1310
|
+
$.variable_pattern,
|
|
1311
|
+
$._parenthesized_pattern,
|
|
1312
|
+
$.list_pattern,
|
|
1313
|
+
$.map_pattern,
|
|
1314
|
+
$.record_pattern,
|
|
1315
|
+
$.object_pattern,
|
|
1316
|
+
),
|
|
1317
|
+
|
|
1318
|
+
cast_pattern: $ => seq($._primary_pattern, 'as', $._type),
|
|
1319
|
+
|
|
1320
|
+
null_check_pattern: $ => seq($._primary_pattern, '?'),
|
|
1321
|
+
|
|
1322
|
+
null_assert_pattern: $ => seq($._primary_pattern, '!'),
|
|
1323
|
+
|
|
1324
|
+
constant_pattern: $ => choice(
|
|
1325
|
+
$._bool_literal,
|
|
1326
|
+
$.null_literal,
|
|
1327
|
+
seq(optional($.minus_operator), $._numeric_literal),
|
|
1328
|
+
$.string_literal,
|
|
1329
|
+
$.symbol_literal,
|
|
1330
|
+
$.identifier,
|
|
1331
|
+
$.qualified,
|
|
1332
|
+
$.const_object_expression,
|
|
1333
|
+
seq($.const_builtin, optional($.type_arguments), '[', commaSep1TrailingComma($._element), ']'),
|
|
1334
|
+
seq($.const_builtin, optional($.type_arguments), '{', commaSep1TrailingComma($._element), '}'),
|
|
1335
|
+
seq($.const_builtin, '(', $._expression, ')'),
|
|
1336
|
+
),
|
|
1337
|
+
|
|
1338
|
+
variable_pattern: $ => seq($._final_var_or_type, $.identifier),
|
|
1339
|
+
|
|
1340
|
+
_parenthesized_pattern: $ => seq('(', $._pattern, ')'),
|
|
1341
|
+
|
|
1342
|
+
list_pattern: $ => seq(optional($.type_arguments), '[', commaSepTrailingComma($._list_pattern_element), ']'),
|
|
1343
|
+
|
|
1344
|
+
_list_pattern_element: $ => choice($._pattern, $.rest_pattern),
|
|
1345
|
+
|
|
1346
|
+
rest_pattern: $ => seq('...', optional($._pattern)),
|
|
1347
|
+
|
|
1348
|
+
map_pattern: $ => seq(optional($.type_arguments), '{', commaSepTrailingComma($._map_pattern_entry), '}'),
|
|
1349
|
+
|
|
1350
|
+
_map_pattern_entry: $ => choice(seq($._expression, ':', $._pattern), '...'),
|
|
1351
|
+
|
|
1352
|
+
record_pattern: $ => seq('(', commaSep1TrailingComma($._pattern_field), ')'),
|
|
1353
|
+
|
|
1354
|
+
_pattern_field: $ => seq(optional(seq(optional($.identifier), ':')), $._pattern),
|
|
1355
|
+
|
|
1356
|
+
object_pattern: $ => seq($._type_name, optional($.type_arguments), '(', commaSep1TrailingComma($._pattern_field), ')'),
|
|
1357
|
+
|
|
1358
|
+
pattern_variable_declaration: $ => seq(choice($.final_builtin, $.inferred_type), $._outer_pattern, '=', $._expression),
|
|
1359
|
+
|
|
1360
|
+
_outer_pattern: $ => choice($._parenthesized_pattern, $.list_pattern, $.map_pattern, $.record_pattern, $.object_pattern),
|
|
1361
|
+
|
|
1362
|
+
pattern_assignment: $ => seq($._outer_pattern, '=', $._expression),
|
|
1363
|
+
|
|
1364
|
+
switch_block: $ => seq(
|
|
1365
|
+
'{',
|
|
1366
|
+
repeat($.switch_statement_case),
|
|
1367
|
+
optional($.switch_statement_default),
|
|
1368
|
+
'}'
|
|
1369
|
+
),
|
|
1370
|
+
|
|
1371
|
+
switch_statement_case: $ => seq(
|
|
1372
|
+
repeat($.label), $.case_builtin, $._guarded_pattern, ':', repeat($._statement),
|
|
1373
|
+
),
|
|
1374
|
+
|
|
1375
|
+
switch_statement_default: $ => seq(
|
|
1376
|
+
repeat($.label), 'default', ':', repeat($._statement),
|
|
1377
|
+
),
|
|
1378
|
+
|
|
1379
|
+
switch_case: $ => choice(
|
|
1380
|
+
seq(repeat($.label), $.case_builtin, $._guarded_pattern, ':', repeat1($._statement)),
|
|
1381
|
+
),
|
|
1382
|
+
|
|
1383
|
+
default_case: $ => choice(
|
|
1384
|
+
seq(repeat($.label), 'default', ':', repeat1($._statement)),
|
|
1385
|
+
),
|
|
1386
|
+
|
|
1387
|
+
switch_label: $ => seq(
|
|
1388
|
+
repeat($.label),
|
|
1389
|
+
choice(
|
|
1390
|
+
seq($.case_builtin, $._expression, ':'),
|
|
1391
|
+
seq('default', ':')
|
|
1392
|
+
)),
|
|
1393
|
+
|
|
1394
|
+
do_statement: $ => seq(
|
|
1395
|
+
'do',
|
|
1396
|
+
field('body', $._statement),
|
|
1397
|
+
'while',
|
|
1398
|
+
field('condition', $.parenthesized_expression),
|
|
1399
|
+
$._semicolon
|
|
1400
|
+
),
|
|
1401
|
+
|
|
1402
|
+
break_statement: $ => seq($.break_builtin, optional($.identifier), $._semicolon),
|
|
1403
|
+
|
|
1404
|
+
continue_statement: $ => seq('continue', optional($.identifier), $._semicolon),
|
|
1405
|
+
|
|
1406
|
+
yield_statement: $ => seq('yield', $._expression, $._semicolon),
|
|
1407
|
+
|
|
1408
|
+
yield_each_statement: $ => seq('yield', '*', $._expression, $._semicolon),
|
|
1409
|
+
|
|
1410
|
+
return_statement: $ => seq(
|
|
1411
|
+
'return',
|
|
1412
|
+
optional($._expression),
|
|
1413
|
+
$._semicolon
|
|
1414
|
+
),
|
|
1415
|
+
|
|
1416
|
+
throw_statement: $ => seq('throw', $._expression, $._semicolon),
|
|
1417
|
+
|
|
1418
|
+
try_statement: $ => seq(
|
|
1419
|
+
$._try_head,
|
|
1420
|
+
optional(choice(
|
|
1421
|
+
$.finally_clause,
|
|
1422
|
+
seq(repeat1($._on_part), optional($.finally_clause))
|
|
1423
|
+
))
|
|
1424
|
+
),
|
|
1425
|
+
_on_part: $ => choice(
|
|
1426
|
+
seq(
|
|
1427
|
+
$.catch_clause,
|
|
1428
|
+
$.block
|
|
1429
|
+
),
|
|
1430
|
+
seq(
|
|
1431
|
+
'on',
|
|
1432
|
+
$._type_not_void,
|
|
1433
|
+
optional($.catch_clause),
|
|
1434
|
+
$.block
|
|
1435
|
+
)
|
|
1436
|
+
),
|
|
1437
|
+
_try_head: $ => seq(
|
|
1438
|
+
'try',
|
|
1439
|
+
field('body', $.block),
|
|
1440
|
+
),
|
|
1441
|
+
catch_clause: $ => seq(
|
|
1442
|
+
'catch',
|
|
1443
|
+
$.catch_parameters,
|
|
1444
|
+
// field('body', $.block)
|
|
1445
|
+
),
|
|
1446
|
+
|
|
1447
|
+
catch_parameters: $ => seq(
|
|
1448
|
+
'(',
|
|
1449
|
+
$.identifier,
|
|
1450
|
+
optional(
|
|
1451
|
+
seq(
|
|
1452
|
+
',',
|
|
1453
|
+
$.identifier
|
|
1454
|
+
),
|
|
1455
|
+
),
|
|
1456
|
+
')',
|
|
1457
|
+
),
|
|
1458
|
+
|
|
1459
|
+
catch_type: $ => sep1($._type, '|'),
|
|
1460
|
+
|
|
1461
|
+
finally_clause: $ => seq('finally', $.block),
|
|
1462
|
+
|
|
1463
|
+
if_element: $ => prec.right(seq(
|
|
1464
|
+
'if',
|
|
1465
|
+
'(', $._expression, optional(seq('case', $._guarded_pattern)) , ')',
|
|
1466
|
+
field('consequence', $._element),
|
|
1467
|
+
optional(seq('else', field('alternative', $._element)))
|
|
1468
|
+
)),
|
|
1469
|
+
|
|
1470
|
+
if_statement: $ => prec.right(seq(
|
|
1471
|
+
'if',
|
|
1472
|
+
'(', $._expression, optional(seq('case', $._guarded_pattern)) , ')',
|
|
1473
|
+
field('consequence', $._statement),
|
|
1474
|
+
optional(seq('else', field('alternative', $._statement)))
|
|
1475
|
+
)),
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
while_statement: $ => seq(
|
|
1479
|
+
'while',
|
|
1480
|
+
field('condition', $.parenthesized_expression),
|
|
1481
|
+
field('body', $._statement)
|
|
1482
|
+
),
|
|
1483
|
+
|
|
1484
|
+
for_statement: $ => seq(
|
|
1485
|
+
optional('await'),
|
|
1486
|
+
'for',
|
|
1487
|
+
$.for_loop_parts,
|
|
1488
|
+
field('body', $._statement)
|
|
1489
|
+
),
|
|
1490
|
+
|
|
1491
|
+
for_loop_parts: $ => seq('(', $._for_loop_parts, ')'),
|
|
1492
|
+
|
|
1493
|
+
_for_loop_parts: $ => choice(
|
|
1494
|
+
seq(
|
|
1495
|
+
choice(
|
|
1496
|
+
$._declared_identifier,
|
|
1497
|
+
$.identifier
|
|
1498
|
+
),
|
|
1499
|
+
'in',
|
|
1500
|
+
field('value', $._expression),
|
|
1501
|
+
),
|
|
1502
|
+
seq(
|
|
1503
|
+
optional(choice(
|
|
1504
|
+
field('init', $.local_variable_declaration),
|
|
1505
|
+
seq(
|
|
1506
|
+
commaSep(field('init', $._expression)),
|
|
1507
|
+
$._semicolon
|
|
1508
|
+
)
|
|
1509
|
+
),),
|
|
1510
|
+
field('condition', optional($._expression)), $._semicolon,
|
|
1511
|
+
commaSep(field('update', $._expression)),
|
|
1512
|
+
),
|
|
1513
|
+
seq(
|
|
1514
|
+
choice($.final_builtin, $.inferred_type),
|
|
1515
|
+
$._outer_pattern,
|
|
1516
|
+
'in',
|
|
1517
|
+
field('value', $._expression)
|
|
1518
|
+
)
|
|
1519
|
+
),
|
|
1520
|
+
|
|
1521
|
+
// support map weirdness?
|
|
1522
|
+
for_element: $ => seq(
|
|
1523
|
+
optional('await'),
|
|
1524
|
+
'for',
|
|
1525
|
+
$.for_loop_parts,
|
|
1526
|
+
field('body', $._element)
|
|
1527
|
+
),
|
|
1528
|
+
|
|
1529
|
+
// Annotations
|
|
1530
|
+
annotation: $ => prec.right(seq(
|
|
1531
|
+
'@',
|
|
1532
|
+
field('name', choice($.identifier, $.scoped_identifier)),
|
|
1533
|
+
choice(
|
|
1534
|
+
optional(seq($.type_arguments, $.arguments)),
|
|
1535
|
+
optional($.arguments)
|
|
1536
|
+
)
|
|
1537
|
+
)),
|
|
1538
|
+
|
|
1539
|
+
// Declarations
|
|
1540
|
+
|
|
1541
|
+
_declaration: $ => prec(1, choice(
|
|
1542
|
+
$.import_specification,
|
|
1543
|
+
$.class_definition,
|
|
1544
|
+
// $.annotation_type_declaration,
|
|
1545
|
+
$.enum_declaration,
|
|
1546
|
+
)),
|
|
1547
|
+
|
|
1548
|
+
import_or_export: $ => prec(
|
|
1549
|
+
DART_PREC.IMPORT_EXPORT,
|
|
1550
|
+
choice(
|
|
1551
|
+
$.library_import,
|
|
1552
|
+
$.library_export
|
|
1553
|
+
)
|
|
1554
|
+
),
|
|
1555
|
+
|
|
1556
|
+
library_import: $ => seq(
|
|
1557
|
+
optional($._metadata),
|
|
1558
|
+
$.import_specification
|
|
1559
|
+
),
|
|
1560
|
+
|
|
1561
|
+
library_export: $ => seq(
|
|
1562
|
+
optional($._metadata),
|
|
1563
|
+
$._export,
|
|
1564
|
+
$.configurable_uri,
|
|
1565
|
+
repeat($.combinator),
|
|
1566
|
+
$._semicolon
|
|
1567
|
+
),
|
|
1568
|
+
|
|
1569
|
+
import_specification: $ => choice(
|
|
1570
|
+
seq(
|
|
1571
|
+
$._import,
|
|
1572
|
+
$.configurable_uri,
|
|
1573
|
+
optional(
|
|
1574
|
+
seq(
|
|
1575
|
+
$._as,
|
|
1576
|
+
$.identifier
|
|
1577
|
+
)
|
|
1578
|
+
),
|
|
1579
|
+
repeat($.combinator),
|
|
1580
|
+
$._semicolon
|
|
1581
|
+
),
|
|
1582
|
+
seq(
|
|
1583
|
+
$._import,
|
|
1584
|
+
$.uri,
|
|
1585
|
+
$._deferred,
|
|
1586
|
+
$._as,
|
|
1587
|
+
$.identifier,
|
|
1588
|
+
repeat($.combinator),
|
|
1589
|
+
$._semicolon
|
|
1590
|
+
)
|
|
1591
|
+
),
|
|
1592
|
+
|
|
1593
|
+
part_directive: $ => seq(
|
|
1594
|
+
optional($._metadata),
|
|
1595
|
+
'part',
|
|
1596
|
+
$.uri,
|
|
1597
|
+
$._semicolon
|
|
1598
|
+
),
|
|
1599
|
+
|
|
1600
|
+
part_of_directive: $ => seq(
|
|
1601
|
+
optional($._metadata),
|
|
1602
|
+
$.part_of_builtin,
|
|
1603
|
+
choice($.dotted_identifier_list, $.uri),
|
|
1604
|
+
$._semicolon
|
|
1605
|
+
),
|
|
1606
|
+
|
|
1607
|
+
uri: $ => $.string_literal,
|
|
1608
|
+
|
|
1609
|
+
configurable_uri: $ => seq(
|
|
1610
|
+
$.uri,
|
|
1611
|
+
repeat($.configuration_uri)
|
|
1612
|
+
),
|
|
1613
|
+
|
|
1614
|
+
configuration_uri: $ => seq(
|
|
1615
|
+
'if',
|
|
1616
|
+
$.configuration_uri_condition,
|
|
1617
|
+
$.uri
|
|
1618
|
+
),
|
|
1619
|
+
|
|
1620
|
+
configuration_uri_condition: $ => seq('(', $.uri_test, ')'),
|
|
1621
|
+
|
|
1622
|
+
uri_test: $ => seq(
|
|
1623
|
+
$.dotted_identifier_list,
|
|
1624
|
+
optional(
|
|
1625
|
+
seq(
|
|
1626
|
+
'==',
|
|
1627
|
+
$.string_literal
|
|
1628
|
+
)
|
|
1629
|
+
)
|
|
1630
|
+
),
|
|
1631
|
+
|
|
1632
|
+
combinator: $ => choice(
|
|
1633
|
+
seq('show', $._identifier_list),
|
|
1634
|
+
seq('hide', $._identifier_list)
|
|
1635
|
+
),
|
|
1636
|
+
|
|
1637
|
+
_identifier_list: $ => commaSep1($.identifier),
|
|
1638
|
+
|
|
1639
|
+
asterisk: $ => '*',
|
|
1640
|
+
|
|
1641
|
+
enum_declaration: $ => seq(
|
|
1642
|
+
optional($._metadata),
|
|
1643
|
+
'enum',
|
|
1644
|
+
field('name', $.identifier),
|
|
1645
|
+
optional($.type_parameters),
|
|
1646
|
+
optional($.mixins),
|
|
1647
|
+
optional($.interfaces),
|
|
1648
|
+
field('body', $.enum_body),
|
|
1649
|
+
),
|
|
1650
|
+
|
|
1651
|
+
enum_body: $ => seq(
|
|
1652
|
+
'{',
|
|
1653
|
+
commaSep1TrailingComma($.enum_constant),
|
|
1654
|
+
optional(
|
|
1655
|
+
seq(';', repeat(seq(optional($._metadata), $._class_member_definition)))
|
|
1656
|
+
),
|
|
1657
|
+
'}'
|
|
1658
|
+
),
|
|
1659
|
+
|
|
1660
|
+
enum_constant: $ => choice(
|
|
1661
|
+
seq(
|
|
1662
|
+
optional($._metadata),
|
|
1663
|
+
field('name', $.identifier),
|
|
1664
|
+
optional($.argument_part),
|
|
1665
|
+
),
|
|
1666
|
+
seq(
|
|
1667
|
+
optional($._metadata),
|
|
1668
|
+
field('name', $.identifier),
|
|
1669
|
+
optional($.type_arguments),
|
|
1670
|
+
'.',
|
|
1671
|
+
choice($.identifier, $._new_builtin),
|
|
1672
|
+
$.arguments,
|
|
1673
|
+
)),
|
|
1674
|
+
|
|
1675
|
+
type_alias: $ => choice(
|
|
1676
|
+
seq(
|
|
1677
|
+
optional($._metadata),
|
|
1678
|
+
$._typedef,
|
|
1679
|
+
optional($._type),
|
|
1680
|
+
$._type_name,
|
|
1681
|
+
$._formal_parameter_part, ';'),
|
|
1682
|
+
seq(
|
|
1683
|
+
optional($._metadata),
|
|
1684
|
+
$._typedef,
|
|
1685
|
+
$._type_name,
|
|
1686
|
+
optional($.type_parameters),
|
|
1687
|
+
'=', $._type, ';'),
|
|
1688
|
+
),
|
|
1689
|
+
|
|
1690
|
+
_class_modifiers: $ => seq(choice($.sealed, seq(optional($.abstract), optional(choice($.base, $.interface, 'final', 'inline')))), 'class'),
|
|
1691
|
+
|
|
1692
|
+
_mixin_class_modifiers: $ => seq(optional($.abstract), optional($.base), $.mixin, 'class'),
|
|
1693
|
+
|
|
1694
|
+
class_definition: $ => choice(
|
|
1695
|
+
seq(
|
|
1696
|
+
optional($._metadata),
|
|
1697
|
+
choice($._class_modifiers, $._mixin_class_modifiers),
|
|
1698
|
+
field('name', $.identifier),
|
|
1699
|
+
optional(field('type_parameters', $.type_parameters)),
|
|
1700
|
+
optional(field('superclass', $.superclass)),
|
|
1701
|
+
optional(field('interfaces', $.interfaces)),
|
|
1702
|
+
field('body', $.class_body)
|
|
1703
|
+
),
|
|
1704
|
+
seq(
|
|
1705
|
+
optional($._metadata),
|
|
1706
|
+
$._class_modifiers,
|
|
1707
|
+
$.mixin_application_class
|
|
1708
|
+
)
|
|
1709
|
+
),
|
|
1710
|
+
|
|
1711
|
+
extension_declaration: $ => choice(
|
|
1712
|
+
seq(
|
|
1713
|
+
optional($._metadata),
|
|
1714
|
+
'extension',
|
|
1715
|
+
optional(field('name', $.identifier)),
|
|
1716
|
+
optional(field('type_parameters', $.type_parameters)),
|
|
1717
|
+
'on',
|
|
1718
|
+
field('class', $._type),
|
|
1719
|
+
field('body', $.extension_body)
|
|
1720
|
+
),
|
|
1721
|
+
),
|
|
1722
|
+
|
|
1723
|
+
_metadata: $ => prec.right(repeat1($.annotation)),
|
|
1724
|
+
|
|
1725
|
+
|
|
1726
|
+
type_parameters: $ => seq(
|
|
1727
|
+
'<', commaSep1($.type_parameter), '>'
|
|
1728
|
+
),
|
|
1729
|
+
|
|
1730
|
+
type_parameter: $ => seq(
|
|
1731
|
+
optional($._metadata),
|
|
1732
|
+
choice(alias(
|
|
1733
|
+
$.identifier,
|
|
1734
|
+
$.type_identifier),
|
|
1735
|
+
$.nullable_type
|
|
1736
|
+
),
|
|
1737
|
+
// This is a comment
|
|
1738
|
+
// comment with a link made in https://github.com/flutter/flutter/pull/48547
|
|
1739
|
+
// Changes made in https://github.com/flutter/flutter/pull/48547
|
|
1740
|
+
/* This is also a comment */
|
|
1741
|
+
/* this comment /* // /** ends here: */
|
|
1742
|
+
|
|
1743
|
+
optional($.nullable_type),
|
|
1744
|
+
optional($.type_bound)
|
|
1745
|
+
),
|
|
1746
|
+
|
|
1747
|
+
type_bound: $ => seq('extends', $._type_not_void),
|
|
1748
|
+
|
|
1749
|
+
superclass: $ => choice(
|
|
1750
|
+
seq(
|
|
1751
|
+
'extends',
|
|
1752
|
+
$._type_not_void,
|
|
1753
|
+
optional($.mixins)
|
|
1754
|
+
),
|
|
1755
|
+
$.mixins
|
|
1756
|
+
),
|
|
1757
|
+
|
|
1758
|
+
mixins: $ => seq(
|
|
1759
|
+
'with',
|
|
1760
|
+
$._type_not_void_list
|
|
1761
|
+
),
|
|
1762
|
+
|
|
1763
|
+
mixin_application_class: $ => seq(
|
|
1764
|
+
$.identifier,
|
|
1765
|
+
optional($.type_parameters),
|
|
1766
|
+
'=',
|
|
1767
|
+
$.mixin_application,
|
|
1768
|
+
$._semicolon
|
|
1769
|
+
),
|
|
1770
|
+
|
|
1771
|
+
mixin_application: $ => seq(
|
|
1772
|
+
$._type_not_void,
|
|
1773
|
+
$.mixins,
|
|
1774
|
+
optional($.interfaces)
|
|
1775
|
+
),
|
|
1776
|
+
mixin_declaration: $ => seq(
|
|
1777
|
+
optional($._metadata),
|
|
1778
|
+
optional($.base),
|
|
1779
|
+
$.mixin,
|
|
1780
|
+
$.identifier,
|
|
1781
|
+
optional($.type_parameters),
|
|
1782
|
+
optional(seq(
|
|
1783
|
+
'on',
|
|
1784
|
+
$._type_not_void_list
|
|
1785
|
+
)),
|
|
1786
|
+
optional($.interfaces),
|
|
1787
|
+
$.class_body
|
|
1788
|
+
),
|
|
1789
|
+
interfaces: $ => seq(
|
|
1790
|
+
$._implements,
|
|
1791
|
+
$._type_not_void_list
|
|
1792
|
+
),
|
|
1793
|
+
|
|
1794
|
+
interface_type_list: $ => seq(
|
|
1795
|
+
$._type,
|
|
1796
|
+
repeat(seq(',', $._type))
|
|
1797
|
+
),
|
|
1798
|
+
|
|
1799
|
+
class_body: $ => seq(
|
|
1800
|
+
'{',
|
|
1801
|
+
repeat(
|
|
1802
|
+
seq(
|
|
1803
|
+
optional($._metadata),
|
|
1804
|
+
$._class_member_definition
|
|
1805
|
+
)
|
|
1806
|
+
),
|
|
1807
|
+
'}'
|
|
1808
|
+
),
|
|
1809
|
+
extension_body: $ => seq(
|
|
1810
|
+
'{',
|
|
1811
|
+
repeat(
|
|
1812
|
+
choice(
|
|
1813
|
+
seq(optional($._metadata), $.declaration, $._semicolon),
|
|
1814
|
+
seq(
|
|
1815
|
+
optional($._metadata),
|
|
1816
|
+
seq(
|
|
1817
|
+
$.method_signature,
|
|
1818
|
+
$.function_body
|
|
1819
|
+
),
|
|
1820
|
+
)
|
|
1821
|
+
)
|
|
1822
|
+
),
|
|
1823
|
+
'}'
|
|
1824
|
+
),
|
|
1825
|
+
|
|
1826
|
+
_class_member_definition: $ => choice(
|
|
1827
|
+
seq($.declaration, $._semicolon),
|
|
1828
|
+
seq(
|
|
1829
|
+
$.method_signature,
|
|
1830
|
+
$.function_body
|
|
1831
|
+
),
|
|
1832
|
+
),
|
|
1833
|
+
|
|
1834
|
+
getter_signature: $ => seq(
|
|
1835
|
+
optional($._type),
|
|
1836
|
+
$._get,
|
|
1837
|
+
field('name', $.identifier),
|
|
1838
|
+
optional($._native)
|
|
1839
|
+
),
|
|
1840
|
+
setter_signature: $ => seq(
|
|
1841
|
+
optional($._type),
|
|
1842
|
+
$._set,
|
|
1843
|
+
field('name', $.identifier),
|
|
1844
|
+
$._formal_parameter_part,
|
|
1845
|
+
optional($._native)
|
|
1846
|
+
),
|
|
1847
|
+
method_signature: $ => choice(
|
|
1848
|
+
seq($.constructor_signature, optional($.initializers)),
|
|
1849
|
+
$.factory_constructor_signature,
|
|
1850
|
+
|
|
1851
|
+
seq(
|
|
1852
|
+
optional($._static),
|
|
1853
|
+
choice(
|
|
1854
|
+
$.function_signature,
|
|
1855
|
+
$.getter_signature,
|
|
1856
|
+
$.setter_signature
|
|
1857
|
+
)
|
|
1858
|
+
),
|
|
1859
|
+
$.operator_signature
|
|
1860
|
+
),
|
|
1861
|
+
|
|
1862
|
+
declaration: $ => choice(
|
|
1863
|
+
seq($.constant_constructor_signature, optional(choice($.redirection, $.initializers))),
|
|
1864
|
+
seq($.constructor_signature, optional(choice($.redirection, $.initializers))),
|
|
1865
|
+
seq($._external,
|
|
1866
|
+
optional($.const_builtin),
|
|
1867
|
+
$.factory_constructor_signature
|
|
1868
|
+
),
|
|
1869
|
+
seq(
|
|
1870
|
+
optional($.const_builtin),
|
|
1871
|
+
$.factory_constructor_signature, $._native
|
|
1872
|
+
),
|
|
1873
|
+
seq($._external,
|
|
1874
|
+
$.constant_constructor_signature
|
|
1875
|
+
),
|
|
1876
|
+
$.redirecting_factory_constructor_signature,
|
|
1877
|
+
seq($._external,
|
|
1878
|
+
$.constructor_signature
|
|
1879
|
+
),
|
|
1880
|
+
seq(
|
|
1881
|
+
optional($._external_builtin),
|
|
1882
|
+
optional($._static),
|
|
1883
|
+
$.getter_signature,
|
|
1884
|
+
),
|
|
1885
|
+
seq(
|
|
1886
|
+
optional($._external_and_static),
|
|
1887
|
+
$.setter_signature,
|
|
1888
|
+
),
|
|
1889
|
+
|
|
1890
|
+
seq(
|
|
1891
|
+
optional($._external),
|
|
1892
|
+
$.operator_signature
|
|
1893
|
+
),
|
|
1894
|
+
seq(
|
|
1895
|
+
optional($._external_and_static),
|
|
1896
|
+
$.function_signature,
|
|
1897
|
+
),
|
|
1898
|
+
// TODO: This should only work with native?
|
|
1899
|
+
seq(
|
|
1900
|
+
$._static,
|
|
1901
|
+
$.function_signature,
|
|
1902
|
+
),
|
|
1903
|
+
// | static const 〈type〉? 〈staticFinalDeclarationList〉
|
|
1904
|
+
// | static final 〈type〉? 〈staticFinalDeclarationList〉
|
|
1905
|
+
// | static late final 〈type〉? 〈initializedIdentifierList〉
|
|
1906
|
+
// | static late? 〈varOrType〉 〈initializedIdentifierList
|
|
1907
|
+
seq(
|
|
1908
|
+
$._static,
|
|
1909
|
+
choice(
|
|
1910
|
+
seq(
|
|
1911
|
+
$._final_or_const,
|
|
1912
|
+
optional($._type),
|
|
1913
|
+
$.static_final_declaration_list
|
|
1914
|
+
),
|
|
1915
|
+
seq(
|
|
1916
|
+
$._late_builtin,
|
|
1917
|
+
choice(
|
|
1918
|
+
seq(
|
|
1919
|
+
$.final_builtin,
|
|
1920
|
+
optional($._type),
|
|
1921
|
+
$.initialized_identifier_list
|
|
1922
|
+
),
|
|
1923
|
+
seq(
|
|
1924
|
+
choice(
|
|
1925
|
+
$._type,
|
|
1926
|
+
$.inferred_type,
|
|
1927
|
+
),
|
|
1928
|
+
$.initialized_identifier_list
|
|
1929
|
+
)
|
|
1930
|
+
)
|
|
1931
|
+
),
|
|
1932
|
+
seq(
|
|
1933
|
+
choice(
|
|
1934
|
+
$._type,
|
|
1935
|
+
$.inferred_type,
|
|
1936
|
+
),
|
|
1937
|
+
$.initialized_identifier_list
|
|
1938
|
+
)
|
|
1939
|
+
)
|
|
1940
|
+
),
|
|
1941
|
+
// | covariant late final 〈type〉? 〈identifierList〉
|
|
1942
|
+
// | covariant late? 〈varOrType〉 〈initializedIdentifierList〉
|
|
1943
|
+
seq(
|
|
1944
|
+
$._covariant,
|
|
1945
|
+
choice(
|
|
1946
|
+
seq(
|
|
1947
|
+
$._late_builtin,
|
|
1948
|
+
choice(
|
|
1949
|
+
seq(
|
|
1950
|
+
$.final_builtin,
|
|
1951
|
+
optional($._type),
|
|
1952
|
+
$.identifier_list
|
|
1953
|
+
),
|
|
1954
|
+
seq(
|
|
1955
|
+
choice(
|
|
1956
|
+
$._type,
|
|
1957
|
+
$.inferred_type,
|
|
1958
|
+
),
|
|
1959
|
+
$.initialized_identifier_list
|
|
1960
|
+
)
|
|
1961
|
+
)
|
|
1962
|
+
),
|
|
1963
|
+
seq(
|
|
1964
|
+
choice(
|
|
1965
|
+
$._type,
|
|
1966
|
+
$.inferred_type,
|
|
1967
|
+
),
|
|
1968
|
+
$.initialized_identifier_list
|
|
1969
|
+
)
|
|
1970
|
+
)
|
|
1971
|
+
),
|
|
1972
|
+
seq(
|
|
1973
|
+
optional($._late_builtin), $.final_builtin,
|
|
1974
|
+
optional($._type),
|
|
1975
|
+
$.initialized_identifier_list
|
|
1976
|
+
),
|
|
1977
|
+
seq(
|
|
1978
|
+
optional($._late_builtin),
|
|
1979
|
+
$._var_or_type,
|
|
1980
|
+
$.initialized_identifier_list
|
|
1981
|
+
)
|
|
1982
|
+
// TODO: add in the 'late' keyword from the informal draft spec:
|
|
1983
|
+
// |static late final〈type〉?〈initializedIdentifierList〉
|
|
1984
|
+
// |static late?〈varOrType〉 〈initializedIdentifierList〉
|
|
1985
|
+
// |covariant late?〈varOrType〉 〈initializedIdentifierList〉
|
|
1986
|
+
// |late?final〈type〉?〈initializedIdentifierList〉
|
|
1987
|
+
// |late?〈varOrType〉 〈initializedIdentifierList〉
|
|
1988
|
+
),
|
|
1989
|
+
|
|
1990
|
+
identifier_list: $ => commaSep1(
|
|
1991
|
+
$.identifier
|
|
1992
|
+
),
|
|
1993
|
+
initialized_identifier_list: $ => commaSep1(
|
|
1994
|
+
$.initialized_identifier
|
|
1995
|
+
),
|
|
1996
|
+
initialized_identifier: $ => seq(
|
|
1997
|
+
$.identifier,
|
|
1998
|
+
optional(seq(
|
|
1999
|
+
'=',
|
|
2000
|
+
$._expression
|
|
2001
|
+
))
|
|
2002
|
+
),
|
|
2003
|
+
static_final_declaration_list: $ => commaSep1(
|
|
2004
|
+
$.static_final_declaration
|
|
2005
|
+
),
|
|
2006
|
+
binary_operator: $ => choice(
|
|
2007
|
+
$.multiplicative_operator,
|
|
2008
|
+
$.additive_operator,
|
|
2009
|
+
$.shift_operator,
|
|
2010
|
+
$.relational_operator,
|
|
2011
|
+
'==',
|
|
2012
|
+
$.bitwise_operator
|
|
2013
|
+
),
|
|
2014
|
+
operator_signature: $ => seq(
|
|
2015
|
+
optional($._type),
|
|
2016
|
+
$._operator,
|
|
2017
|
+
choice(
|
|
2018
|
+
'~',
|
|
2019
|
+
$.binary_operator,
|
|
2020
|
+
'[]',
|
|
2021
|
+
'[]='
|
|
2022
|
+
),
|
|
2023
|
+
$.formal_parameter_list,
|
|
2024
|
+
optional($._native)
|
|
2025
|
+
),
|
|
2026
|
+
static_final_declaration: $ => seq(
|
|
2027
|
+
$.identifier,
|
|
2028
|
+
'=',
|
|
2029
|
+
$._expression
|
|
2030
|
+
),
|
|
2031
|
+
|
|
2032
|
+
_external_and_static: $ => seq(
|
|
2033
|
+
$._external,
|
|
2034
|
+
optional($._static)),
|
|
2035
|
+
_static_or_covariant: $ => choice(
|
|
2036
|
+
$._covariant,
|
|
2037
|
+
$._static
|
|
2038
|
+
),
|
|
2039
|
+
_final_or_const: $ => choice(
|
|
2040
|
+
$.final_builtin,
|
|
2041
|
+
$.const_builtin
|
|
2042
|
+
),
|
|
2043
|
+
|
|
2044
|
+
static_initializer: $ => seq(
|
|
2045
|
+
$._static,
|
|
2046
|
+
$.block
|
|
2047
|
+
),
|
|
2048
|
+
|
|
2049
|
+
initializers: $ => seq(
|
|
2050
|
+
':',
|
|
2051
|
+
commaSep1($.initializer_list_entry)
|
|
2052
|
+
),
|
|
2053
|
+
initializer_list_entry: $ => choice(
|
|
2054
|
+
seq($.super, $.arguments),
|
|
2055
|
+
seq($.super,
|
|
2056
|
+
seq('.', choice($.identifier, $._new_builtin), $.arguments),
|
|
2057
|
+
),
|
|
2058
|
+
$.field_initializer,
|
|
2059
|
+
$.assertion
|
|
2060
|
+
),
|
|
2061
|
+
|
|
2062
|
+
field_initializer: $ => seq(
|
|
2063
|
+
optional(seq($.this, '.')),
|
|
2064
|
+
$.identifier,
|
|
2065
|
+
'=',
|
|
2066
|
+
// $.conditional_expression,
|
|
2067
|
+
$._real_expression,
|
|
2068
|
+
repeat(
|
|
2069
|
+
$.cascade_section
|
|
2070
|
+
)
|
|
2071
|
+
),
|
|
2072
|
+
|
|
2073
|
+
// constructor_signature: $ => seq(
|
|
2074
|
+
// $._constructor_declarator,
|
|
2075
|
+
// // optional($.throws),
|
|
2076
|
+
// // field('body', choice(
|
|
2077
|
+
// // $.constructor_body,
|
|
2078
|
+
// // $._semicolon
|
|
2079
|
+
// // ))
|
|
2080
|
+
// ),
|
|
2081
|
+
|
|
2082
|
+
factory_constructor_signature: $ => seq(
|
|
2083
|
+
$._factory,
|
|
2084
|
+
sep1($.identifier, '.'),
|
|
2085
|
+
$.formal_parameter_list,
|
|
2086
|
+
),
|
|
2087
|
+
|
|
2088
|
+
redirecting_factory_constructor_signature: $ => seq(
|
|
2089
|
+
optional($.const_builtin),
|
|
2090
|
+
$._factory,
|
|
2091
|
+
sep1($.identifier, '.'),
|
|
2092
|
+
$.formal_parameter_list,
|
|
2093
|
+
'=',
|
|
2094
|
+
$._type_not_void,
|
|
2095
|
+
optional(seq('.', $.identifier)),
|
|
2096
|
+
),
|
|
2097
|
+
|
|
2098
|
+
redirection: $ => seq(
|
|
2099
|
+
':',
|
|
2100
|
+
$.this,
|
|
2101
|
+
optional(seq(
|
|
2102
|
+
'.',
|
|
2103
|
+
$._identifier_or_new
|
|
2104
|
+
)),
|
|
2105
|
+
$.arguments
|
|
2106
|
+
),
|
|
2107
|
+
|
|
2108
|
+
constructor_signature: $ => seq(
|
|
2109
|
+
field('name', seq($.identifier, optional(
|
|
2110
|
+
seq(
|
|
2111
|
+
'.',
|
|
2112
|
+
$._identifier_or_new
|
|
2113
|
+
)
|
|
2114
|
+
))),
|
|
2115
|
+
field('parameters', $.formal_parameter_list)
|
|
2116
|
+
),
|
|
2117
|
+
constant_constructor_signature: $ => seq(
|
|
2118
|
+
$.const_builtin,
|
|
2119
|
+
seq($.identifier, optional(seq('.', $._identifier_or_new))),
|
|
2120
|
+
$.formal_parameter_list
|
|
2121
|
+
),
|
|
2122
|
+
|
|
2123
|
+
constructor_body: $ => seq(
|
|
2124
|
+
'{',
|
|
2125
|
+
optional($.explicit_constructor_invocation),
|
|
2126
|
+
repeat($._statement),
|
|
2127
|
+
'}'
|
|
2128
|
+
),
|
|
2129
|
+
|
|
2130
|
+
explicit_constructor_invocation: $ => seq(
|
|
2131
|
+
choice(
|
|
2132
|
+
seq(
|
|
2133
|
+
field('type_arguments', optional($.type_arguments)),
|
|
2134
|
+
field('constructor', choice($.this, $.super)),
|
|
2135
|
+
),
|
|
2136
|
+
seq(
|
|
2137
|
+
field('object', choice($._ambiguous_name, $._primary)),
|
|
2138
|
+
'.',
|
|
2139
|
+
field('type_arguments', optional($.type_arguments)),
|
|
2140
|
+
field('constructor', $.super),
|
|
2141
|
+
)
|
|
2142
|
+
),
|
|
2143
|
+
field('arguments', $.arguments),
|
|
2144
|
+
$._semicolon
|
|
2145
|
+
),
|
|
2146
|
+
|
|
2147
|
+
_ambiguous_name: $ => choice(
|
|
2148
|
+
$.identifier,
|
|
2149
|
+
$.scoped_identifier
|
|
2150
|
+
),
|
|
2151
|
+
|
|
2152
|
+
scoped_identifier: $ => seq(
|
|
2153
|
+
field('scope', choice($.identifier, $.scoped_identifier)),
|
|
2154
|
+
'.',
|
|
2155
|
+
field('name', $.identifier)
|
|
2156
|
+
),
|
|
2157
|
+
|
|
2158
|
+
variable_declaration: $ => seq(
|
|
2159
|
+
$._declared_identifier,
|
|
2160
|
+
optional(seq(
|
|
2161
|
+
',',
|
|
2162
|
+
commaSep1($.identifier)
|
|
2163
|
+
))
|
|
2164
|
+
),
|
|
2165
|
+
|
|
2166
|
+
initialized_variable_definition: $ => seq(
|
|
2167
|
+
$._declared_identifier,
|
|
2168
|
+
optional(seq(
|
|
2169
|
+
prec(DART_PREC.BUILTIN, '='),
|
|
2170
|
+
field('value', $._expression)
|
|
2171
|
+
)),
|
|
2172
|
+
repeat(seq(',', $.initialized_identifier))
|
|
2173
|
+
),
|
|
2174
|
+
// initialized_identifier: $ => seq(
|
|
2175
|
+
// $.identifier,
|
|
2176
|
+
// optional(seq('=', $._expression))
|
|
2177
|
+
// ),
|
|
2178
|
+
|
|
2179
|
+
_declared_identifier: $ => seq(
|
|
2180
|
+
optional($._metadata),
|
|
2181
|
+
optional($._covariant),
|
|
2182
|
+
$._final_const_var_or_type,
|
|
2183
|
+
field('name', $.identifier)
|
|
2184
|
+
),
|
|
2185
|
+
|
|
2186
|
+
// Types
|
|
2187
|
+
|
|
2188
|
+
_final_const_var_or_type: $ => choice(
|
|
2189
|
+
seq(optional($._late_builtin), $.final_builtin, optional($._type)),
|
|
2190
|
+
seq($.const_builtin, optional(
|
|
2191
|
+
$._type
|
|
2192
|
+
)),
|
|
2193
|
+
seq(optional($._late_builtin),
|
|
2194
|
+
$._var_or_type)
|
|
2195
|
+
),
|
|
2196
|
+
|
|
2197
|
+
_type: $ => choice(
|
|
2198
|
+
seq(
|
|
2199
|
+
$.function_type,
|
|
2200
|
+
optional($.nullable_type)
|
|
2201
|
+
),
|
|
2202
|
+
$._type_not_function
|
|
2203
|
+
// $._function_type_tails,
|
|
2204
|
+
// seq(
|
|
2205
|
+
// $._type_not_function,
|
|
2206
|
+
// $._function_type_tails
|
|
2207
|
+
// ),
|
|
2208
|
+
// $._type_not_function
|
|
2209
|
+
// $._unannotated_type,
|
|
2210
|
+
// $.annotated_type
|
|
2211
|
+
),
|
|
2212
|
+
_type_not_function: $ => choice(
|
|
2213
|
+
$._type_not_void_not_function,
|
|
2214
|
+
seq($.record_type, optional($.nullable_type)),
|
|
2215
|
+
$.void_type
|
|
2216
|
+
),
|
|
2217
|
+
_type_not_void_not_function: $ => choice(
|
|
2218
|
+
seq(
|
|
2219
|
+
$._type_name,
|
|
2220
|
+
optional($.type_arguments),
|
|
2221
|
+
optional($.nullable_type)
|
|
2222
|
+
),
|
|
2223
|
+
// rewritten in accordance with the draft spec page 198
|
|
2224
|
+
seq(
|
|
2225
|
+
$._function_builtin_identifier,
|
|
2226
|
+
optional($.nullable_type)
|
|
2227
|
+
)
|
|
2228
|
+
),
|
|
2229
|
+
|
|
2230
|
+
function_type: $ => choice(
|
|
2231
|
+
$._function_type_tails,
|
|
2232
|
+
seq(
|
|
2233
|
+
$._type_not_function,
|
|
2234
|
+
$._function_type_tails
|
|
2235
|
+
)
|
|
2236
|
+
),
|
|
2237
|
+
_function_type_tails: $ => repeat1($._function_type_tail),
|
|
2238
|
+
|
|
2239
|
+
_function_type_tail: $ => seq(
|
|
2240
|
+
$._function_builtin_identifier,
|
|
2241
|
+
optional($.type_parameters),
|
|
2242
|
+
optional($.nullable_type),
|
|
2243
|
+
optional($.parameter_type_list),
|
|
2244
|
+
optional($.nullable_type),
|
|
2245
|
+
),
|
|
2246
|
+
|
|
2247
|
+
parameter_type_list: $ => seq(
|
|
2248
|
+
'(',
|
|
2249
|
+
optional(choice(
|
|
2250
|
+
commaSep1TrailingComma($.normal_parameter_type),
|
|
2251
|
+
seq(
|
|
2252
|
+
commaSep1($.normal_parameter_type),
|
|
2253
|
+
',',
|
|
2254
|
+
$.optional_parameter_types,
|
|
2255
|
+
),
|
|
2256
|
+
$.optional_parameter_types
|
|
2257
|
+
),),
|
|
2258
|
+
')'
|
|
2259
|
+
),
|
|
2260
|
+
|
|
2261
|
+
normal_parameter_type: $ => seq(
|
|
2262
|
+
optional($._metadata),
|
|
2263
|
+
choice(
|
|
2264
|
+
$.typed_identifier,
|
|
2265
|
+
$._type
|
|
2266
|
+
)
|
|
2267
|
+
),
|
|
2268
|
+
|
|
2269
|
+
optional_parameter_types: $ => choice(
|
|
2270
|
+
$.optional_positional_parameter_types,
|
|
2271
|
+
$.named_parameter_types
|
|
2272
|
+
),
|
|
2273
|
+
|
|
2274
|
+
optional_positional_parameter_types: $ => seq(
|
|
2275
|
+
'[',
|
|
2276
|
+
commaSep1TrailingComma($.normal_parameter_type),
|
|
2277
|
+
']'
|
|
2278
|
+
),
|
|
2279
|
+
named_parameter_types: $ => seq(
|
|
2280
|
+
'{',
|
|
2281
|
+
commaSep1TrailingComma($._named_parameter_type),
|
|
2282
|
+
'}'
|
|
2283
|
+
),
|
|
2284
|
+
|
|
2285
|
+
_named_parameter_type: $ => seq(
|
|
2286
|
+
optional($._metadata),
|
|
2287
|
+
optional($._required),
|
|
2288
|
+
$.typed_identifier
|
|
2289
|
+
),
|
|
2290
|
+
|
|
2291
|
+
_type_not_void: $ => choice(
|
|
2292
|
+
seq(
|
|
2293
|
+
$.function_type,
|
|
2294
|
+
optional($.nullable_type)
|
|
2295
|
+
),
|
|
2296
|
+
seq($.record_type, optional($.nullable_type)),
|
|
2297
|
+
// $.function_type,
|
|
2298
|
+
$._type_not_void_not_function
|
|
2299
|
+
// alias($.identifier, $.type_identifier),
|
|
2300
|
+
// // $.scoped_type_identifier,
|
|
2301
|
+
// $.generic_type
|
|
2302
|
+
),
|
|
2303
|
+
|
|
2304
|
+
record_type: $ => choice(
|
|
2305
|
+
seq('(', ')'),
|
|
2306
|
+
seq('(', commaSep1($.record_type_field), ',', '{' , commaSep1TrailingComma($.record_type_named_field), '}', ')'),
|
|
2307
|
+
seq('(', commaSep1TrailingComma($.record_type_field), ')'),
|
|
2308
|
+
seq('(','{', commaSep1TrailingComma($.record_type_named_field), '}', ')'),
|
|
2309
|
+
),
|
|
2310
|
+
|
|
2311
|
+
record_type_field: $ => seq(
|
|
2312
|
+
optional($._metadata),
|
|
2313
|
+
$._type,
|
|
2314
|
+
optional($.identifier),
|
|
2315
|
+
),
|
|
2316
|
+
|
|
2317
|
+
record_type_named_field: $ => seq(
|
|
2318
|
+
optional($._metadata),
|
|
2319
|
+
$.typed_identifier,
|
|
2320
|
+
),
|
|
2321
|
+
|
|
2322
|
+
_type_not_void_list: $ => commaSep1(
|
|
2323
|
+
$._type_not_void
|
|
2324
|
+
),
|
|
2325
|
+
|
|
2326
|
+
_type_name: $ => seq(
|
|
2327
|
+
alias(
|
|
2328
|
+
$.identifier,
|
|
2329
|
+
$.type_identifier
|
|
2330
|
+
),
|
|
2331
|
+
optional(
|
|
2332
|
+
$._type_dot_identifier
|
|
2333
|
+
),
|
|
2334
|
+
// optional($.nullable_type),
|
|
2335
|
+
),
|
|
2336
|
+
|
|
2337
|
+
// _type_name: $ => prec.right( // changed from above?
|
|
2338
|
+
// seq(
|
|
2339
|
+
// alias(
|
|
2340
|
+
// $.identifier,
|
|
2341
|
+
// $.type_identifier
|
|
2342
|
+
// ),
|
|
2343
|
+
// optional(
|
|
2344
|
+
// $._type_dot_identifier
|
|
2345
|
+
// ),
|
|
2346
|
+
// optional($.nullable_type),
|
|
2347
|
+
// )
|
|
2348
|
+
// ),
|
|
2349
|
+
|
|
2350
|
+
_type_dot_identifier: $ => prec.right(
|
|
2351
|
+
DART_PREC.IMPORT_EXPORT,
|
|
2352
|
+
seq(
|
|
2353
|
+
'.',
|
|
2354
|
+
alias(
|
|
2355
|
+
$.identifier,
|
|
2356
|
+
$.type_identifier
|
|
2357
|
+
)
|
|
2358
|
+
)
|
|
2359
|
+
),
|
|
2360
|
+
|
|
2361
|
+
typed_identifier: $ => seq(
|
|
2362
|
+
$._type,
|
|
2363
|
+
$.identifier
|
|
2364
|
+
),
|
|
2365
|
+
|
|
2366
|
+
nullable_type: $ => prec(DART_PREC.BUILTIN, '?'),
|
|
2367
|
+
nullable_selector: $ => prec(DART_PREC.BUILTIN, '?'),
|
|
2368
|
+
|
|
2369
|
+
floating_point_type: $ => token(
|
|
2370
|
+
'double'
|
|
2371
|
+
),
|
|
2372
|
+
|
|
2373
|
+
boolean_type: $ => prec(
|
|
2374
|
+
DART_PREC.BUILTIN,
|
|
2375
|
+
'bool',
|
|
2376
|
+
),
|
|
2377
|
+
|
|
2378
|
+
void_type: $ => token('void'),
|
|
2379
|
+
|
|
2380
|
+
_var_or_type: $ => choice(
|
|
2381
|
+
$._type,
|
|
2382
|
+
seq(
|
|
2383
|
+
$.inferred_type,
|
|
2384
|
+
optional($._type)
|
|
2385
|
+
)
|
|
2386
|
+
),
|
|
2387
|
+
|
|
2388
|
+
_final_var_or_type: $ => choice($.inferred_type, $.final_builtin, seq(optional($.final_builtin), $._type)),
|
|
2389
|
+
|
|
2390
|
+
inferred_type: $ => prec(
|
|
2391
|
+
DART_PREC.BUILTIN,
|
|
2392
|
+
'var',
|
|
2393
|
+
),
|
|
2394
|
+
|
|
2395
|
+
function_body: $ => choice(
|
|
2396
|
+
seq(
|
|
2397
|
+
optional('async'),
|
|
2398
|
+
'=>',
|
|
2399
|
+
$._expression,
|
|
2400
|
+
$._semicolon
|
|
2401
|
+
),
|
|
2402
|
+
seq(
|
|
2403
|
+
optional(choice(
|
|
2404
|
+
'async',
|
|
2405
|
+
'async*',
|
|
2406
|
+
'sync*',
|
|
2407
|
+
)),
|
|
2408
|
+
$.block
|
|
2409
|
+
)
|
|
2410
|
+
),
|
|
2411
|
+
|
|
2412
|
+
function_expression_body: $ => choice(
|
|
2413
|
+
seq(
|
|
2414
|
+
optional('async'),
|
|
2415
|
+
'=>',
|
|
2416
|
+
$._expression
|
|
2417
|
+
),
|
|
2418
|
+
seq(
|
|
2419
|
+
optional(choice(
|
|
2420
|
+
'async',
|
|
2421
|
+
'async*',
|
|
2422
|
+
'sync*',
|
|
2423
|
+
)),
|
|
2424
|
+
$.block
|
|
2425
|
+
)
|
|
2426
|
+
),
|
|
2427
|
+
function_signature: $ => seq(
|
|
2428
|
+
// optional($._metadata),
|
|
2429
|
+
optional($._type),
|
|
2430
|
+
field('name', choice(
|
|
2431
|
+
alias(
|
|
2432
|
+
$._get,
|
|
2433
|
+
$.identifier, // this way the syntax still highlights consistently.
|
|
2434
|
+
),
|
|
2435
|
+
alias(
|
|
2436
|
+
$._set,
|
|
2437
|
+
$.identifier, // this way the syntax still highlights consistently.
|
|
2438
|
+
),
|
|
2439
|
+
// $._get,
|
|
2440
|
+
// $._set,
|
|
2441
|
+
$.identifier
|
|
2442
|
+
)),
|
|
2443
|
+
$._formal_parameter_part,
|
|
2444
|
+
optional($._native),
|
|
2445
|
+
),
|
|
2446
|
+
|
|
2447
|
+
// _get_identifier: $ => alias(
|
|
2448
|
+
// $.identifier, // this way the syntax still highlights consistently.
|
|
2449
|
+
// $._get
|
|
2450
|
+
// ),
|
|
2451
|
+
|
|
2452
|
+
_formal_parameter_part: $ => seq(
|
|
2453
|
+
optional($.type_parameters),
|
|
2454
|
+
$.formal_parameter_list
|
|
2455
|
+
),
|
|
2456
|
+
|
|
2457
|
+
|
|
2458
|
+
formal_parameter_list: $ => $._strict_formal_parameter_list,
|
|
2459
|
+
|
|
2460
|
+
_strict_formal_parameter_list: $ => choice(
|
|
2461
|
+
seq(
|
|
2462
|
+
'(',
|
|
2463
|
+
')'
|
|
2464
|
+
),
|
|
2465
|
+
seq(
|
|
2466
|
+
'(',
|
|
2467
|
+
$._normal_formal_parameters,
|
|
2468
|
+
optional(
|
|
2469
|
+
','
|
|
2470
|
+
),
|
|
2471
|
+
')'
|
|
2472
|
+
),
|
|
2473
|
+
seq(
|
|
2474
|
+
'(',
|
|
2475
|
+
$._normal_formal_parameters,
|
|
2476
|
+
',',
|
|
2477
|
+
$.optional_formal_parameters,
|
|
2478
|
+
')'
|
|
2479
|
+
),
|
|
2480
|
+
seq(
|
|
2481
|
+
'(',
|
|
2482
|
+
$.optional_formal_parameters,
|
|
2483
|
+
')'
|
|
2484
|
+
)
|
|
2485
|
+
),
|
|
2486
|
+
|
|
2487
|
+
_normal_formal_parameters: $ => commaSep1($.formal_parameter),
|
|
2488
|
+
optional_formal_parameters: $ => choice(
|
|
2489
|
+
$._optional_postional_formal_parameters,
|
|
2490
|
+
$._named_formal_parameters
|
|
2491
|
+
),
|
|
2492
|
+
|
|
2493
|
+
positional_parameters: $ => seq(
|
|
2494
|
+
'[',
|
|
2495
|
+
commaSep1(
|
|
2496
|
+
$._default_formal_parameter
|
|
2497
|
+
),
|
|
2498
|
+
']'
|
|
2499
|
+
),
|
|
2500
|
+
|
|
2501
|
+
_optional_postional_formal_parameters: $ => seq(
|
|
2502
|
+
'[',
|
|
2503
|
+
commaSep1TrailingComma(
|
|
2504
|
+
$._default_formal_parameter
|
|
2505
|
+
),
|
|
2506
|
+
']'
|
|
2507
|
+
),
|
|
2508
|
+
_named_formal_parameters: $ => seq(
|
|
2509
|
+
'{',
|
|
2510
|
+
commaSep1TrailingComma(
|
|
2511
|
+
$._default_named_parameter
|
|
2512
|
+
),
|
|
2513
|
+
'}'
|
|
2514
|
+
),
|
|
2515
|
+
|
|
2516
|
+
formal_parameter: $ => $._normal_formal_parameter,
|
|
2517
|
+
|
|
2518
|
+
_default_formal_parameter: $ => seq(
|
|
2519
|
+
$.formal_parameter,
|
|
2520
|
+
optional(
|
|
2521
|
+
seq(
|
|
2522
|
+
'=',
|
|
2523
|
+
$._expression
|
|
2524
|
+
)
|
|
2525
|
+
)
|
|
2526
|
+
),
|
|
2527
|
+
_default_named_parameter: $ => choice(
|
|
2528
|
+
seq(
|
|
2529
|
+
optional(
|
|
2530
|
+
$._metadata
|
|
2531
|
+
),
|
|
2532
|
+
optional(
|
|
2533
|
+
$._required
|
|
2534
|
+
),
|
|
2535
|
+
$.formal_parameter,
|
|
2536
|
+
optional(
|
|
2537
|
+
seq(
|
|
2538
|
+
'=',
|
|
2539
|
+
$._expression
|
|
2540
|
+
)
|
|
2541
|
+
)
|
|
2542
|
+
),
|
|
2543
|
+
seq(
|
|
2544
|
+
optional(
|
|
2545
|
+
$._metadata
|
|
2546
|
+
),
|
|
2547
|
+
optional(
|
|
2548
|
+
$._required
|
|
2549
|
+
),
|
|
2550
|
+
$.formal_parameter,
|
|
2551
|
+
optional(
|
|
2552
|
+
seq(
|
|
2553
|
+
':',
|
|
2554
|
+
$._expression
|
|
2555
|
+
)
|
|
2556
|
+
)
|
|
2557
|
+
)
|
|
2558
|
+
),
|
|
2559
|
+
|
|
2560
|
+
_normal_formal_parameter: $ => seq(
|
|
2561
|
+
optional(
|
|
2562
|
+
$._metadata
|
|
2563
|
+
),
|
|
2564
|
+
choice(
|
|
2565
|
+
$._function_formal_parameter,
|
|
2566
|
+
$._simple_formal_parameter,
|
|
2567
|
+
$.constructor_param,
|
|
2568
|
+
$.super_formal_parameter
|
|
2569
|
+
)
|
|
2570
|
+
),
|
|
2571
|
+
|
|
2572
|
+
_function_formal_parameter: $ => seq(
|
|
2573
|
+
optional(
|
|
2574
|
+
$._covariant
|
|
2575
|
+
),
|
|
2576
|
+
optional(
|
|
2577
|
+
$._type
|
|
2578
|
+
),
|
|
2579
|
+
$.identifier,
|
|
2580
|
+
$._formal_parameter_part,
|
|
2581
|
+
optional($.nullable_type)
|
|
2582
|
+
),
|
|
2583
|
+
|
|
2584
|
+
_simple_formal_parameter: $ => choice(
|
|
2585
|
+
$._declared_identifier,
|
|
2586
|
+
seq(
|
|
2587
|
+
optional(
|
|
2588
|
+
$._covariant
|
|
2589
|
+
),
|
|
2590
|
+
$.identifier
|
|
2591
|
+
)
|
|
2592
|
+
),
|
|
2593
|
+
|
|
2594
|
+
// see https://github.com/dart-lang/language/blob/31f3d2bd6fd83b2e5f5019adb276c23fd2900941/working/1855%20-%20super%20parameters/proposal.md
|
|
2595
|
+
super_formal_parameter: $ => seq(
|
|
2596
|
+
optional($._final_const_var_or_type),
|
|
2597
|
+
$.super,
|
|
2598
|
+
'.',
|
|
2599
|
+
$.identifier,
|
|
2600
|
+
optional($._formal_parameter_part)
|
|
2601
|
+
),
|
|
2602
|
+
|
|
2603
|
+
//constructor param = field formal parameter
|
|
2604
|
+
constructor_param: $ => seq(
|
|
2605
|
+
optional($._final_const_var_or_type),
|
|
2606
|
+
$.this,
|
|
2607
|
+
'.',
|
|
2608
|
+
$.identifier,
|
|
2609
|
+
optional($._formal_parameter_part)
|
|
2610
|
+
),
|
|
2611
|
+
|
|
2612
|
+
local_variable_declaration: $ => choice(
|
|
2613
|
+
seq(
|
|
2614
|
+
optional($._metadata),
|
|
2615
|
+
$.initialized_variable_definition,
|
|
2616
|
+
$._semicolon
|
|
2617
|
+
),
|
|
2618
|
+
seq(
|
|
2619
|
+
optional($._metadata),
|
|
2620
|
+
$.pattern_variable_declaration,
|
|
2621
|
+
$._semicolon
|
|
2622
|
+
)
|
|
2623
|
+
),
|
|
2624
|
+
|
|
2625
|
+
script_tag: $ => seq('#!', /.+/, '\n'),
|
|
2626
|
+
|
|
2627
|
+
library_name: $ => seq(optional($._metadata), 'library', $.dotted_identifier_list, $._semicolon),
|
|
2628
|
+
|
|
2629
|
+
dotted_identifier_list: $ => sep1($.identifier, '.'),
|
|
2630
|
+
|
|
2631
|
+
_identifier_or_new: $ => choice($.identifier, $._new_builtin),
|
|
2632
|
+
|
|
2633
|
+
qualified: $ =>choice(
|
|
2634
|
+
seq($._type_name, '.', $._identifier_or_new),
|
|
2635
|
+
seq($._type_name, '.', $._type_name, '.', $._identifier_or_new),
|
|
2636
|
+
),
|
|
2637
|
+
|
|
2638
|
+
// Built in identifier tokens: These should be tokenized.
|
|
2639
|
+
//assert,break,case,
|
|
2640
|
+
// catch,
|
|
2641
|
+
// class,
|
|
2642
|
+
// const,
|
|
2643
|
+
// continue,
|
|
2644
|
+
// default,
|
|
2645
|
+
// do,
|
|
2646
|
+
// else,
|
|
2647
|
+
// enum,
|
|
2648
|
+
// extends,
|
|
2649
|
+
// false,
|
|
2650
|
+
// final,
|
|
2651
|
+
// finally,
|
|
2652
|
+
// for,
|
|
2653
|
+
// if,
|
|
2654
|
+
// in,
|
|
2655
|
+
// is,
|
|
2656
|
+
// new,
|
|
2657
|
+
// null,
|
|
2658
|
+
// rethrow,
|
|
2659
|
+
// return,
|
|
2660
|
+
// super,
|
|
2661
|
+
// switch,
|
|
2662
|
+
// this,
|
|
2663
|
+
// throw,
|
|
2664
|
+
// true,
|
|
2665
|
+
// try,
|
|
2666
|
+
// var,
|
|
2667
|
+
// void,
|
|
2668
|
+
// while,
|
|
2669
|
+
// with
|
|
2670
|
+
|
|
2671
|
+
_as: $ => prec(
|
|
2672
|
+
DART_PREC.BUILTIN,
|
|
2673
|
+
'as',
|
|
2674
|
+
),
|
|
2675
|
+
break_builtin: $ => token('break'),
|
|
2676
|
+
assert_builtin: $ => token('assert'),
|
|
2677
|
+
case_builtin: $ => token('case'),
|
|
2678
|
+
rethrow_builtin: $ => token('rethrow'),
|
|
2679
|
+
part_of_builtin: $ => token('part of'),
|
|
2680
|
+
_covariant: $ => prec(
|
|
2681
|
+
DART_PREC.BUILTIN,
|
|
2682
|
+
'covariant',
|
|
2683
|
+
),
|
|
2684
|
+
_deferred: $ => prec(
|
|
2685
|
+
DART_PREC.BUILTIN,
|
|
2686
|
+
'deferred',
|
|
2687
|
+
),
|
|
2688
|
+
_dynamic: $ => prec(
|
|
2689
|
+
DART_PREC.BUILTIN,
|
|
2690
|
+
'dynamic',
|
|
2691
|
+
),
|
|
2692
|
+
_export: $ => prec(
|
|
2693
|
+
DART_PREC.BUILTIN,
|
|
2694
|
+
'export',
|
|
2695
|
+
),
|
|
2696
|
+
_external: $ => $._external_builtin,
|
|
2697
|
+
_factory: $ => prec(
|
|
2698
|
+
DART_PREC.BUILTIN,
|
|
2699
|
+
'factory',
|
|
2700
|
+
),
|
|
2701
|
+
_function_builtin_identifier: $ => prec(
|
|
2702
|
+
DART_PREC.BUILTIN,
|
|
2703
|
+
'Function',
|
|
2704
|
+
),
|
|
2705
|
+
_get: $ => prec(
|
|
2706
|
+
DART_PREC.BUILTIN,
|
|
2707
|
+
'get',
|
|
2708
|
+
),
|
|
2709
|
+
_native: $ => seq(
|
|
2710
|
+
'native', optional($.string_literal)
|
|
2711
|
+
),
|
|
2712
|
+
_implements: $ => prec(
|
|
2713
|
+
DART_PREC.BUILTIN,
|
|
2714
|
+
'implements',
|
|
2715
|
+
),
|
|
2716
|
+
_import: $ => prec(
|
|
2717
|
+
DART_PREC.BUILTIN,
|
|
2718
|
+
'import',
|
|
2719
|
+
),
|
|
2720
|
+
interface: $ => prec(
|
|
2721
|
+
DART_PREC.BUILTIN,
|
|
2722
|
+
'interface',
|
|
2723
|
+
),
|
|
2724
|
+
base: $ => prec(
|
|
2725
|
+
DART_PREC.BUILTIN,
|
|
2726
|
+
'base',
|
|
2727
|
+
),
|
|
2728
|
+
abstract: $ => prec(
|
|
2729
|
+
DART_PREC.BUILTIN,
|
|
2730
|
+
'abstract',
|
|
2731
|
+
),
|
|
2732
|
+
sealed: $ => prec(
|
|
2733
|
+
DART_PREC.BUILTIN,
|
|
2734
|
+
'sealed',
|
|
2735
|
+
),
|
|
2736
|
+
_library: $ => prec(
|
|
2737
|
+
DART_PREC.BUILTIN,
|
|
2738
|
+
'library',
|
|
2739
|
+
),
|
|
2740
|
+
_operator: $ => prec(
|
|
2741
|
+
DART_PREC.BUILTIN,
|
|
2742
|
+
'operator',
|
|
2743
|
+
),
|
|
2744
|
+
mixin: $ => prec(
|
|
2745
|
+
DART_PREC.BUILTIN,
|
|
2746
|
+
'mixin',
|
|
2747
|
+
),
|
|
2748
|
+
_part: $ => prec(
|
|
2749
|
+
DART_PREC.BUILTIN,
|
|
2750
|
+
'part',
|
|
2751
|
+
),
|
|
2752
|
+
_required: $ => prec(
|
|
2753
|
+
DART_PREC.BUILTIN,
|
|
2754
|
+
'required',
|
|
2755
|
+
),
|
|
2756
|
+
_set: $ => prec(
|
|
2757
|
+
DART_PREC.BUILTIN,
|
|
2758
|
+
'set',
|
|
2759
|
+
),
|
|
2760
|
+
_static: $ => prec(
|
|
2761
|
+
DART_PREC.BUILTIN,
|
|
2762
|
+
'static',
|
|
2763
|
+
),
|
|
2764
|
+
_typedef: $ => prec(
|
|
2765
|
+
DART_PREC.BUILTIN,
|
|
2766
|
+
'typedef',
|
|
2767
|
+
),
|
|
2768
|
+
_new_builtin: $ => prec(
|
|
2769
|
+
DART_PREC.BUILTIN,
|
|
2770
|
+
'new',
|
|
2771
|
+
),
|
|
2772
|
+
logical_and_operator: $ => prec(
|
|
2773
|
+
DART_PREC.BUILTIN,
|
|
2774
|
+
'&&',
|
|
2775
|
+
),
|
|
2776
|
+
logical_or_operator: $ => prec(
|
|
2777
|
+
DART_PREC.BUILTIN,
|
|
2778
|
+
'||'
|
|
2779
|
+
),
|
|
2780
|
+
const_builtin: $ => token('const'),
|
|
2781
|
+
final_builtin: $ => token('final'),
|
|
2782
|
+
_late_builtin: $ => prec(
|
|
2783
|
+
DART_PREC.BUILTIN,
|
|
2784
|
+
'late',
|
|
2785
|
+
),
|
|
2786
|
+
|
|
2787
|
+
_external_builtin: $ => prec(
|
|
2788
|
+
DART_PREC.BUILTIN,
|
|
2789
|
+
'external',
|
|
2790
|
+
),
|
|
2791
|
+
|
|
2792
|
+
this: $ => prec(
|
|
2793
|
+
DART_PREC.BUILTIN,
|
|
2794
|
+
'this',
|
|
2795
|
+
),
|
|
2796
|
+
|
|
2797
|
+
super: $ => prec(
|
|
2798
|
+
DART_PREC.BUILTIN,
|
|
2799
|
+
'super',
|
|
2800
|
+
),
|
|
2801
|
+
|
|
2802
|
+
label: $ => seq($.identifier, ':'),
|
|
2803
|
+
|
|
2804
|
+
_semicolon: $ => token(';'),
|
|
2805
|
+
|
|
2806
|
+
identifier: $ => /[a-zA-Z_$][\w$]*/,
|
|
2807
|
+
identifier_dollar_escaped: $ => /([a-zA-Z_]|(\\\$))([\w]|(\\\$))*/,
|
|
2808
|
+
//TODO: add support for triple-slash comments as a special category.
|
|
2809
|
+
// Trying to add support for nested multiline comments.
|
|
2810
|
+
// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
|
|
2811
|
+
|
|
2812
|
+
// _line_comment: $ => token(seq(
|
|
2813
|
+
// '//', /[^\/].*/
|
|
2814
|
+
// )),
|
|
2815
|
+
// _documentation_line_comment: $ => token(seq('///', /.*/)),
|
|
2816
|
+
|
|
2817
|
+
comment: $ => choice(
|
|
2818
|
+
$._block_comment,
|
|
2819
|
+
seq('//', /([^/\n].*)?/),
|
|
2820
|
+
seq(
|
|
2821
|
+
'/*',
|
|
2822
|
+
/[^*]*\*+([^/*][^*]*\*+)*/,
|
|
2823
|
+
'/'
|
|
2824
|
+
)
|
|
2825
|
+
),
|
|
2826
|
+
//added nesting comments.
|
|
2827
|
+
documentation_comment: $ =>
|
|
2828
|
+
choice(
|
|
2829
|
+
$._documentation_block_comment,
|
|
2830
|
+
seq('///', /.*/),
|
|
2831
|
+
)
|
|
2832
|
+
,
|
|
2833
|
+
}
|
|
2834
|
+
});
|
|
2835
|
+
|
|
2836
|
+
function sep1(rule, separator) {
|
|
2837
|
+
return seq(rule, repeat(seq(separator, rule)));
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
function sep2(rule, separator) {
|
|
2841
|
+
return seq(rule, repeat1(seq(separator, rule)));
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
function commaSep1(rule) {
|
|
2845
|
+
return seq(rule, repeat(seq(',', rule)))
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
function commaSep(rule) {
|
|
2849
|
+
return optional(commaSep1(rule))
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
function commaSep2TrailingComma(rule) {
|
|
2853
|
+
return seq(rule, repeat1(seq(',', rule)), optional(','))
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
function commaSep1TrailingComma(rule) {
|
|
2857
|
+
return seq(rule, repeat(seq(',', rule)), optional(','))
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
function commaSepTrailingComma(rule) {
|
|
2861
|
+
return optional(commaSep1TrailingComma(rule))
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
function pureBinaryRun(rule, separator, precedence){
|
|
2865
|
+
return prec.left(
|
|
2866
|
+
precedence,
|
|
2867
|
+
choice(
|
|
2868
|
+
sep2(
|
|
2869
|
+
rule,
|
|
2870
|
+
separator
|
|
2871
|
+
)))
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
function binaryRunLeft(rule, separator, superItem, precedence) {
|
|
2875
|
+
return prec.left( //left
|
|
2876
|
+
precedence,
|
|
2877
|
+
choice(
|
|
2878
|
+
sep2(
|
|
2879
|
+
// $.bitwise_xor_expression,
|
|
2880
|
+
rule,
|
|
2881
|
+
separator
|
|
2882
|
+
),
|
|
2883
|
+
seq(
|
|
2884
|
+
superItem,
|
|
2885
|
+
repeat1(
|
|
2886
|
+
seq(
|
|
2887
|
+
separator,
|
|
2888
|
+
rule,
|
|
2889
|
+
// $.bitwise_xor_expression
|
|
2890
|
+
)
|
|
2891
|
+
)
|
|
2892
|
+
)
|
|
2893
|
+
)
|
|
2894
|
+
)
|
|
2895
|
+
}
|