@driftsys/markspec 0.10.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/esm/compiler/deserialize.d.ts +49 -0
- package/esm/compiler/deserialize.d.ts.map +1 -0
- package/esm/compiler/deserialize.js +139 -0
- package/esm/compiler/manifest.d.ts +3 -0
- package/esm/compiler/manifest.d.ts.map +1 -1
- package/esm/compiler/manifest.js +9 -3
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +16 -7
- package/esm/config/markspec.d.ts +38 -1
- package/esm/config/markspec.d.ts.map +1 -1
- package/esm/config/markspec.js +127 -2
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +143 -147
- package/esm/decl/duplicates.d.ts +29 -0
- package/esm/decl/duplicates.d.ts.map +1 -0
- package/esm/decl/duplicates.js +28 -0
- package/esm/decl/mod.d.ts +20 -0
- package/esm/decl/mod.d.ts.map +1 -0
- package/esm/decl/mod.js +15 -0
- package/esm/decl/resolve.d.ts +104 -0
- package/esm/decl/resolve.d.ts.map +1 -0
- package/esm/decl/resolve.js +66 -0
- package/esm/decl/surfaces.d.ts +118 -0
- package/esm/decl/surfaces.d.ts.map +1 -0
- package/esm/decl/surfaces.js +135 -0
- package/esm/decl/table.d.ts +50 -0
- package/esm/decl/table.d.ts.map +1 -0
- package/esm/decl/table.js +124 -0
- package/esm/gates/mod.d.ts +13 -2
- package/esm/gates/mod.d.ts.map +1 -1
- package/esm/gates/mod.js +38 -11
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +3 -1
- package/esm/lock/acquire_compile.d.ts +31 -0
- package/esm/lock/acquire_compile.d.ts.map +1 -0
- package/esm/lock/acquire_compile.js +83 -0
- package/esm/lock/cache_check.d.ts +28 -0
- package/esm/lock/cache_check.d.ts.map +1 -0
- package/esm/lock/cache_check.js +51 -0
- package/esm/lock/check.d.ts +14 -3
- package/esm/lock/check.d.ts.map +1 -1
- package/esm/lock/check.js +41 -3
- package/esm/lock/git_intent.d.ts +46 -0
- package/esm/lock/git_intent.d.ts.map +1 -0
- package/esm/lock/git_intent.js +111 -0
- package/esm/lock/mod.d.ts +10 -3
- package/esm/lock/mod.d.ts.map +1 -1
- package/esm/lock/mod.js +7 -1
- package/esm/lock/model.d.ts +24 -1
- package/esm/lock/model.d.ts.map +1 -1
- package/esm/lock/parser.d.ts.map +1 -1
- package/esm/lock/parser.js +32 -0
- package/esm/lock/pin_assurance.d.ts +20 -0
- package/esm/lock/pin_assurance.d.ts.map +1 -0
- package/esm/lock/pin_assurance.js +34 -0
- package/esm/lock/resolve.d.ts +8 -17
- package/esm/lock/resolve.d.ts.map +1 -1
- package/esm/lock/resolve.js +7 -67
- package/esm/lock/serializer.d.ts.map +1 -1
- package/esm/lock/serializer.js +23 -0
- package/esm/lock/upstream_common.d.ts +29 -0
- package/esm/lock/upstream_common.d.ts.map +1 -0
- package/esm/lock/upstream_common.js +38 -0
- package/esm/lock/upstream_deps.d.ts +63 -0
- package/esm/lock/upstream_deps.d.ts.map +1 -0
- package/esm/lock/upstream_deps.js +172 -0
- package/esm/lock/upstream_refs.d.ts +69 -0
- package/esm/lock/upstream_refs.d.ts.map +1 -0
- package/esm/lock/upstream_refs.js +238 -0
- package/esm/mod.d.ts +16 -8
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +15 -5
- package/esm/model/mod.d.ts +93 -28
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +66 -13
- package/esm/model/profile.d.ts +13 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/directives.d.ts +6 -0
- package/esm/parser/directives.d.ts.map +1 -1
- package/esm/parser/directives.js +17 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +16 -51
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +20 -3
- package/esm/profile/merge.js +7 -0
- package/esm/reporter/mod.d.ts +11 -0
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +19 -8
- package/esm/typl/assemble.d.ts +53 -0
- package/esm/typl/assemble.d.ts.map +1 -0
- package/esm/typl/assemble.js +238 -0
- package/esm/typl/ast.d.ts +7 -1
- package/esm/typl/ast.d.ts.map +1 -1
- package/esm/typl/ast.js +3 -0
- package/esm/typl/bullet.d.ts +16 -24
- package/esm/typl/bullet.d.ts.map +1 -1
- package/esm/typl/bullet.js +9 -41
- package/esm/typl/citations.d.ts +27 -0
- package/esm/typl/citations.d.ts.map +1 -0
- package/esm/typl/citations.js +16 -0
- package/esm/typl/diagnostics.d.ts +2 -2
- package/esm/typl/diagnostics.d.ts.map +1 -1
- package/esm/typl/diagnostics.js +18 -0
- package/esm/typl/fence.d.ts +12 -21
- package/esm/typl/fence.d.ts.map +1 -1
- package/esm/typl/fence.js +5 -20
- package/esm/typl/grammar.d.ts.map +1 -1
- package/esm/typl/grammar.js +6 -0
- package/esm/typl/inline.d.ts +15 -24
- package/esm/typl/inline.d.ts.map +1 -1
- package/esm/typl/inline.js +6 -44
- package/esm/typl/lexer.d.ts.map +1 -1
- package/esm/typl/lexer.js +25 -4
- package/esm/typl/mod.d.ts +8 -2
- package/esm/typl/mod.d.ts.map +1 -1
- package/esm/typl/mod.js +5 -1
- package/esm/typl/recognize.d.ts +14 -0
- package/esm/typl/recognize.d.ts.map +1 -0
- package/esm/typl/recognize.js +19 -0
- package/esm/typl/registry.d.ts +1 -1
- package/esm/typl/resolve.d.ts +31 -0
- package/esm/typl/resolve.d.ts.map +1 -0
- package/esm/typl/resolve.js +27 -0
- package/esm/typl/table.d.ts +52 -0
- package/esm/typl/table.d.ts.map +1 -0
- package/esm/typl/table.js +69 -0
- package/esm/typl/validator.d.ts +24 -5
- package/esm/typl/validator.d.ts.map +1 -1
- package/esm/typl/validator.js +55 -75
- package/esm/upstream/mod.d.ts +45 -0
- package/esm/upstream/mod.d.ts.map +1 -0
- package/esm/upstream/mod.js +98 -0
- package/esm/upstream/project.d.ts +33 -0
- package/esm/upstream/project.d.ts.map +1 -0
- package/esm/upstream/project.js +38 -0
- package/esm/upstream/refs.d.ts +23 -0
- package/esm/upstream/refs.d.ts.map +1 -0
- package/esm/upstream/refs.js +71 -0
- package/esm/util/paths.d.ts +14 -0
- package/esm/util/paths.d.ts.map +1 -0
- package/esm/util/paths.js +22 -0
- package/esm/uxil/assemble.d.ts +38 -0
- package/esm/uxil/assemble.d.ts.map +1 -0
- package/esm/uxil/assemble.js +268 -0
- package/esm/uxil/ast.d.ts +63 -0
- package/esm/uxil/ast.d.ts.map +1 -0
- package/esm/uxil/ast.js +9 -0
- package/esm/uxil/citations.d.ts +27 -0
- package/esm/uxil/citations.d.ts.map +1 -0
- package/esm/uxil/citations.js +25 -0
- package/esm/uxil/diagnostics.d.ts +39 -0
- package/esm/uxil/diagnostics.d.ts.map +1 -0
- package/esm/uxil/diagnostics.js +135 -0
- package/esm/uxil/grammar.d.ts +72 -0
- package/esm/uxil/grammar.d.ts.map +1 -0
- package/esm/uxil/grammar.js +505 -0
- package/esm/uxil/lexer.d.ts +23 -0
- package/esm/uxil/lexer.d.ts.map +1 -0
- package/esm/uxil/lexer.js +58 -0
- package/esm/uxil/mod.d.ts +32 -0
- package/esm/uxil/mod.d.ts.map +1 -0
- package/esm/uxil/mod.js +11 -0
- package/esm/uxil/projection.d.ts +40 -0
- package/esm/uxil/projection.d.ts.map +1 -0
- package/esm/uxil/projection.js +41 -0
- package/esm/uxil/recognize.d.ts +16 -0
- package/esm/uxil/recognize.d.ts.map +1 -0
- package/esm/uxil/recognize.js +28 -0
- package/esm/uxil/registry.d.ts +37 -0
- package/esm/uxil/registry.d.ts.map +1 -0
- package/esm/uxil/registry.js +29 -0
- package/esm/uxil/surfaces.d.ts +36 -0
- package/esm/uxil/surfaces.d.ts.map +1 -0
- package/esm/uxil/surfaces.js +34 -0
- package/esm/uxil/validator.d.ts +36 -0
- package/esm/uxil/validator.d.ts.map +1 -0
- package/esm/uxil/validator.js +139 -0
- package/esm/uxil/vocab.d.ts +33 -0
- package/esm/uxil/vocab.d.ts.map +1 -0
- package/esm/uxil/vocab.js +36 -0
- package/esm/validator/body_blocks.d.ts.map +1 -1
- package/esm/validator/body_blocks.js +3 -9
- package/esm/validator/caption_convention.d.ts +2 -1
- package/esm/validator/caption_convention.d.ts.map +1 -1
- package/esm/validator/caption_convention.js +2 -1
- package/esm/validator/corpus.d.ts.map +1 -1
- package/esm/validator/corpus.js +40 -17
- package/esm/validator/discipline.d.ts +6 -4
- package/esm/validator/discipline.d.ts.map +1 -1
- package/esm/validator/discipline.js +6 -4
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +28 -15
- package/esm/validator/pipeline.d.ts +11 -1
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +68 -18
- package/esm/validator/trace_types.d.ts +9 -2
- package/esm/validator/trace_types.d.ts.map +1 -1
- package/esm/validator/trace_types.js +21 -5
- package/esm/validator/traceability.d.ts +15 -3
- package/esm/validator/traceability.d.ts.map +1 -1
- package/esm/validator/traceability.js +39 -4
- package/esm/validator/types.d.ts.map +1 -1
- package/esm/validator/types.js +11 -1
- package/esm/validator/uxil_family.d.ts +43 -0
- package/esm/validator/uxil_family.d.ts.map +1 -0
- package/esm/validator/uxil_family.js +52 -0
- package/package.json +1 -1
- package/script/compiler/deserialize.d.ts +49 -0
- package/script/compiler/deserialize.d.ts.map +1 -0
- package/script/compiler/deserialize.js +144 -0
- package/script/compiler/manifest.d.ts +3 -0
- package/script/compiler/manifest.d.ts.map +1 -1
- package/script/compiler/manifest.js +10 -3
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +15 -6
- package/script/config/markspec.d.ts +38 -1
- package/script/config/markspec.d.ts.map +1 -1
- package/script/config/markspec.js +129 -3
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +143 -147
- package/script/decl/duplicates.d.ts +29 -0
- package/script/decl/duplicates.d.ts.map +1 -0
- package/script/decl/duplicates.js +31 -0
- package/script/decl/mod.d.ts +20 -0
- package/script/decl/mod.d.ts.map +1 -0
- package/script/decl/mod.js +26 -0
- package/script/decl/resolve.d.ts +104 -0
- package/script/decl/resolve.d.ts.map +1 -0
- package/script/decl/resolve.js +70 -0
- package/script/decl/surfaces.d.ts +118 -0
- package/script/decl/surfaces.d.ts.map +1 -0
- package/script/decl/surfaces.js +141 -0
- package/script/decl/table.d.ts +50 -0
- package/script/decl/table.d.ts.map +1 -0
- package/script/decl/table.js +127 -0
- package/script/gates/mod.d.ts +13 -2
- package/script/gates/mod.d.ts.map +1 -1
- package/script/gates/mod.js +37 -10
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +3 -1
- package/script/lock/acquire_compile.d.ts +31 -0
- package/script/lock/acquire_compile.d.ts.map +1 -0
- package/script/lock/acquire_compile.js +86 -0
- package/script/lock/cache_check.d.ts +28 -0
- package/script/lock/cache_check.d.ts.map +1 -0
- package/script/lock/cache_check.js +54 -0
- package/script/lock/check.d.ts +14 -3
- package/script/lock/check.d.ts.map +1 -1
- package/script/lock/check.js +41 -3
- package/script/lock/git_intent.d.ts +46 -0
- package/script/lock/git_intent.d.ts.map +1 -0
- package/script/lock/git_intent.js +115 -0
- package/script/lock/mod.d.ts +10 -3
- package/script/lock/mod.d.ts.map +1 -1
- package/script/lock/mod.js +16 -2
- package/script/lock/model.d.ts +24 -1
- package/script/lock/model.d.ts.map +1 -1
- package/script/lock/parser.d.ts.map +1 -1
- package/script/lock/parser.js +32 -0
- package/script/lock/pin_assurance.d.ts +20 -0
- package/script/lock/pin_assurance.d.ts.map +1 -0
- package/script/lock/pin_assurance.js +37 -0
- package/script/lock/resolve.d.ts +8 -17
- package/script/lock/resolve.d.ts.map +1 -1
- package/script/lock/resolve.js +7 -68
- package/script/lock/serializer.d.ts.map +1 -1
- package/script/lock/serializer.js +23 -0
- package/script/lock/upstream_common.d.ts +29 -0
- package/script/lock/upstream_common.d.ts.map +1 -0
- package/script/lock/upstream_common.js +42 -0
- package/script/lock/upstream_deps.d.ts +63 -0
- package/script/lock/upstream_deps.d.ts.map +1 -0
- package/script/lock/upstream_deps.js +175 -0
- package/script/lock/upstream_refs.d.ts +69 -0
- package/script/lock/upstream_refs.d.ts.map +1 -0
- package/script/lock/upstream_refs.js +244 -0
- package/script/mod.d.ts +16 -8
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +40 -7
- package/script/model/mod.d.ts +93 -28
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +70 -14
- package/script/model/profile.d.ts +13 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/directives.d.ts +6 -0
- package/script/parser/directives.d.ts.map +1 -1
- package/script/parser/directives.js +18 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +15 -50
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +20 -3
- package/script/profile/merge.js +7 -0
- package/script/reporter/mod.d.ts +11 -0
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +18 -7
- package/script/typl/assemble.d.ts +53 -0
- package/script/typl/assemble.d.ts.map +1 -0
- package/script/typl/assemble.js +241 -0
- package/script/typl/ast.d.ts +7 -1
- package/script/typl/ast.d.ts.map +1 -1
- package/script/typl/ast.js +3 -0
- package/script/typl/bullet.d.ts +16 -24
- package/script/typl/bullet.d.ts.map +1 -1
- package/script/typl/bullet.js +10 -42
- package/script/typl/citations.d.ts +27 -0
- package/script/typl/citations.d.ts.map +1 -0
- package/script/typl/citations.js +20 -0
- package/script/typl/diagnostics.d.ts +2 -2
- package/script/typl/diagnostics.d.ts.map +1 -1
- package/script/typl/diagnostics.js +18 -0
- package/script/typl/fence.d.ts +12 -21
- package/script/typl/fence.d.ts.map +1 -1
- package/script/typl/fence.js +5 -20
- package/script/typl/grammar.d.ts.map +1 -1
- package/script/typl/grammar.js +6 -0
- package/script/typl/inline.d.ts +15 -24
- package/script/typl/inline.d.ts.map +1 -1
- package/script/typl/inline.js +6 -44
- package/script/typl/lexer.d.ts.map +1 -1
- package/script/typl/lexer.js +25 -4
- package/script/typl/mod.d.ts +8 -2
- package/script/typl/mod.d.ts.map +1 -1
- package/script/typl/mod.js +14 -2
- package/script/typl/recognize.d.ts +14 -0
- package/script/typl/recognize.d.ts.map +1 -0
- package/script/typl/recognize.js +22 -0
- package/script/typl/registry.d.ts +1 -1
- package/script/typl/resolve.d.ts +31 -0
- package/script/typl/resolve.d.ts.map +1 -0
- package/script/typl/resolve.js +33 -0
- package/script/typl/table.d.ts +52 -0
- package/script/typl/table.d.ts.map +1 -0
- package/script/typl/table.js +75 -0
- package/script/typl/validator.d.ts +24 -5
- package/script/typl/validator.d.ts.map +1 -1
- package/script/typl/validator.js +55 -75
- package/script/upstream/mod.d.ts +45 -0
- package/script/upstream/mod.d.ts.map +1 -0
- package/script/upstream/mod.js +101 -0
- package/script/upstream/project.d.ts +33 -0
- package/script/upstream/project.d.ts.map +1 -0
- package/script/upstream/project.js +41 -0
- package/script/upstream/refs.d.ts +23 -0
- package/script/upstream/refs.d.ts.map +1 -0
- package/script/upstream/refs.js +74 -0
- package/script/util/paths.d.ts +14 -0
- package/script/util/paths.d.ts.map +1 -0
- package/script/util/paths.js +25 -0
- package/script/uxil/assemble.d.ts +38 -0
- package/script/uxil/assemble.d.ts.map +1 -0
- package/script/uxil/assemble.js +272 -0
- package/script/uxil/ast.d.ts +63 -0
- package/script/uxil/ast.d.ts.map +1 -0
- package/script/uxil/ast.js +10 -0
- package/script/uxil/citations.d.ts +27 -0
- package/script/uxil/citations.d.ts.map +1 -0
- package/script/uxil/citations.js +29 -0
- package/script/uxil/diagnostics.d.ts +39 -0
- package/script/uxil/diagnostics.d.ts.map +1 -0
- package/script/uxil/diagnostics.js +140 -0
- package/script/uxil/grammar.d.ts +72 -0
- package/script/uxil/grammar.d.ts.map +1 -0
- package/script/uxil/grammar.js +511 -0
- package/script/uxil/lexer.d.ts +23 -0
- package/script/uxil/lexer.d.ts.map +1 -0
- package/script/uxil/lexer.js +61 -0
- package/script/uxil/mod.d.ts +32 -0
- package/script/uxil/mod.d.ts.map +1 -0
- package/script/uxil/mod.js +37 -0
- package/script/uxil/projection.d.ts +40 -0
- package/script/uxil/projection.d.ts.map +1 -0
- package/script/uxil/projection.js +44 -0
- package/script/uxil/recognize.d.ts +16 -0
- package/script/uxil/recognize.d.ts.map +1 -0
- package/script/uxil/recognize.js +31 -0
- package/script/uxil/registry.d.ts +37 -0
- package/script/uxil/registry.d.ts.map +1 -0
- package/script/uxil/registry.js +32 -0
- package/script/uxil/surfaces.d.ts +36 -0
- package/script/uxil/surfaces.d.ts.map +1 -0
- package/script/uxil/surfaces.js +39 -0
- package/script/uxil/validator.d.ts +36 -0
- package/script/uxil/validator.d.ts.map +1 -0
- package/script/uxil/validator.js +142 -0
- package/script/uxil/vocab.d.ts +33 -0
- package/script/uxil/vocab.d.ts.map +1 -0
- package/script/uxil/vocab.js +41 -0
- package/script/validator/body_blocks.d.ts.map +1 -1
- package/script/validator/body_blocks.js +3 -9
- package/script/validator/caption_convention.d.ts +2 -1
- package/script/validator/caption_convention.d.ts.map +1 -1
- package/script/validator/caption_convention.js +2 -1
- package/script/validator/corpus.d.ts.map +1 -1
- package/script/validator/corpus.js +39 -16
- package/script/validator/discipline.d.ts +6 -4
- package/script/validator/discipline.d.ts.map +1 -1
- package/script/validator/discipline.js +6 -4
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +27 -14
- package/script/validator/pipeline.d.ts +11 -1
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +67 -17
- package/script/validator/trace_types.d.ts +9 -2
- package/script/validator/trace_types.d.ts.map +1 -1
- package/script/validator/trace_types.js +20 -4
- package/script/validator/traceability.d.ts +15 -3
- package/script/validator/traceability.d.ts.map +1 -1
- package/script/validator/traceability.js +38 -3
- package/script/validator/types.d.ts.map +1 -1
- package/script/validator/types.js +10 -0
- package/script/validator/uxil_family.d.ts +43 -0
- package/script/validator/uxil_family.d.ts.map +1 -0
- package/script/validator/uxil_family.js +56 -0
package/script/typl/bullet.d.ts
CHANGED
|
@@ -2,33 +2,25 @@
|
|
|
2
2
|
* @module typl/bullet
|
|
3
3
|
*
|
|
4
4
|
* Bullet-glossary surface adapter — recognises CommonMark bullet list
|
|
5
|
-
* items whose first paragraph
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* integration calls parseTyplBlock on each `source` independently.
|
|
12
|
-
* Per-item position-bridging uses the item's range and formula
|
|
13
|
-
* documented in bridgeTyplDiagnostic.
|
|
5
|
+
* items whose first paragraph is a typl declaration (`$X : …` binding or
|
|
6
|
+
* `type X = …` typedef). A thin wrapper over the shared
|
|
7
|
+
* declaration-surface machinery (core/decl): it supplies typl's text
|
|
8
|
+
* recognizer and re-exports the common declaration node as
|
|
9
|
+
* {@linkcode TyplNestedBulletExtraction}. Mixed lists are supported —
|
|
10
|
+
* matching items are extracted, non-matching bullets are left alone.
|
|
14
11
|
*
|
|
15
12
|
* See ADR-019.
|
|
16
13
|
*/
|
|
17
|
-
import type { BodyBlock
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly source: string;
|
|
22
|
-
/** Source range of the bullet's first paragraph. */
|
|
23
|
-
readonly range: SourceRange;
|
|
24
|
-
}
|
|
14
|
+
import type { BodyBlock } from "../ast/nodes.js";
|
|
15
|
+
import { type NestedBlockDeclaration } from "../decl/mod.js";
|
|
16
|
+
/** A typl bullet declaration with its structural parent link (#723). */
|
|
17
|
+
export type TyplNestedBulletExtraction = NestedBlockDeclaration;
|
|
25
18
|
/**
|
|
26
|
-
* Walk a body AST and return every bullet-list item whose first
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* Returns matches in source order (depth-first).
|
|
19
|
+
* Walk a body AST and return every bullet-list item whose first paragraph
|
|
20
|
+
* is a typl declaration, in source order (depth-first, recursing into
|
|
21
|
+
* nested lists), each with a `parent` link for base-resolution scope
|
|
22
|
+
* chains. Delegates traversal to
|
|
23
|
+
* {@linkcode extractNestedBulletDeclarations}.
|
|
32
24
|
*/
|
|
33
|
-
export declare function
|
|
25
|
+
export declare function extractTyplBulletsNested(blocks: readonly BodyBlock[]): readonly TyplNestedBulletExtraction[];
|
|
34
26
|
//# sourceMappingURL=bullet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullet.d.ts","sourceRoot":"","sources":["../../src/typl/bullet.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bullet.d.ts","sourceRoot":"","sources":["../../src/typl/bullet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;AAGxB,wEAAwE;AACxE,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,0BAA0B,EAAE,CAEvC"}
|
package/script/typl/bullet.js
CHANGED
|
@@ -1,47 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
/** Matches a typl typedef bullet (paragraph text). */
|
|
7
|
-
const BULLET_TYPEDEF_RE = /^type\s+[A-Za-z_][A-Za-z0-9_]*\s*=/;
|
|
8
|
-
function isTyplBulletText(text) {
|
|
9
|
-
return BULLET_BINDING_RE.test(text) || BULLET_TYPEDEF_RE.test(text);
|
|
10
|
-
}
|
|
3
|
+
exports.extractTyplBulletsNested = extractTyplBulletsNested;
|
|
4
|
+
const mod_js_1 = require("../decl/mod.js");
|
|
5
|
+
const recognize_js_1 = require("./recognize.js");
|
|
11
6
|
/**
|
|
12
|
-
* Walk a body AST and return every bullet-list item whose first
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* Returns matches in source order (depth-first).
|
|
7
|
+
* Walk a body AST and return every bullet-list item whose first paragraph
|
|
8
|
+
* is a typl declaration, in source order (depth-first, recursing into
|
|
9
|
+
* nested lists), each with a `parent` link for base-resolution scope
|
|
10
|
+
* chains. Delegates traversal to
|
|
11
|
+
* {@linkcode extractNestedBulletDeclarations}.
|
|
18
12
|
*/
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
for (const block of blocks) {
|
|
22
|
-
if (block.kind === "list") {
|
|
23
|
-
for (const item of block.items) {
|
|
24
|
-
if (item.blocks.length === 0)
|
|
25
|
-
continue;
|
|
26
|
-
const first = item.blocks[0];
|
|
27
|
-
if (first.kind === "paragraph") {
|
|
28
|
-
const para = first;
|
|
29
|
-
if (isTyplBulletText(para.content.text)) {
|
|
30
|
-
results.push({
|
|
31
|
-
source: para.content.text,
|
|
32
|
-
range: para.range,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// Recurse into nested blocks (the item may itself contain a list)
|
|
37
|
-
if (item.blocks.length > 1) {
|
|
38
|
-
results.push(...extractTyplBullets(item.blocks.slice(1)));
|
|
39
|
-
}
|
|
40
|
-
else if (first.kind === "list") {
|
|
41
|
-
results.push(...extractTyplBullets([first]));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return results;
|
|
13
|
+
function extractTyplBulletsNested(blocks) {
|
|
14
|
+
return (0, mod_js_1.extractNestedBulletDeclarations)(blocks, recognize_js_1.isTyplDeclarationText);
|
|
47
15
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module typl/citations
|
|
3
|
+
*
|
|
4
|
+
* Citation extraction for the published tier (#723): a *citation* is a
|
|
5
|
+
* bare published-shaped ref in an inline code span — absolute
|
|
6
|
+
* (`` `$powertrain.brake.pedal_position` ``) or relative
|
|
7
|
+
* (`` `$.pedal_position` ``) — with no declaration clause. Plain `$Name`
|
|
8
|
+
* spans are entry-local mentions and deliberately not validated
|
|
9
|
+
* (unchanged pre-#723 behavior). The validator resolves relative
|
|
10
|
+
* citations against the entry's root namespace and checks resolved names
|
|
11
|
+
* against the corpus registry (TYPL-010 / TYPL-011).
|
|
12
|
+
*/
|
|
13
|
+
import type { BodyToken, SourceLocation } from "../model/mod.js";
|
|
14
|
+
/** One published-tier citation: the ref text and its file location. */
|
|
15
|
+
export interface TyplCitation {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly location: SourceLocation;
|
|
18
|
+
}
|
|
19
|
+
/** True when a code span's (trimmed) text is a bare published-shaped ref. */
|
|
20
|
+
export declare function isTyplCitationText(text: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Filter `Entry.bodyTokens` to published-tier citations, in source order.
|
|
23
|
+
* Reuses the shared inline-declaration walker with the citation
|
|
24
|
+
* recognizer — the walker strips backtick delimiters before matching.
|
|
25
|
+
*/
|
|
26
|
+
export declare function extractTyplCitations(bodyTokens: readonly BodyToken[]): readonly TyplCitation[];
|
|
27
|
+
//# sourceMappingURL=citations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citations.d.ts","sourceRoot":"","sources":["../../src/typl/citations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjE,uEAAuE;AACvE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,SAAS,YAAY,EAAE,CAGzB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTyplCitationText = isTyplCitationText;
|
|
4
|
+
exports.extractTyplCitations = extractTyplCitations;
|
|
5
|
+
const mod_js_1 = require("../decl/mod.js");
|
|
6
|
+
const resolve_js_1 = require("./resolve.js");
|
|
7
|
+
/** True when a code span's (trimmed) text is a bare published-shaped ref. */
|
|
8
|
+
function isTyplCitationText(text) {
|
|
9
|
+
const t = text.trim();
|
|
10
|
+
return (0, resolve_js_1.isPublishedTyplName)(t) || (0, resolve_js_1.isRelativeTyplName)(t);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Filter `Entry.bodyTokens` to published-tier citations, in source order.
|
|
14
|
+
* Reuses the shared inline-declaration walker with the citation
|
|
15
|
+
* recognizer — the walker strips backtick delimiters before matching.
|
|
16
|
+
*/
|
|
17
|
+
function extractTyplCitations(bodyTokens) {
|
|
18
|
+
return (0, mod_js_1.extractInlineDeclarations)(bodyTokens, isTyplCitationText)
|
|
19
|
+
.map((d) => ({ name: d.source.trim(), location: d.location }));
|
|
20
|
+
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* @module typl/diagnostics
|
|
3
3
|
*
|
|
4
4
|
* Diagnostic codes emitted by the typl parser and validator (TYPL-001
|
|
5
|
-
* through TYPL-
|
|
5
|
+
* through TYPL-012). Each code carries a severity and a template; the
|
|
6
6
|
* `typlDiagnostic` helper performs `${var}` substitution.
|
|
7
7
|
*/
|
|
8
8
|
import type { Position } from "./ast.js";
|
|
9
9
|
import type { Severity } from "../model/mod.js";
|
|
10
10
|
/** Union of all valid TYPL diagnostic codes. */
|
|
11
|
-
export type TyplCode = "TYPL-001" | "TYPL-002" | "TYPL-003" | "TYPL-004" | "TYPL-005" | "TYPL-006" | "TYPL-007" | "TYPL-008";
|
|
11
|
+
export type TyplCode = "TYPL-001" | "TYPL-002" | "TYPL-003" | "TYPL-004" | "TYPL-005" | "TYPL-006" | "TYPL-007" | "TYPL-008" | "TYPL-009" | "TYPL-010" | "TYPL-011" | "TYPL-012";
|
|
12
12
|
/** Shape of each entry in {@linkcode TYPL_CODES}. */
|
|
13
13
|
export interface TyplCodeEntry {
|
|
14
14
|
readonly severity: Severity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/typl/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAWhD,gDAAgD;AAChD,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEf,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/typl/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAWhD,gDAAgD;AAChD,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEf,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,CAyDtD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACvC,QAAQ,EAAE,QAAQ,GACjB,cAAc,CAUhB"}
|
|
@@ -14,10 +14,12 @@ exports.TYPL_CODES = {
|
|
|
14
14
|
severity: "error",
|
|
15
15
|
template: "Duplicate binding for ${name} in the same entry (first wins, this is a duplicate).",
|
|
16
16
|
},
|
|
17
|
+
// Deprecated (#723): retired by the published tier. Kept resolvable for tooling; never emitted.
|
|
17
18
|
"TYPL-002": {
|
|
18
19
|
severity: "error",
|
|
19
20
|
template: "${name} is declared as kind ${kindA} here and ${kindB} in ${otherFile}:${otherLine}.",
|
|
20
21
|
},
|
|
22
|
+
// Deprecated (#723): retired by the published tier. Kept resolvable for tooling; never emitted.
|
|
21
23
|
"TYPL-003": {
|
|
22
24
|
severity: "error",
|
|
23
25
|
template: "${name} is declared with a different shape than in ${otherFile}:${otherLine}.",
|
|
@@ -42,6 +44,22 @@ exports.TYPL_CODES = {
|
|
|
42
44
|
severity: "error",
|
|
43
45
|
template: "Literal ${value} violates declared ${constraint} (${detail}).",
|
|
44
46
|
},
|
|
47
|
+
"TYPL-009": {
|
|
48
|
+
severity: "error",
|
|
49
|
+
template: "${name} is already declared in ${otherFile}:${otherLine} (published symbols are declared exactly once).",
|
|
50
|
+
},
|
|
51
|
+
"TYPL-010": {
|
|
52
|
+
severity: "error",
|
|
53
|
+
template: "Relative reference ${name} has no namespace base in scope.",
|
|
54
|
+
},
|
|
55
|
+
"TYPL-011": {
|
|
56
|
+
severity: "error",
|
|
57
|
+
template: "Citation of undeclared published symbol ${name}.",
|
|
58
|
+
},
|
|
59
|
+
"TYPL-012": {
|
|
60
|
+
severity: "error",
|
|
61
|
+
template: "Multiple root namespace declarations in one entry (root is ${first}).",
|
|
62
|
+
},
|
|
45
63
|
};
|
|
46
64
|
/**
|
|
47
65
|
* Construct a typl diagnostic by substituting `${var}` placeholders in the
|
package/script/typl/fence.d.ts
CHANGED
|
@@ -2,30 +2,21 @@
|
|
|
2
2
|
* @module typl/fence
|
|
3
3
|
*
|
|
4
4
|
* Fence surface adapter — extracts typl source from fenced code blocks
|
|
5
|
-
* whose info-string is "typl".
|
|
6
|
-
* (
|
|
5
|
+
* whose info-string is "typl". A thin wrapper over the shared
|
|
6
|
+
* declaration-surface machinery (core/decl): it supplies typl's fence
|
|
7
|
+
* recognizer and re-exports the common declaration node as
|
|
8
|
+
* {@linkcode TyplFenceExtraction}.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
* its source range. PR 3 will wire the extracted source through
|
|
10
|
-
* parseTyplBlock and attach results to Entry.types.
|
|
10
|
+
* See ADR-019.
|
|
11
11
|
*/
|
|
12
|
-
import type { BodyBlock
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly source: string;
|
|
17
|
-
/** Source range of the whole fence (opening ``` through closing ```). */
|
|
18
|
-
readonly range: SourceRange;
|
|
19
|
-
}
|
|
12
|
+
import type { BodyBlock } from "../ast/nodes.js";
|
|
13
|
+
import { type BlockDeclaration } from "../decl/mod.js";
|
|
14
|
+
/** A single typl fence found inside a body: `{ source, range }`. */
|
|
15
|
+
export type TyplFenceExtraction = BlockDeclaration;
|
|
20
16
|
/**
|
|
21
|
-
* Walk a body AST and return every typl fence found
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* BlockquoteNode and NoteNode carry only InlineContent (not nested
|
|
26
|
-
* BodyBlock[]), so they are not recursed into.
|
|
27
|
-
*
|
|
28
|
-
* Returns fences in source order (depth-first traversal).
|
|
17
|
+
* Walk a body AST and return every typl fence (```typl) found, in source
|
|
18
|
+
* order (depth-first, recursing into list items). Delegates traversal to
|
|
19
|
+
* {@linkcode extractFenceDeclarations}.
|
|
29
20
|
*/
|
|
30
21
|
export declare function extractTyplFences(blocks: readonly BodyBlock[]): readonly TyplFenceExtraction[];
|
|
31
22
|
//# sourceMappingURL=fence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../src/typl/fence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../src/typl/fence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAC;AAExB,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,mBAAmB,EAAE,CAEhC"}
|
package/script/typl/fence.js
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractTyplFences = extractTyplFences;
|
|
4
|
+
const mod_js_1 = require("../decl/mod.js");
|
|
4
5
|
/**
|
|
5
|
-
* Walk a body AST and return every typl fence found
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* BlockquoteNode and NoteNode carry only InlineContent (not nested
|
|
10
|
-
* BodyBlock[]), so they are not recursed into.
|
|
11
|
-
*
|
|
12
|
-
* Returns fences in source order (depth-first traversal).
|
|
6
|
+
* Walk a body AST and return every typl fence (```typl) found, in source
|
|
7
|
+
* order (depth-first, recursing into list items). Delegates traversal to
|
|
8
|
+
* {@linkcode extractFenceDeclarations}.
|
|
13
9
|
*/
|
|
14
10
|
function extractTyplFences(blocks) {
|
|
15
|
-
|
|
16
|
-
for (const block of blocks) {
|
|
17
|
-
if (block.kind === "code" && block.lang === "typl") {
|
|
18
|
-
results.push({ source: block.text, range: block.range });
|
|
19
|
-
}
|
|
20
|
-
else if (block.kind === "list") {
|
|
21
|
-
for (const item of block.items) {
|
|
22
|
-
results.push(...extractTyplFences(item.blocks));
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return results;
|
|
11
|
+
return (0, mod_js_1.extractFenceDeclarations)(blocks, (lang) => lang === "typl");
|
|
27
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../../src/typl/grammar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../../src/typl/grammar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAqgBvE;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GACb;IAAE,GAAG,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAA;CAAE,CAK5D"}
|
package/script/typl/grammar.js
CHANGED
|
@@ -128,6 +128,12 @@ class Parser {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
const shape = this.parseShapeOptional();
|
|
131
|
+
// A namespace declaration (#723) is scaffolding — it establishes a
|
|
132
|
+
// base for relative refs and must not carry a shape.
|
|
133
|
+
if (kind === "namespace" && shape !== undefined) {
|
|
134
|
+
this.diagnostics.push((0, diagnostics_js_1.typlDiagnostic)("TYPL-006", { detail: "a namespace declaration carries no shape" }, nameTok.position));
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
131
137
|
return {
|
|
132
138
|
statementKind: "binding",
|
|
133
139
|
name: nameTok.value,
|
package/script/typl/inline.d.ts
CHANGED
|
@@ -1,34 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module typl/inline
|
|
3
3
|
*
|
|
4
|
-
* Inline backtick surface adapter — recognises typl declarations
|
|
5
|
-
*
|
|
6
|
-
* scattered through entry prose.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
4
|
+
* Inline backtick surface adapter — recognises typl declarations wrapped
|
|
5
|
+
* in CommonMark code spans, e.g. `` `$X : signal float[0..300]` ``
|
|
6
|
+
* scattered through entry prose. A thin wrapper over the shared
|
|
7
|
+
* declaration-surface machinery (core/decl): it supplies typl's text
|
|
8
|
+
* recognizer and re-exports the common declaration node as
|
|
9
|
+
* {@linkcode TyplInlineExtraction}. The shared machinery strips the
|
|
10
|
+
* backtick delimiters `Entry.bodyTokens` (ADR-016) records before
|
|
11
|
+
* recognizing, so `source` is the raw typl text.
|
|
12
12
|
*
|
|
13
13
|
* See ADR-019.
|
|
14
14
|
*/
|
|
15
|
-
import type { BodyToken
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
readonly source: string;
|
|
20
|
-
/** File-relative location of the code span. */
|
|
21
|
-
readonly location: SourceLocation;
|
|
22
|
-
}
|
|
15
|
+
import type { BodyToken } from "../model/mod.js";
|
|
16
|
+
import { type InlineDeclaration } from "../decl/mod.js";
|
|
17
|
+
/** A single typl inline-code declaration: `{ source, location }`. */
|
|
18
|
+
export type TyplInlineExtraction = InlineDeclaration;
|
|
23
19
|
/**
|
|
24
|
-
* Filter bodyTokens to inline-code spans whose contents
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* `inline-code` tokens in `bodyTokens` store their `text` field with
|
|
29
|
-
* surrounding backtick delimiters (e.g., `` `$X : signal` ``). This
|
|
30
|
-
* function strips those delimiters before pattern-matching and before
|
|
31
|
-
* setting `source`, so `parseTyplBlock` receives the raw typl source.
|
|
20
|
+
* Filter `Entry.bodyTokens` to inline-code spans whose contents are typl
|
|
21
|
+
* declarations, in source order. Delegates to
|
|
22
|
+
* {@linkcode extractInlineDeclarations}.
|
|
32
23
|
*/
|
|
33
24
|
export declare function extractTyplInlines(bodyTokens: readonly BodyToken[]): readonly TyplInlineExtraction[];
|
|
34
25
|
//# sourceMappingURL=inline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/typl/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/typl/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAGxB,qEAAqE;AACrE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,SAAS,oBAAoB,EAAE,CAEjC"}
|
package/script/typl/inline.js
CHANGED
|
@@ -1,51 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractTyplInlines = extractTyplInlines;
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
/** Matches a typl typedef span (code-span text). */
|
|
7
|
-
const INLINE_TYPEDEF_RE = /^type\s+[A-Za-z_][A-Za-z0-9_]*\s*=/;
|
|
8
|
-
function isTyplInlineText(text) {
|
|
9
|
-
return INLINE_BINDING_RE.test(text) || INLINE_TYPEDEF_RE.test(text);
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Strip the surrounding backtick delimiter(s) from an inline-code token's
|
|
13
|
-
* `text` field. `body_tokens.ts` stores inline-code text as `` `value` ``
|
|
14
|
-
* (with backtick delimiters). The typl patterns and `parseTyplBlock` need
|
|
15
|
-
* the inner value only.
|
|
16
|
-
*
|
|
17
|
-
* Handles both single-backtick (`` `…` ``) and double-backtick (` ``…`` `)
|
|
18
|
-
* delimiters. Returns the original string unchanged when it does not start
|
|
19
|
-
* and end with a matching backtick fence.
|
|
20
|
-
*/
|
|
21
|
-
function stripBackticks(text) {
|
|
22
|
-
if (text.startsWith("``") && text.endsWith("``") && text.length > 4) {
|
|
23
|
-
return text.slice(2, -2);
|
|
24
|
-
}
|
|
25
|
-
if (text.startsWith("`") && text.endsWith("`") && text.length > 2) {
|
|
26
|
-
return text.slice(1, -1);
|
|
27
|
-
}
|
|
28
|
-
return text;
|
|
29
|
-
}
|
|
4
|
+
const mod_js_1 = require("../decl/mod.js");
|
|
5
|
+
const recognize_js_1 = require("./recognize.js");
|
|
30
6
|
/**
|
|
31
|
-
* Filter bodyTokens to inline-code spans whose contents
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* `inline-code` tokens in `bodyTokens` store their `text` field with
|
|
36
|
-
* surrounding backtick delimiters (e.g., `` `$X : signal` ``). This
|
|
37
|
-
* function strips those delimiters before pattern-matching and before
|
|
38
|
-
* setting `source`, so `parseTyplBlock` receives the raw typl source.
|
|
7
|
+
* Filter `Entry.bodyTokens` to inline-code spans whose contents are typl
|
|
8
|
+
* declarations, in source order. Delegates to
|
|
9
|
+
* {@linkcode extractInlineDeclarations}.
|
|
39
10
|
*/
|
|
40
11
|
function extractTyplInlines(bodyTokens) {
|
|
41
|
-
|
|
42
|
-
for (const token of bodyTokens) {
|
|
43
|
-
if (token.kind !== "inline-code")
|
|
44
|
-
continue;
|
|
45
|
-
const inner = stripBackticks(token.text);
|
|
46
|
-
if (!isTyplInlineText(inner))
|
|
47
|
-
continue;
|
|
48
|
-
results.push({ source: inner, location: token.location });
|
|
49
|
-
}
|
|
50
|
-
return results;
|
|
12
|
+
return (0, mod_js_1.extractInlineDeclarations)(bodyTokens, recognize_js_1.isTyplDeclarationText);
|
|
51
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../../src/typl/lexer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAEvE,sDAAsD;AACtD,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,OAAO,GACP,aAAa,GACb,OAAO,GACP,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,OAAO,GACP,MAAM,GACN,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,KAAK,CAAC;AAEV,sDAAsD;AACtD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AA0BD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,GACb;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,WAAW,EAAE,cAAc,EAAE,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../../src/typl/lexer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAEvE,sDAAsD;AACtD,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,OAAO,GACP,aAAa,GACb,OAAO,GACP,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,OAAO,GACP,MAAM,GACN,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,KAAK,CAAC;AAEV,sDAAsD;AACtD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AA0BD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,GACb;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,WAAW,EAAE,cAAc,EAAE,CAAA;CAAE,CAuOpD"}
|
package/script/typl/lexer.js
CHANGED
|
@@ -79,19 +79,40 @@ function tokenize(source) {
|
|
|
79
79
|
push("COMMENT", value, startCol);
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
82
|
-
// ── Dollar-prefixed identifier — `$Speed`
|
|
82
|
+
// ── Dollar-prefixed identifier — `$Speed`, `$a.b.c`, `$.x` ──────
|
|
83
83
|
// $ identifier — body uses IDENT_BODY_RE (allows digits) intentionally;
|
|
84
|
-
// names like $1st are lexically valid and rejected by the parser
|
|
84
|
+
// names like $1st are lexically valid and rejected by the parser.
|
|
85
|
+
// Dotted paths (published tier, #723): a `.` is consumed only when an
|
|
86
|
+
// identifier character follows, so `float[0..100]` ranges and trailing
|
|
87
|
+
// dots never get eaten. A leading `.` right after `$` marks a relative
|
|
88
|
+
// published ref (`$.name`).
|
|
85
89
|
if (ch === "$") {
|
|
86
90
|
const startCol = column;
|
|
87
91
|
let value = "$";
|
|
88
92
|
i++;
|
|
89
93
|
column++;
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
if (source[i] === "." && i + 1 < source.length &&
|
|
95
|
+
IDENT_BODY_RE.test(source[i + 1])) {
|
|
96
|
+
value += ".";
|
|
92
97
|
i++;
|
|
93
98
|
column++;
|
|
94
99
|
}
|
|
100
|
+
while (i < source.length) {
|
|
101
|
+
if (IDENT_BODY_RE.test(source[i])) {
|
|
102
|
+
value += source[i];
|
|
103
|
+
i++;
|
|
104
|
+
column++;
|
|
105
|
+
}
|
|
106
|
+
else if (source[i] === "." && i + 1 < source.length &&
|
|
107
|
+
IDENT_BODY_RE.test(source[i + 1])) {
|
|
108
|
+
value += ".";
|
|
109
|
+
i++;
|
|
110
|
+
column++;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
95
116
|
push("DOLLAR_IDENT", value, startCol);
|
|
96
117
|
continue;
|
|
97
118
|
}
|
package/script/typl/mod.d.ts
CHANGED
|
@@ -10,13 +10,19 @@ export { KINDS } from "./ast.js";
|
|
|
10
10
|
export type { TyplCode, TyplCodeEntry, TyplDiagnostic } from "./diagnostics.js";
|
|
11
11
|
export { TYPL_CODES, typlDiagnostic } from "./diagnostics.js";
|
|
12
12
|
export { parseTyplBlock } from "./grammar.js";
|
|
13
|
+
export { assembleTyplTypes } from "./assemble.js";
|
|
13
14
|
export type { TyplFenceExtraction } from "./fence.js";
|
|
14
15
|
export { extractTyplFences } from "./fence.js";
|
|
15
16
|
export { bridgeTyplDiagnostic } from "./bridge.js";
|
|
16
|
-
export type {
|
|
17
|
-
export {
|
|
17
|
+
export type { TyplNestedBulletExtraction } from "./bullet.js";
|
|
18
|
+
export { extractTyplBulletsNested } from "./bullet.js";
|
|
18
19
|
export type { TyplInlineExtraction } from "./inline.js";
|
|
19
20
|
export { extractTyplInlines } from "./inline.js";
|
|
21
|
+
export type { TyplTableExtraction } from "./table.js";
|
|
22
|
+
export { extractTyplTable } from "./table.js";
|
|
23
|
+
export type { TyplCitation } from "./citations.js";
|
|
24
|
+
export { extractTyplCitations, isTyplCitationText } from "./citations.js";
|
|
25
|
+
export { isPublishedTyplName, isRelativeTyplName, TYPL_REF_OPS, typlPathOf, } from "./resolve.js";
|
|
20
26
|
export type { RegistryBinding, RegistryTypedef, TypeRegistry, } from "./registry.js";
|
|
21
27
|
export { buildTypeRegistry } from "./registry.js";
|
|
22
28
|
export { validateTypl } from "./validator.js";
|
package/script/typl/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/typl/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/typl/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,YAAY,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,UAAU,GACX,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,eAAe,EACf,eAAe,EACf,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/script/typl/mod.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* (docs/architecture/adr-019-typl-type-dsl.md) for the language spec.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.validateTypl = exports.buildTypeRegistry = exports.extractTyplInlines = exports.
|
|
10
|
+
exports.validateTypl = exports.buildTypeRegistry = exports.typlPathOf = exports.TYPL_REF_OPS = exports.isRelativeTyplName = exports.isPublishedTyplName = exports.isTyplCitationText = exports.extractTyplCitations = exports.extractTyplTable = exports.extractTyplInlines = exports.extractTyplBulletsNested = exports.bridgeTyplDiagnostic = exports.extractTyplFences = exports.assembleTyplTypes = exports.parseTyplBlock = exports.typlDiagnostic = exports.TYPL_CODES = exports.KINDS = void 0;
|
|
11
11
|
var ast_js_1 = require("./ast.js");
|
|
12
12
|
Object.defineProperty(exports, "KINDS", { enumerable: true, get: function () { return ast_js_1.KINDS; } });
|
|
13
13
|
var diagnostics_js_1 = require("./diagnostics.js");
|
|
@@ -15,14 +15,26 @@ Object.defineProperty(exports, "TYPL_CODES", { enumerable: true, get: function (
|
|
|
15
15
|
Object.defineProperty(exports, "typlDiagnostic", { enumerable: true, get: function () { return diagnostics_js_1.typlDiagnostic; } });
|
|
16
16
|
var grammar_js_1 = require("./grammar.js");
|
|
17
17
|
Object.defineProperty(exports, "parseTyplBlock", { enumerable: true, get: function () { return grammar_js_1.parseTyplBlock; } });
|
|
18
|
+
var assemble_js_1 = require("./assemble.js");
|
|
19
|
+
Object.defineProperty(exports, "assembleTyplTypes", { enumerable: true, get: function () { return assemble_js_1.assembleTyplTypes; } });
|
|
18
20
|
var fence_js_1 = require("./fence.js");
|
|
19
21
|
Object.defineProperty(exports, "extractTyplFences", { enumerable: true, get: function () { return fence_js_1.extractTyplFences; } });
|
|
20
22
|
var bridge_js_1 = require("./bridge.js");
|
|
21
23
|
Object.defineProperty(exports, "bridgeTyplDiagnostic", { enumerable: true, get: function () { return bridge_js_1.bridgeTyplDiagnostic; } });
|
|
22
24
|
var bullet_js_1 = require("./bullet.js");
|
|
23
|
-
Object.defineProperty(exports, "
|
|
25
|
+
Object.defineProperty(exports, "extractTyplBulletsNested", { enumerable: true, get: function () { return bullet_js_1.extractTyplBulletsNested; } });
|
|
24
26
|
var inline_js_1 = require("./inline.js");
|
|
25
27
|
Object.defineProperty(exports, "extractTyplInlines", { enumerable: true, get: function () { return inline_js_1.extractTyplInlines; } });
|
|
28
|
+
var table_js_1 = require("./table.js");
|
|
29
|
+
Object.defineProperty(exports, "extractTyplTable", { enumerable: true, get: function () { return table_js_1.extractTyplTable; } });
|
|
30
|
+
var citations_js_1 = require("./citations.js");
|
|
31
|
+
Object.defineProperty(exports, "extractTyplCitations", { enumerable: true, get: function () { return citations_js_1.extractTyplCitations; } });
|
|
32
|
+
Object.defineProperty(exports, "isTyplCitationText", { enumerable: true, get: function () { return citations_js_1.isTyplCitationText; } });
|
|
33
|
+
var resolve_js_1 = require("./resolve.js");
|
|
34
|
+
Object.defineProperty(exports, "isPublishedTyplName", { enumerable: true, get: function () { return resolve_js_1.isPublishedTyplName; } });
|
|
35
|
+
Object.defineProperty(exports, "isRelativeTyplName", { enumerable: true, get: function () { return resolve_js_1.isRelativeTyplName; } });
|
|
36
|
+
Object.defineProperty(exports, "TYPL_REF_OPS", { enumerable: true, get: function () { return resolve_js_1.TYPL_REF_OPS; } });
|
|
37
|
+
Object.defineProperty(exports, "typlPathOf", { enumerable: true, get: function () { return resolve_js_1.typlPathOf; } });
|
|
26
38
|
var registry_js_1 = require("./registry.js");
|
|
27
39
|
Object.defineProperty(exports, "buildTypeRegistry", { enumerable: true, get: function () { return registry_js_1.buildTypeRegistry; } });
|
|
28
40
|
var validator_js_1 = require("./validator.js");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module typl/recognize
|
|
3
|
+
*
|
|
4
|
+
* typl declaration recognizer — the DSL-specific predicate the shared
|
|
5
|
+
* declaration-surface machinery (core/decl) is parameterized by. A typl
|
|
6
|
+
* declaration is a binding (`$Name : …`) or a typedef (`type Name = …`).
|
|
7
|
+
* The bullet and inline surfaces share this text recognizer; the fence
|
|
8
|
+
* surface is recognized by its `typl` info-string (see fence.ts).
|
|
9
|
+
*
|
|
10
|
+
* See ADR-019.
|
|
11
|
+
*/
|
|
12
|
+
/** True when `text` begins a typl binding or typedef declaration. */
|
|
13
|
+
export declare function isTyplDeclarationText(text: string): boolean;
|
|
14
|
+
//# sourceMappingURL=recognize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recognize.d.ts","sourceRoot":"","sources":["../../src/typl/recognize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,qEAAqE;AACrE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module typl/recognize
|
|
4
|
+
*
|
|
5
|
+
* typl declaration recognizer — the DSL-specific predicate the shared
|
|
6
|
+
* declaration-surface machinery (core/decl) is parameterized by. A typl
|
|
7
|
+
* declaration is a binding (`$Name : …`) or a typedef (`type Name = …`).
|
|
8
|
+
* The bullet and inline surfaces share this text recognizer; the fence
|
|
9
|
+
* surface is recognized by its `typl` info-string (see fence.ts).
|
|
10
|
+
*
|
|
11
|
+
* See ADR-019.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.isTyplDeclarationText = isTyplDeclarationText;
|
|
15
|
+
/** Matches a typl binding: `$Name :`, `$a.b :` (published), `$.x :` (relative). */
|
|
16
|
+
const BINDING_RE = /^\$\.?[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z0-9_]+)*\s*:/;
|
|
17
|
+
/** Matches a typl typedef: `type Name =`. */
|
|
18
|
+
const TYPEDEF_RE = /^type\s+[A-Za-z_][A-Za-z0-9_]*\s*=/;
|
|
19
|
+
/** True when `text` begins a typl binding or typedef declaration. */
|
|
20
|
+
function isTyplDeclarationText(text) {
|
|
21
|
+
return BINDING_RE.test(text) || TYPEDEF_RE.test(text);
|
|
22
|
+
}
|