@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.
Files changed (414) hide show
  1. package/README.md +2 -2
  2. package/esm/compiler/deserialize.d.ts +49 -0
  3. package/esm/compiler/deserialize.d.ts.map +1 -0
  4. package/esm/compiler/deserialize.js +139 -0
  5. package/esm/compiler/manifest.d.ts +3 -0
  6. package/esm/compiler/manifest.d.ts.map +1 -1
  7. package/esm/compiler/manifest.js +9 -3
  8. package/esm/compiler/mod.d.ts.map +1 -1
  9. package/esm/compiler/mod.js +16 -7
  10. package/esm/config/markspec.d.ts +38 -1
  11. package/esm/config/markspec.d.ts.map +1 -1
  12. package/esm/config/markspec.js +127 -2
  13. package/esm/config/mod.d.ts.map +1 -1
  14. package/esm/config/mod.js +143 -147
  15. package/esm/decl/duplicates.d.ts +29 -0
  16. package/esm/decl/duplicates.d.ts.map +1 -0
  17. package/esm/decl/duplicates.js +28 -0
  18. package/esm/decl/mod.d.ts +20 -0
  19. package/esm/decl/mod.d.ts.map +1 -0
  20. package/esm/decl/mod.js +15 -0
  21. package/esm/decl/resolve.d.ts +104 -0
  22. package/esm/decl/resolve.d.ts.map +1 -0
  23. package/esm/decl/resolve.js +66 -0
  24. package/esm/decl/surfaces.d.ts +118 -0
  25. package/esm/decl/surfaces.d.ts.map +1 -0
  26. package/esm/decl/surfaces.js +135 -0
  27. package/esm/decl/table.d.ts +50 -0
  28. package/esm/decl/table.d.ts.map +1 -0
  29. package/esm/decl/table.js +124 -0
  30. package/esm/gates/mod.d.ts +13 -2
  31. package/esm/gates/mod.d.ts.map +1 -1
  32. package/esm/gates/mod.js +38 -11
  33. package/esm/lint/runner.d.ts.map +1 -1
  34. package/esm/lint/runner.js +3 -1
  35. package/esm/lock/acquire_compile.d.ts +31 -0
  36. package/esm/lock/acquire_compile.d.ts.map +1 -0
  37. package/esm/lock/acquire_compile.js +83 -0
  38. package/esm/lock/cache_check.d.ts +28 -0
  39. package/esm/lock/cache_check.d.ts.map +1 -0
  40. package/esm/lock/cache_check.js +51 -0
  41. package/esm/lock/check.d.ts +14 -3
  42. package/esm/lock/check.d.ts.map +1 -1
  43. package/esm/lock/check.js +41 -3
  44. package/esm/lock/git_intent.d.ts +46 -0
  45. package/esm/lock/git_intent.d.ts.map +1 -0
  46. package/esm/lock/git_intent.js +111 -0
  47. package/esm/lock/mod.d.ts +10 -3
  48. package/esm/lock/mod.d.ts.map +1 -1
  49. package/esm/lock/mod.js +7 -1
  50. package/esm/lock/model.d.ts +24 -1
  51. package/esm/lock/model.d.ts.map +1 -1
  52. package/esm/lock/parser.d.ts.map +1 -1
  53. package/esm/lock/parser.js +32 -0
  54. package/esm/lock/pin_assurance.d.ts +20 -0
  55. package/esm/lock/pin_assurance.d.ts.map +1 -0
  56. package/esm/lock/pin_assurance.js +34 -0
  57. package/esm/lock/resolve.d.ts +8 -17
  58. package/esm/lock/resolve.d.ts.map +1 -1
  59. package/esm/lock/resolve.js +7 -67
  60. package/esm/lock/serializer.d.ts.map +1 -1
  61. package/esm/lock/serializer.js +23 -0
  62. package/esm/lock/upstream_common.d.ts +29 -0
  63. package/esm/lock/upstream_common.d.ts.map +1 -0
  64. package/esm/lock/upstream_common.js +38 -0
  65. package/esm/lock/upstream_deps.d.ts +63 -0
  66. package/esm/lock/upstream_deps.d.ts.map +1 -0
  67. package/esm/lock/upstream_deps.js +172 -0
  68. package/esm/lock/upstream_refs.d.ts +69 -0
  69. package/esm/lock/upstream_refs.d.ts.map +1 -0
  70. package/esm/lock/upstream_refs.js +238 -0
  71. package/esm/mod.d.ts +16 -8
  72. package/esm/mod.d.ts.map +1 -1
  73. package/esm/mod.js +15 -5
  74. package/esm/model/mod.d.ts +93 -28
  75. package/esm/model/mod.d.ts.map +1 -1
  76. package/esm/model/mod.js +66 -13
  77. package/esm/model/profile.d.ts +13 -0
  78. package/esm/model/profile.d.ts.map +1 -1
  79. package/esm/parser/directives.d.ts +6 -0
  80. package/esm/parser/directives.d.ts.map +1 -1
  81. package/esm/parser/directives.js +17 -0
  82. package/esm/parser/markdown.d.ts.map +1 -1
  83. package/esm/parser/markdown.js +16 -51
  84. package/esm/profile/manifest.d.ts.map +1 -1
  85. package/esm/profile/manifest.js +20 -3
  86. package/esm/profile/merge.js +7 -0
  87. package/esm/reporter/mod.d.ts +11 -0
  88. package/esm/reporter/mod.d.ts.map +1 -1
  89. package/esm/reporter/mod.js +19 -8
  90. package/esm/typl/assemble.d.ts +53 -0
  91. package/esm/typl/assemble.d.ts.map +1 -0
  92. package/esm/typl/assemble.js +238 -0
  93. package/esm/typl/ast.d.ts +7 -1
  94. package/esm/typl/ast.d.ts.map +1 -1
  95. package/esm/typl/ast.js +3 -0
  96. package/esm/typl/bullet.d.ts +16 -24
  97. package/esm/typl/bullet.d.ts.map +1 -1
  98. package/esm/typl/bullet.js +9 -41
  99. package/esm/typl/citations.d.ts +27 -0
  100. package/esm/typl/citations.d.ts.map +1 -0
  101. package/esm/typl/citations.js +16 -0
  102. package/esm/typl/diagnostics.d.ts +2 -2
  103. package/esm/typl/diagnostics.d.ts.map +1 -1
  104. package/esm/typl/diagnostics.js +18 -0
  105. package/esm/typl/fence.d.ts +12 -21
  106. package/esm/typl/fence.d.ts.map +1 -1
  107. package/esm/typl/fence.js +5 -20
  108. package/esm/typl/grammar.d.ts.map +1 -1
  109. package/esm/typl/grammar.js +6 -0
  110. package/esm/typl/inline.d.ts +15 -24
  111. package/esm/typl/inline.d.ts.map +1 -1
  112. package/esm/typl/inline.js +6 -44
  113. package/esm/typl/lexer.d.ts.map +1 -1
  114. package/esm/typl/lexer.js +25 -4
  115. package/esm/typl/mod.d.ts +8 -2
  116. package/esm/typl/mod.d.ts.map +1 -1
  117. package/esm/typl/mod.js +5 -1
  118. package/esm/typl/recognize.d.ts +14 -0
  119. package/esm/typl/recognize.d.ts.map +1 -0
  120. package/esm/typl/recognize.js +19 -0
  121. package/esm/typl/registry.d.ts +1 -1
  122. package/esm/typl/resolve.d.ts +31 -0
  123. package/esm/typl/resolve.d.ts.map +1 -0
  124. package/esm/typl/resolve.js +27 -0
  125. package/esm/typl/table.d.ts +52 -0
  126. package/esm/typl/table.d.ts.map +1 -0
  127. package/esm/typl/table.js +69 -0
  128. package/esm/typl/validator.d.ts +24 -5
  129. package/esm/typl/validator.d.ts.map +1 -1
  130. package/esm/typl/validator.js +55 -75
  131. package/esm/upstream/mod.d.ts +45 -0
  132. package/esm/upstream/mod.d.ts.map +1 -0
  133. package/esm/upstream/mod.js +98 -0
  134. package/esm/upstream/project.d.ts +33 -0
  135. package/esm/upstream/project.d.ts.map +1 -0
  136. package/esm/upstream/project.js +38 -0
  137. package/esm/upstream/refs.d.ts +23 -0
  138. package/esm/upstream/refs.d.ts.map +1 -0
  139. package/esm/upstream/refs.js +71 -0
  140. package/esm/util/paths.d.ts +14 -0
  141. package/esm/util/paths.d.ts.map +1 -0
  142. package/esm/util/paths.js +22 -0
  143. package/esm/uxil/assemble.d.ts +38 -0
  144. package/esm/uxil/assemble.d.ts.map +1 -0
  145. package/esm/uxil/assemble.js +268 -0
  146. package/esm/uxil/ast.d.ts +63 -0
  147. package/esm/uxil/ast.d.ts.map +1 -0
  148. package/esm/uxil/ast.js +9 -0
  149. package/esm/uxil/citations.d.ts +27 -0
  150. package/esm/uxil/citations.d.ts.map +1 -0
  151. package/esm/uxil/citations.js +25 -0
  152. package/esm/uxil/diagnostics.d.ts +39 -0
  153. package/esm/uxil/diagnostics.d.ts.map +1 -0
  154. package/esm/uxil/diagnostics.js +135 -0
  155. package/esm/uxil/grammar.d.ts +72 -0
  156. package/esm/uxil/grammar.d.ts.map +1 -0
  157. package/esm/uxil/grammar.js +505 -0
  158. package/esm/uxil/lexer.d.ts +23 -0
  159. package/esm/uxil/lexer.d.ts.map +1 -0
  160. package/esm/uxil/lexer.js +58 -0
  161. package/esm/uxil/mod.d.ts +32 -0
  162. package/esm/uxil/mod.d.ts.map +1 -0
  163. package/esm/uxil/mod.js +11 -0
  164. package/esm/uxil/projection.d.ts +40 -0
  165. package/esm/uxil/projection.d.ts.map +1 -0
  166. package/esm/uxil/projection.js +41 -0
  167. package/esm/uxil/recognize.d.ts +16 -0
  168. package/esm/uxil/recognize.d.ts.map +1 -0
  169. package/esm/uxil/recognize.js +28 -0
  170. package/esm/uxil/registry.d.ts +37 -0
  171. package/esm/uxil/registry.d.ts.map +1 -0
  172. package/esm/uxil/registry.js +29 -0
  173. package/esm/uxil/surfaces.d.ts +36 -0
  174. package/esm/uxil/surfaces.d.ts.map +1 -0
  175. package/esm/uxil/surfaces.js +34 -0
  176. package/esm/uxil/validator.d.ts +36 -0
  177. package/esm/uxil/validator.d.ts.map +1 -0
  178. package/esm/uxil/validator.js +139 -0
  179. package/esm/uxil/vocab.d.ts +33 -0
  180. package/esm/uxil/vocab.d.ts.map +1 -0
  181. package/esm/uxil/vocab.js +36 -0
  182. package/esm/validator/body_blocks.d.ts.map +1 -1
  183. package/esm/validator/body_blocks.js +3 -9
  184. package/esm/validator/caption_convention.d.ts +2 -1
  185. package/esm/validator/caption_convention.d.ts.map +1 -1
  186. package/esm/validator/caption_convention.js +2 -1
  187. package/esm/validator/corpus.d.ts.map +1 -1
  188. package/esm/validator/corpus.js +40 -17
  189. package/esm/validator/discipline.d.ts +6 -4
  190. package/esm/validator/discipline.d.ts.map +1 -1
  191. package/esm/validator/discipline.js +6 -4
  192. package/esm/validator/mod.d.ts.map +1 -1
  193. package/esm/validator/mod.js +28 -15
  194. package/esm/validator/pipeline.d.ts +11 -1
  195. package/esm/validator/pipeline.d.ts.map +1 -1
  196. package/esm/validator/pipeline.js +68 -18
  197. package/esm/validator/trace_types.d.ts +9 -2
  198. package/esm/validator/trace_types.d.ts.map +1 -1
  199. package/esm/validator/trace_types.js +21 -5
  200. package/esm/validator/traceability.d.ts +15 -3
  201. package/esm/validator/traceability.d.ts.map +1 -1
  202. package/esm/validator/traceability.js +39 -4
  203. package/esm/validator/types.d.ts.map +1 -1
  204. package/esm/validator/types.js +11 -1
  205. package/esm/validator/uxil_family.d.ts +43 -0
  206. package/esm/validator/uxil_family.d.ts.map +1 -0
  207. package/esm/validator/uxil_family.js +52 -0
  208. package/package.json +1 -1
  209. package/script/compiler/deserialize.d.ts +49 -0
  210. package/script/compiler/deserialize.d.ts.map +1 -0
  211. package/script/compiler/deserialize.js +144 -0
  212. package/script/compiler/manifest.d.ts +3 -0
  213. package/script/compiler/manifest.d.ts.map +1 -1
  214. package/script/compiler/manifest.js +10 -3
  215. package/script/compiler/mod.d.ts.map +1 -1
  216. package/script/compiler/mod.js +15 -6
  217. package/script/config/markspec.d.ts +38 -1
  218. package/script/config/markspec.d.ts.map +1 -1
  219. package/script/config/markspec.js +129 -3
  220. package/script/config/mod.d.ts.map +1 -1
  221. package/script/config/mod.js +143 -147
  222. package/script/decl/duplicates.d.ts +29 -0
  223. package/script/decl/duplicates.d.ts.map +1 -0
  224. package/script/decl/duplicates.js +31 -0
  225. package/script/decl/mod.d.ts +20 -0
  226. package/script/decl/mod.d.ts.map +1 -0
  227. package/script/decl/mod.js +26 -0
  228. package/script/decl/resolve.d.ts +104 -0
  229. package/script/decl/resolve.d.ts.map +1 -0
  230. package/script/decl/resolve.js +70 -0
  231. package/script/decl/surfaces.d.ts +118 -0
  232. package/script/decl/surfaces.d.ts.map +1 -0
  233. package/script/decl/surfaces.js +141 -0
  234. package/script/decl/table.d.ts +50 -0
  235. package/script/decl/table.d.ts.map +1 -0
  236. package/script/decl/table.js +127 -0
  237. package/script/gates/mod.d.ts +13 -2
  238. package/script/gates/mod.d.ts.map +1 -1
  239. package/script/gates/mod.js +37 -10
  240. package/script/lint/runner.d.ts.map +1 -1
  241. package/script/lint/runner.js +3 -1
  242. package/script/lock/acquire_compile.d.ts +31 -0
  243. package/script/lock/acquire_compile.d.ts.map +1 -0
  244. package/script/lock/acquire_compile.js +86 -0
  245. package/script/lock/cache_check.d.ts +28 -0
  246. package/script/lock/cache_check.d.ts.map +1 -0
  247. package/script/lock/cache_check.js +54 -0
  248. package/script/lock/check.d.ts +14 -3
  249. package/script/lock/check.d.ts.map +1 -1
  250. package/script/lock/check.js +41 -3
  251. package/script/lock/git_intent.d.ts +46 -0
  252. package/script/lock/git_intent.d.ts.map +1 -0
  253. package/script/lock/git_intent.js +115 -0
  254. package/script/lock/mod.d.ts +10 -3
  255. package/script/lock/mod.d.ts.map +1 -1
  256. package/script/lock/mod.js +16 -2
  257. package/script/lock/model.d.ts +24 -1
  258. package/script/lock/model.d.ts.map +1 -1
  259. package/script/lock/parser.d.ts.map +1 -1
  260. package/script/lock/parser.js +32 -0
  261. package/script/lock/pin_assurance.d.ts +20 -0
  262. package/script/lock/pin_assurance.d.ts.map +1 -0
  263. package/script/lock/pin_assurance.js +37 -0
  264. package/script/lock/resolve.d.ts +8 -17
  265. package/script/lock/resolve.d.ts.map +1 -1
  266. package/script/lock/resolve.js +7 -68
  267. package/script/lock/serializer.d.ts.map +1 -1
  268. package/script/lock/serializer.js +23 -0
  269. package/script/lock/upstream_common.d.ts +29 -0
  270. package/script/lock/upstream_common.d.ts.map +1 -0
  271. package/script/lock/upstream_common.js +42 -0
  272. package/script/lock/upstream_deps.d.ts +63 -0
  273. package/script/lock/upstream_deps.d.ts.map +1 -0
  274. package/script/lock/upstream_deps.js +175 -0
  275. package/script/lock/upstream_refs.d.ts +69 -0
  276. package/script/lock/upstream_refs.d.ts.map +1 -0
  277. package/script/lock/upstream_refs.js +244 -0
  278. package/script/mod.d.ts +16 -8
  279. package/script/mod.d.ts.map +1 -1
  280. package/script/mod.js +40 -7
  281. package/script/model/mod.d.ts +93 -28
  282. package/script/model/mod.d.ts.map +1 -1
  283. package/script/model/mod.js +70 -14
  284. package/script/model/profile.d.ts +13 -0
  285. package/script/model/profile.d.ts.map +1 -1
  286. package/script/parser/directives.d.ts +6 -0
  287. package/script/parser/directives.d.ts.map +1 -1
  288. package/script/parser/directives.js +18 -0
  289. package/script/parser/markdown.d.ts.map +1 -1
  290. package/script/parser/markdown.js +15 -50
  291. package/script/profile/manifest.d.ts.map +1 -1
  292. package/script/profile/manifest.js +20 -3
  293. package/script/profile/merge.js +7 -0
  294. package/script/reporter/mod.d.ts +11 -0
  295. package/script/reporter/mod.d.ts.map +1 -1
  296. package/script/reporter/mod.js +18 -7
  297. package/script/typl/assemble.d.ts +53 -0
  298. package/script/typl/assemble.d.ts.map +1 -0
  299. package/script/typl/assemble.js +241 -0
  300. package/script/typl/ast.d.ts +7 -1
  301. package/script/typl/ast.d.ts.map +1 -1
  302. package/script/typl/ast.js +3 -0
  303. package/script/typl/bullet.d.ts +16 -24
  304. package/script/typl/bullet.d.ts.map +1 -1
  305. package/script/typl/bullet.js +10 -42
  306. package/script/typl/citations.d.ts +27 -0
  307. package/script/typl/citations.d.ts.map +1 -0
  308. package/script/typl/citations.js +20 -0
  309. package/script/typl/diagnostics.d.ts +2 -2
  310. package/script/typl/diagnostics.d.ts.map +1 -1
  311. package/script/typl/diagnostics.js +18 -0
  312. package/script/typl/fence.d.ts +12 -21
  313. package/script/typl/fence.d.ts.map +1 -1
  314. package/script/typl/fence.js +5 -20
  315. package/script/typl/grammar.d.ts.map +1 -1
  316. package/script/typl/grammar.js +6 -0
  317. package/script/typl/inline.d.ts +15 -24
  318. package/script/typl/inline.d.ts.map +1 -1
  319. package/script/typl/inline.js +6 -44
  320. package/script/typl/lexer.d.ts.map +1 -1
  321. package/script/typl/lexer.js +25 -4
  322. package/script/typl/mod.d.ts +8 -2
  323. package/script/typl/mod.d.ts.map +1 -1
  324. package/script/typl/mod.js +14 -2
  325. package/script/typl/recognize.d.ts +14 -0
  326. package/script/typl/recognize.d.ts.map +1 -0
  327. package/script/typl/recognize.js +22 -0
  328. package/script/typl/registry.d.ts +1 -1
  329. package/script/typl/resolve.d.ts +31 -0
  330. package/script/typl/resolve.d.ts.map +1 -0
  331. package/script/typl/resolve.js +33 -0
  332. package/script/typl/table.d.ts +52 -0
  333. package/script/typl/table.d.ts.map +1 -0
  334. package/script/typl/table.js +75 -0
  335. package/script/typl/validator.d.ts +24 -5
  336. package/script/typl/validator.d.ts.map +1 -1
  337. package/script/typl/validator.js +55 -75
  338. package/script/upstream/mod.d.ts +45 -0
  339. package/script/upstream/mod.d.ts.map +1 -0
  340. package/script/upstream/mod.js +101 -0
  341. package/script/upstream/project.d.ts +33 -0
  342. package/script/upstream/project.d.ts.map +1 -0
  343. package/script/upstream/project.js +41 -0
  344. package/script/upstream/refs.d.ts +23 -0
  345. package/script/upstream/refs.d.ts.map +1 -0
  346. package/script/upstream/refs.js +74 -0
  347. package/script/util/paths.d.ts +14 -0
  348. package/script/util/paths.d.ts.map +1 -0
  349. package/script/util/paths.js +25 -0
  350. package/script/uxil/assemble.d.ts +38 -0
  351. package/script/uxil/assemble.d.ts.map +1 -0
  352. package/script/uxil/assemble.js +272 -0
  353. package/script/uxil/ast.d.ts +63 -0
  354. package/script/uxil/ast.d.ts.map +1 -0
  355. package/script/uxil/ast.js +10 -0
  356. package/script/uxil/citations.d.ts +27 -0
  357. package/script/uxil/citations.d.ts.map +1 -0
  358. package/script/uxil/citations.js +29 -0
  359. package/script/uxil/diagnostics.d.ts +39 -0
  360. package/script/uxil/diagnostics.d.ts.map +1 -0
  361. package/script/uxil/diagnostics.js +140 -0
  362. package/script/uxil/grammar.d.ts +72 -0
  363. package/script/uxil/grammar.d.ts.map +1 -0
  364. package/script/uxil/grammar.js +511 -0
  365. package/script/uxil/lexer.d.ts +23 -0
  366. package/script/uxil/lexer.d.ts.map +1 -0
  367. package/script/uxil/lexer.js +61 -0
  368. package/script/uxil/mod.d.ts +32 -0
  369. package/script/uxil/mod.d.ts.map +1 -0
  370. package/script/uxil/mod.js +37 -0
  371. package/script/uxil/projection.d.ts +40 -0
  372. package/script/uxil/projection.d.ts.map +1 -0
  373. package/script/uxil/projection.js +44 -0
  374. package/script/uxil/recognize.d.ts +16 -0
  375. package/script/uxil/recognize.d.ts.map +1 -0
  376. package/script/uxil/recognize.js +31 -0
  377. package/script/uxil/registry.d.ts +37 -0
  378. package/script/uxil/registry.d.ts.map +1 -0
  379. package/script/uxil/registry.js +32 -0
  380. package/script/uxil/surfaces.d.ts +36 -0
  381. package/script/uxil/surfaces.d.ts.map +1 -0
  382. package/script/uxil/surfaces.js +39 -0
  383. package/script/uxil/validator.d.ts +36 -0
  384. package/script/uxil/validator.d.ts.map +1 -0
  385. package/script/uxil/validator.js +142 -0
  386. package/script/uxil/vocab.d.ts +33 -0
  387. package/script/uxil/vocab.d.ts.map +1 -0
  388. package/script/uxil/vocab.js +41 -0
  389. package/script/validator/body_blocks.d.ts.map +1 -1
  390. package/script/validator/body_blocks.js +3 -9
  391. package/script/validator/caption_convention.d.ts +2 -1
  392. package/script/validator/caption_convention.d.ts.map +1 -1
  393. package/script/validator/caption_convention.js +2 -1
  394. package/script/validator/corpus.d.ts.map +1 -1
  395. package/script/validator/corpus.js +39 -16
  396. package/script/validator/discipline.d.ts +6 -4
  397. package/script/validator/discipline.d.ts.map +1 -1
  398. package/script/validator/discipline.js +6 -4
  399. package/script/validator/mod.d.ts.map +1 -1
  400. package/script/validator/mod.js +27 -14
  401. package/script/validator/pipeline.d.ts +11 -1
  402. package/script/validator/pipeline.d.ts.map +1 -1
  403. package/script/validator/pipeline.js +67 -17
  404. package/script/validator/trace_types.d.ts +9 -2
  405. package/script/validator/trace_types.d.ts.map +1 -1
  406. package/script/validator/trace_types.js +20 -4
  407. package/script/validator/traceability.d.ts +15 -3
  408. package/script/validator/traceability.d.ts.map +1 -1
  409. package/script/validator/traceability.js +38 -3
  410. package/script/validator/types.d.ts.map +1 -1
  411. package/script/validator/types.js +10 -0
  412. package/script/validator/uxil_family.d.ts +43 -0
  413. package/script/validator/uxil_family.d.ts.map +1 -0
  414. package/script/validator/uxil_family.js +56 -0
@@ -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 matches typl syntax (`$X : ...` binding
6
- * or `type X = ...` typedef). Mixed lists are supported: items that
7
- * match are treated as typl declarations; non-matching bullets are
8
- * left alone.
9
- *
10
- * Each matching item produces one TyplBulletExtraction; the parser
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, SourceRange } from "../ast/nodes.js";
18
- /** A single typl bullet item found inside a body. */
19
- export interface TyplBulletExtraction {
20
- /** The typl source from one matching bullet item (paragraph text). */
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
- * paragraph matches typl syntax. Recurses through ListNode →
28
- * ListItemNode.blocks for nested lists (typl bullets inside a nested
29
- * list are picked up).
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 extractTyplBullets(blocks: readonly BodyBlock[]): readonly TyplBulletExtraction[];
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;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,SAAS,EAAiB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,qDAAqD;AACrD,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAYD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,oBAAoB,EAAE,CA0BjC"}
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"}
@@ -1,47 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractTyplBullets = extractTyplBullets;
4
- /** Matches a typl binding bullet (paragraph text). */
5
- const BULLET_BINDING_RE = /^\$[A-Za-z_][A-Za-z0-9_]*\s*:/;
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
- * paragraph matches typl syntax. Recurses through ListNode →
14
- * ListItemNode.blocks for nested lists (typl bullets inside a nested
15
- * list are picked up).
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 extractTyplBullets(blocks) {
20
- const results = [];
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-008). Each code carries a severity and a template; the
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,CAqCtD,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"}
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
@@ -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". Operates on the canonical body AST
6
- * (BodyBlock[]) produced by core/ast/build.ts.
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
- * This module is parser-side only — it returns the raw typl source and
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, SourceRange } from "../ast/nodes.js";
13
- /** A single typl fence found inside a body. */
14
- export interface TyplFenceExtraction {
15
- /** The verbatim typl source from inside the fence (CodeNode.text). */
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. Recurses into
22
- * container nodes (ListNode via ListItemNode.blocks) so typl fences
23
- * nested inside list items are discovered.
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,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9D,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,mBAAmB,EAAE,CAYhC"}
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"}
@@ -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. Recurses into
6
- * container nodes (ListNode via ListItemNode.blocks) so typl fences
7
- * nested inside list items are discovered.
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
- const results = [];
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;AAufvE;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GACb;IAAE,GAAG,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAA;CAAE,CAK5D"}
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"}
@@ -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,
@@ -1,34 +1,25 @@
1
1
  /**
2
2
  * @module typl/inline
3
3
  *
4
- * Inline backtick surface adapter — recognises typl declarations
5
- * wrapped in CommonMark code spans, e.g. `` `$X : signal float[0..300]` ``
6
- * scattered through entry prose.
7
- *
8
- * Filters Entry.bodyTokens (ADR-016) for `inline-code` tokens whose text
9
- * matches typl syntax. Each matching span produces one
10
- * TyplInlineExtraction; the parser integration calls parseTyplBlock on
11
- * each `source` independently.
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, SourceLocation } from "../model/mod.js";
16
- /** A single typl inline-code declaration found in an entry body. */
17
- export interface TyplInlineExtraction {
18
- /** The typl source from one matching code span (text between backticks). */
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 match typl
25
- * syntax. Returns extractions in source order (the bodyTokens contract
26
- * guarantees source order).
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,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE,oEAAoE;AACpE,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC;AAgCD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,SAAS,oBAAoB,EAAE,CASjC"}
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"}
@@ -1,51 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractTyplInlines = extractTyplInlines;
4
- /** Matches a typl binding span (code-span text). */
5
- const INLINE_BINDING_RE = /^\$[A-Za-z_][A-Za-z0-9_]*\s*:/;
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 match typl
32
- * syntax. Returns extractions in source order (the bodyTokens contract
33
- * guarantees source order).
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
- const results = [];
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,CAgNpD"}
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"}
@@ -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
- while (i < source.length && IDENT_BODY_RE.test(source[i])) {
91
- value += source[i];
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
  }
@@ -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 { TyplBulletExtraction } from "./bullet.js";
17
- export { extractTyplBullets } from "./bullet.js";
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";
@@ -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,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,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"}
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"}
@@ -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.extractTyplBullets = exports.bridgeTyplDiagnostic = exports.extractTyplFences = exports.parseTyplBlock = exports.typlDiagnostic = exports.TYPL_CODES = exports.KINDS = void 0;
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, "extractTyplBullets", { enumerable: true, get: function () { return bullet_js_1.extractTyplBullets; } });
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
+ }