@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
@@ -0,0 +1,511 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseUxRef = parseUxRef;
4
+ exports.parseRootDecl = parseRootDecl;
5
+ exports.parseChildSurfaceDecl = parseChildSurfaceDecl;
6
+ exports.parseElementBullet = parseElementBullet;
7
+ const lexer_js_1 = require("./lexer.js");
8
+ const diagnostics_js_1 = require("./diagnostics.js");
9
+ /** A forward-only cursor over a `Token[]`. */
10
+ class Cursor {
11
+ constructor(tokens) {
12
+ Object.defineProperty(this, "tokens", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: tokens
17
+ });
18
+ Object.defineProperty(this, "i", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: 0
23
+ });
24
+ }
25
+ peek() {
26
+ return this.tokens[this.i];
27
+ }
28
+ peekAt(n) {
29
+ return this.tokens[Math.min(this.i + n, this.tokens.length - 1)];
30
+ }
31
+ advance() {
32
+ const t = this.tokens[this.i];
33
+ if (this.i < this.tokens.length - 1)
34
+ this.i++;
35
+ return t;
36
+ }
37
+ atEof() {
38
+ return this.peek().kind === "EOF";
39
+ }
40
+ }
41
+ /**
42
+ * Push UXIL-002 for a reserved `?`/`#` character anywhere in `source`.
43
+ * Returns whether one was found — callers stop structural parsing on a hit,
44
+ * because the lexer silently drops the char and every diagnostic derived
45
+ * from the mangled token stream would be noise (#780). `baseColumn` shifts
46
+ * the reported column for callers scanning a slice of a larger source (the
47
+ * peeled `-> nav` tail, or a code span offset into its paragraph — #781),
48
+ * keeping positions relative to the caller's chosen origin.
49
+ */
50
+ function scanReservedChars(source, diags, baseColumn = 0) {
51
+ const idx = source.search(/[?#]/);
52
+ if (idx >= 0) {
53
+ diags.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-002", { char: source[idx] }, {
54
+ line: 1,
55
+ column: baseColumn + idx + 1,
56
+ }));
57
+ return true;
58
+ }
59
+ return false;
60
+ }
61
+ /** Consume `IDENT`, or push UXIL-001 describing what was expected. */
62
+ function expectIdent(c, diags, what) {
63
+ if (c.peek().kind === "IDENT")
64
+ return c.advance().value;
65
+ diags.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-001", { detail: `expected ${what}` }, c.peek().position));
66
+ return undefined;
67
+ }
68
+ /** Parse `segment *("." segment)`; `undefined` when no leading segment. */
69
+ function parseSurface(c, diags) {
70
+ if (c.peek().kind !== "IDENT")
71
+ return undefined;
72
+ const segments = [c.advance().value];
73
+ while (c.peek().kind === "DOT") {
74
+ c.advance();
75
+ if (c.peek().kind !== "IDENT") {
76
+ diags.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-008", { detail: "trailing '.' in surface" }, c.peek().position));
77
+ break;
78
+ }
79
+ segments.push(c.advance().value);
80
+ }
81
+ return segments;
82
+ }
83
+ /** Parse a ref key after `:` — a `{name}` template or a concrete value. */
84
+ function parseKey(c, diags) {
85
+ if (c.peek().kind === "LBRACE") {
86
+ c.advance();
87
+ if (c.peek().kind !== "IDENT") {
88
+ diags.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-007", { detail: "expected a name inside { }" }, c.peek().position));
89
+ return undefined;
90
+ }
91
+ const name = c.advance().value;
92
+ if (c.peek().kind !== "RBRACE") {
93
+ diags.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-007", { detail: "missing closing '}'" }, c.peek().position));
94
+ return undefined;
95
+ }
96
+ c.advance();
97
+ return { kind: "template", name };
98
+ }
99
+ if (c.peek().kind === "IDENT") {
100
+ return { kind: "concrete", value: c.advance().value };
101
+ }
102
+ diags.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-001", { detail: "expected a key after ':'" }, c.peek().position));
103
+ return undefined;
104
+ }
105
+ /**
106
+ * Consume a leading `ux:` scheme if present. Returns whether it was consumed.
107
+ * Known limitation (#780 case 6, S7 design doc): a surface literally named
108
+ * `ux` followed by `:` is greedily read as the scheme, so
109
+ * `parseRootDecl("ux : screen")` misparses. Revisit only if a real
110
+ * `ux`-named surface is ever needed.
111
+ */
112
+ function consumeScheme(c) {
113
+ if (c.peek().kind === "IDENT" && c.peek().value === "ux" &&
114
+ c.peekAt(1).kind === "COLON") {
115
+ c.advance();
116
+ c.advance();
117
+ return true;
118
+ }
119
+ return false;
120
+ }
121
+ /**
122
+ * Push UXIL-001 for any leftover tokens before EOF. No-ops when a prior
123
+ * diagnostic exists — a specific parse error already explains the malformed
124
+ * tail, and re-flagging the leftovers produced the redundant second code
125
+ * (#780). One clear error per span; the editor reparses on the next edit.
126
+ */
127
+ function expectEof(c, diags) {
128
+ if (diags.length > 0)
129
+ return;
130
+ if (!c.atEof()) {
131
+ const t = c.peek();
132
+ diags.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-001", {
133
+ detail: `unexpected '${t.value || t.kind}'`,
134
+ }, t.position));
135
+ }
136
+ }
137
+ /** Parse an optional `@state, state, …` set; empty array when absent. */
138
+ function parseStateSet(c, diags) {
139
+ const states = [];
140
+ if (c.peek().kind !== "AT")
141
+ return states;
142
+ c.advance();
143
+ const first = expectIdent(c, diags, "state");
144
+ if (first !== undefined)
145
+ states.push(first);
146
+ while (c.peek().kind === "COMMA") {
147
+ c.advance();
148
+ const s = expectIdent(c, diags, "state");
149
+ if (s !== undefined)
150
+ states.push(s);
151
+ }
152
+ return states;
153
+ }
154
+ /**
155
+ * Parse a `ux:` reference (citation / nav target). The scheme is optional;
156
+ * `media.home/play` and `ux:media.home/play` yield identical AST except for
157
+ * `hasScheme`. Returns `ref` undefined only for a wholly malformed input
158
+ * (reserved char, reserved authority, no surface).
159
+ */
160
+ function parseUxRef(source) {
161
+ const diagnostics = [];
162
+ if (scanReservedChars(source, diagnostics))
163
+ return { diagnostics };
164
+ const c = new Cursor((0, lexer_js_1.tokenize)(source));
165
+ const hasScheme = consumeScheme(c);
166
+ // Reserved authority: a `/` where a surface segment is required.
167
+ if (c.peek().kind === "SLASH") {
168
+ if (c.peekAt(1).kind === "SLASH") {
169
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-003", {}, c.peek().position));
170
+ }
171
+ else {
172
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-008", { detail: "missing surface" }, c.peek().position));
173
+ }
174
+ return { diagnostics };
175
+ }
176
+ const surface = parseSurface(c, diagnostics);
177
+ if (!surface) {
178
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-008", { detail: "expected a surface segment" }, c.peek().position));
179
+ return { diagnostics };
180
+ }
181
+ const ref = {
182
+ hasScheme,
183
+ surface,
184
+ position: { line: 1, column: 1 },
185
+ };
186
+ if (c.peek().kind === "AT") {
187
+ c.advance();
188
+ const s = expectIdent(c, diagnostics, "state");
189
+ if (s !== undefined)
190
+ ref.state = s;
191
+ }
192
+ if (c.peek().kind === "SLASH") {
193
+ c.advance();
194
+ const el = expectIdent(c, diagnostics, "element");
195
+ if (el !== undefined)
196
+ ref.element = el;
197
+ if (c.peek().kind === "COLON") {
198
+ c.advance();
199
+ const k = parseKey(c, diagnostics);
200
+ if (k)
201
+ ref.key = k;
202
+ }
203
+ if (c.peek().kind === "BANG") {
204
+ c.advance();
205
+ const v = expectIdent(c, diagnostics, "verb");
206
+ if (v !== undefined)
207
+ ref.verb = v;
208
+ }
209
+ }
210
+ expectEof(c, diagnostics);
211
+ return { ref, diagnostics };
212
+ }
213
+ /**
214
+ * Parse a root declaration: `[ux:]surface : kind [@state, …]`. The `:` here
215
+ * introduces the kind (not a ref key). Returns `decl` undefined only when no
216
+ * surface is present or a reserved char corrupted the source. A missing kind
217
+ * (no `:`, or a `:` with nothing after it) is UXIL-004 with a best-effort
218
+ * partial decl (`kind: ""`, surface and states still captured) — S8's
219
+ * assemble must gate uxRegistry registration on a clean parse, never on the
220
+ * partial decl alone (#780).
221
+ */
222
+ function parseRootDecl(source) {
223
+ const diagnostics = [];
224
+ if (scanReservedChars(source, diagnostics))
225
+ return { diagnostics };
226
+ const c = new Cursor((0, lexer_js_1.tokenize)(source));
227
+ consumeScheme(c);
228
+ const surface = parseSurface(c, diagnostics);
229
+ if (!surface) {
230
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-008", { detail: "expected a surface segment" }, c.peek().position));
231
+ return { diagnostics };
232
+ }
233
+ // Missing kind — with or without the introducing `:` — is the same defect
234
+ // (#780 case 5): one UXIL-004, one partial-decl return shape.
235
+ let kind;
236
+ if (c.peek().kind !== "COLON") {
237
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-004", {}, c.peek().position));
238
+ }
239
+ else {
240
+ c.advance();
241
+ if (c.peek().kind === "IDENT") {
242
+ kind = c.advance().value;
243
+ }
244
+ else {
245
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-004", {}, c.peek().position));
246
+ }
247
+ }
248
+ const states = parseStateSet(c, diagnostics);
249
+ expectEof(c, diagnostics);
250
+ return {
251
+ decl: {
252
+ form: "root",
253
+ surface,
254
+ kind: kind ?? "",
255
+ states,
256
+ position: { line: 1, column: 1 },
257
+ },
258
+ diagnostics,
259
+ };
260
+ }
261
+ /**
262
+ * Parse a child-surface declaration: `.path[.seg…] [@state, …]`. The leading
263
+ * dot marks containment; nested bullets (its elements) are stitched in S8.
264
+ * There is no kind or verb set — kind is inherited (S8).
265
+ */
266
+ function parseChildSurfaceDecl(source) {
267
+ const diagnostics = [];
268
+ if (scanReservedChars(source, diagnostics))
269
+ return { diagnostics };
270
+ const c = new Cursor((0, lexer_js_1.tokenize)(source));
271
+ if (c.peek().kind !== "DOT") {
272
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-008", { detail: "child surface must start with '.'" }, c.peek().position));
273
+ return { diagnostics };
274
+ }
275
+ c.advance();
276
+ const path = parseSurface(c, diagnostics);
277
+ if (!path) {
278
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-008", { detail: "expected a child surface name after '.'" }, c.peek().position));
279
+ return { diagnostics };
280
+ }
281
+ const states = parseStateSet(c, diagnostics);
282
+ expectEof(c, diagnostics);
283
+ const decl = {
284
+ form: "child",
285
+ path,
286
+ position: { line: 1, column: 1 },
287
+ };
288
+ if (states.length > 0)
289
+ decl.states = states;
290
+ return { decl, diagnostics };
291
+ }
292
+ /**
293
+ * Split the leading inline code span from the rest of a bullet paragraph.
294
+ * Handles single- and double-backtick spans. Returns `span` undefined when
295
+ * the paragraph does not begin with a code span.
296
+ *
297
+ * `spanStart` is the number of paragraph characters consumed before the
298
+ * span's inner text — leading whitespace plus the opening backtick
299
+ * delimiter(s). {@linkcode parseElementBullet} adds it to every span-derived
300
+ * diagnostic column so positions are paragraph-relative (#781): the parser is
301
+ * handed the whole paragraph, so — like every other uxil parser, which
302
+ * reports columns relative to the source string it receives — its diagnostics
303
+ * must be relative to that paragraph, not the de-backticked span. `0` when
304
+ * there is no span (the only diagnostic on that path anchors at paragraph
305
+ * column 1).
306
+ */
307
+ function splitLeadingCodeSpan(text) {
308
+ const t = text.replace(/^\s+/, "");
309
+ const leading = text.length - t.length;
310
+ if (t.startsWith("``")) {
311
+ const end = t.indexOf("``", 2);
312
+ if (end < 0)
313
+ return { rest: text, spanStart: 0 };
314
+ return {
315
+ span: t.slice(2, end),
316
+ rest: t.slice(end + 2),
317
+ spanStart: leading + 2,
318
+ };
319
+ }
320
+ if (t.startsWith("`")) {
321
+ const end = t.indexOf("`", 1);
322
+ if (end < 0)
323
+ return { rest: text, spanStart: 0 };
324
+ return {
325
+ span: t.slice(1, end),
326
+ rest: t.slice(end + 1),
327
+ spanStart: leading + 1,
328
+ };
329
+ }
330
+ return { rest: text, spanStart: 0 };
331
+ }
332
+ /**
333
+ * Parse an element bullet: a leading code span
334
+ * `/element : verb[, verb…] [: {key}] [@state, …] [-> nav]` followed by a
335
+ * mandatory trailing prose event dictionary. Grammar decision K1 (#786,
336
+ * per the epic design doc): the key template is its own `:` clause after
337
+ * the verb set — never attached to the element name, so declarations
338
+ * cannot collide with the ref grammar's `element:{key}` form.
339
+ *
340
+ * Diagnostic columns are paragraph-relative (#781): the parser receives the
341
+ * whole paragraph and splits the leading code span itself, so every
342
+ * span-derived column is shifted by the span's start offset
343
+ * ({@linkcode splitLeadingCodeSpan}'s `spanStart`). The two whole-bullet
344
+ * diagnostics — no leading code span, and the missing event dictionary —
345
+ * anchor at paragraph column 1.
346
+ */
347
+ function parseElementBullet(paragraph) {
348
+ const diagnostics = [];
349
+ const { span, rest, spanStart } = splitLeadingCodeSpan(paragraph);
350
+ if (span === undefined) {
351
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-001", { detail: "element bullet must begin with a code span" }, { line: 1, column: 1 }));
352
+ return { diagnostics };
353
+ }
354
+ // Peel off an optional `-> nav` tail before tokenizing the structured part.
355
+ let structPart = span;
356
+ let navSource;
357
+ const arrow = span.indexOf("->");
358
+ if (arrow >= 0) {
359
+ structPart = span.slice(0, arrow);
360
+ navSource = span.slice(arrow + 2).trim();
361
+ }
362
+ // Paragraph-relative base column for the nav tail (#781): the span's own
363
+ // start offset plus the nav source's 0-based index within the span. Nav
364
+ // diagnostics add this so their columns compose both offsets and land on
365
+ // the paragraph — "the -> nav sub-parse offset should compose too".
366
+ const navBase = navSource
367
+ ? spanStart + span.indexOf(navSource, arrow + 2)
368
+ : 0;
369
+ // The nav tail is an orthogonal region: every return path must still
370
+ // surface a reserved char in it, even when the struct part fails first.
371
+ const scanNavReserved = () => {
372
+ if (navSource)
373
+ scanReservedChars(navSource, diagnostics, navBase);
374
+ };
375
+ // Scan the structured part only — the nav tail is scanned separately
376
+ // (scanNavReserved / parseUxRef below), so scanning the whole span would
377
+ // report a single `?`/`#` in the nav target twice (#780 case 2). A hit
378
+ // poisons the token stream (the lexer drops the char): stop before the
379
+ // structure checks turn the mangled tokens into contradictory codes. The
380
+ // scan's base column is the span start so its column is paragraph-relative
381
+ // (#781).
382
+ if (scanReservedChars(structPart, diagnostics, spanStart)) {
383
+ scanNavReserved();
384
+ return { diagnostics };
385
+ }
386
+ // Shift every struct-part token column by the span start so all downstream
387
+ // diagnostics (slash, element, verb set, key clause, states, expectEof)
388
+ // come out paragraph-relative (#781) without threading the offset through
389
+ // each individual call site.
390
+ const structTokens = (0, lexer_js_1.tokenize)(structPart).map((t) => ({
391
+ ...t,
392
+ position: { line: t.position.line, column: t.position.column + spanStart },
393
+ }));
394
+ const c = new Cursor(structTokens);
395
+ if (c.peek().kind !== "SLASH") {
396
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-001", { detail: "element must start with '/'" }, c.peek().position));
397
+ scanNavReserved();
398
+ return { diagnostics };
399
+ }
400
+ c.advance();
401
+ const element = expectIdent(c, diagnostics, "element name");
402
+ if (element === undefined) {
403
+ scanNavReserved();
404
+ return { diagnostics };
405
+ }
406
+ const decl = {
407
+ form: "element",
408
+ element,
409
+ verbs: [],
410
+ eventDictionary: "",
411
+ position: { line: 1, column: 1 },
412
+ };
413
+ // Old glued form `/element{key}` (pre-#786): one targeted diagnostic
414
+ // pointing at the clause form, then consume-and-discard the braces so
415
+ // the verb set still parses instead of cascading UXIL-005 + UXIL-001.
416
+ if (c.peek().kind === "LBRACE") {
417
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-007", {
418
+ detail: "the key template is a clause after the verb set (write '/element : verb : {key}')",
419
+ }, c.peek().position));
420
+ parseKey(c, diagnostics);
421
+ }
422
+ // Verb set: `: verb[, verb…]` (>= 1).
423
+ if (c.peek().kind !== "COLON") {
424
+ if (c.peek().kind === "IDENT") {
425
+ // A verb is present but the introducing `:` is missing — reporting
426
+ // "empty verb set" here would be contradictory (#780 case 4).
427
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-001", { detail: "expected ':' before the verb set" }, c.peek().position));
428
+ }
429
+ else {
430
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-005", {}, c.peek().position));
431
+ }
432
+ }
433
+ else {
434
+ c.advance();
435
+ const verbs = [];
436
+ // Peek rather than expectIdent for the first verb: a truly empty set
437
+ // reports only UXIL-005, not a redundant UXIL-001 too (#780 case 1).
438
+ if (c.peek().kind === "IDENT") {
439
+ verbs.push(c.advance().value);
440
+ while (c.peek().kind === "COMMA") {
441
+ c.advance();
442
+ const v = expectIdent(c, diagnostics, "verb");
443
+ if (v !== undefined)
444
+ verbs.push(v);
445
+ }
446
+ }
447
+ if (verbs.length === 0) {
448
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-005", {}, c.peek().position));
449
+ }
450
+ decl.verbs = verbs;
451
+ }
452
+ // Optional key-template clause: `: {key}` after the verb set (K1, #786).
453
+ // Declarations declare templates — a concrete key is a citation-only form.
454
+ if (c.peek().kind === "COLON") {
455
+ c.advance();
456
+ const keyAt = c.peek().position;
457
+ const k = parseKey(c, diagnostics);
458
+ if (k?.kind === "template") {
459
+ decl.keyTemplate = k;
460
+ }
461
+ else if (k) {
462
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-007", {
463
+ detail: "expected a '{name}' template, not a concrete key",
464
+ }, keyAt));
465
+ }
466
+ }
467
+ const states = parseStateSet(c, diagnostics);
468
+ if (states.length > 0)
469
+ decl.states = states;
470
+ // Order is load-bearing: expectEof suppresses itself once any diagnostic
471
+ // exists, so it MUST run before the nav and event-dictionary checks below
472
+ // push theirs — moving it later would let those orthogonal regions hide a
473
+ // real leftover-token error in the struct part.
474
+ expectEof(c, diagnostics);
475
+ // Nav target (parsed as a ux ref; may be scheme-less / relative). Nav
476
+ // diagnostics carry positions relative to the sliced nav source — shift
477
+ // them by navBase so editor squiggles land on the paragraph's own columns
478
+ // (#781).
479
+ if (navSource !== undefined) {
480
+ if (navSource.length === 0) {
481
+ // No nav source to point into — anchor at the '->' arrow, paragraph-
482
+ // relative (#781): spanStart shifts past the code-span delimiter, arrow
483
+ // is the 0-based index of '->' within the span, +1 makes it 1-based.
484
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-001", { detail: "missing navigation target after '->'" }, { line: 1, column: spanStart + arrow + 1 }));
485
+ }
486
+ else {
487
+ const nav = parseUxRef(navSource);
488
+ diagnostics.push(...nav.diagnostics.map((d) => ({
489
+ ...d,
490
+ position: {
491
+ line: d.position.line,
492
+ column: d.position.column + navBase,
493
+ },
494
+ })));
495
+ if (nav.ref)
496
+ decl.nav = nav.ref;
497
+ }
498
+ }
499
+ // Event dictionary: trailing prose, minus a leading em-dash separator. Only
500
+ // an em-dash "—" is stripped (never an ASCII "-"), so prose that legitimately
501
+ // opens with a hyphen — e.g. "-5 dB is the floor" — keeps its first character.
502
+ const eventDictionary = rest.replace(/^\s*—\s*/, "").trim();
503
+ if (eventDictionary.length === 0) {
504
+ // Whole-bullet diagnostic — the missing dictionary is the trailing prose,
505
+ // so anchor at paragraph column 1 (the bullet start) rather than a
506
+ // span-derived column (#781).
507
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnostic)("UXIL-006", {}, { line: 1, column: 1 }));
508
+ }
509
+ decl.eventDictionary = eventDictionary;
510
+ return { decl, diagnostics };
511
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @module uxil/lexer
3
+ *
4
+ * Single-line tokenizer for the uxil DSL. Converts a source string (a `ux:`
5
+ * reference, or the machine-readable portion of a declaration) into a flat
6
+ * `Token[]` ending in one `EOF`. Whitespace is skipped; unrecognised
7
+ * characters are skipped silently — the parser surfaces the diagnostic,
8
+ * keeping lexer/parser responsibilities separated (as in typl's lexer).
9
+ */
10
+ import type { Position } from "./ast.js";
11
+ /** All token kinds produced by the uxil tokenizer. */
12
+ export type TokenKind = "IDENT" | "DOT" | "AT" | "SLASH" | "COLON" | "BANG" | "COMMA" | "ARROW" | "LBRACE" | "RBRACE" | "EOF";
13
+ /** A single token emitted by {@linkcode tokenize}. */
14
+ export interface Token {
15
+ readonly kind: TokenKind;
16
+ /** Raw text (empty for EOF). */
17
+ readonly value: string;
18
+ /** 1-based position of the token's first character (line always 1). */
19
+ readonly position: Position;
20
+ }
21
+ /** Tokenize a single-line uxil source string. */
22
+ export declare function tokenize(source: string): Token[];
23
+ //# sourceMappingURL=lexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../../src/uxil/lexer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,sDAAsD;AACtD,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,KAAK,GACL,IAAI,GACJ,OAAO,GACP,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,CAAC;AAEV,sDAAsD;AACtD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAeD,iDAAiD;AACjD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAoDhD"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tokenize = tokenize;
4
+ const IDENT_CHAR_RE = /[A-Za-z0-9_]/;
5
+ const SINGLE_CHAR = {
6
+ ".": "DOT",
7
+ "@": "AT",
8
+ "/": "SLASH",
9
+ ":": "COLON",
10
+ "!": "BANG",
11
+ ",": "COMMA",
12
+ "{": "LBRACE",
13
+ "}": "RBRACE",
14
+ };
15
+ /** Tokenize a single-line uxil source string. */
16
+ function tokenize(source) {
17
+ const tokens = [];
18
+ let i = 0;
19
+ let column = 1;
20
+ const push = (kind, value, startCol) => {
21
+ tokens.push({ kind, value, position: { line: 1, column: startCol } });
22
+ };
23
+ while (i < source.length) {
24
+ const ch = source[i];
25
+ if (ch === " " || ch === "\t") {
26
+ i++;
27
+ column++;
28
+ continue;
29
+ }
30
+ // Arrow `->` before the single-char scan (it is not in SINGLE_CHAR).
31
+ if (ch === "-" && source[i + 1] === ">") {
32
+ push("ARROW", "->", column);
33
+ i += 2;
34
+ column += 2;
35
+ continue;
36
+ }
37
+ const single = SINGLE_CHAR[ch];
38
+ if (single !== undefined) {
39
+ push(single, ch, column);
40
+ i++;
41
+ column++;
42
+ continue;
43
+ }
44
+ if (IDENT_CHAR_RE.test(ch)) {
45
+ const startCol = column;
46
+ let value = "";
47
+ while (i < source.length && IDENT_CHAR_RE.test(source[i])) {
48
+ value += source[i];
49
+ i++;
50
+ column++;
51
+ }
52
+ push("IDENT", value, startCol);
53
+ continue;
54
+ }
55
+ // Unrecognised character — skip; the parser surfaces the diagnostic.
56
+ i++;
57
+ column++;
58
+ }
59
+ push("EOF", "", column);
60
+ return tokens;
61
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @module uxil
3
+ *
4
+ * uxil DSL layer: `ux:` reference + declaration-form parsers (S7 #725),
5
+ * the declaration AST, structured parse diagnostics, the form recognizer,
6
+ * and the compiler — corpus registry, enforced semantics, and a
7
+ * deterministic machine projection (S8 #726). The compiler is now
8
+ * reachable from `check`/LSP through `core/validator/uxil_family.ts`
9
+ * (S9 #727); the family + LSP wiring itself lands in S9/S10.
10
+ */
11
+ export type { ChildSurfaceDecl, ElementDecl, Position, RootDecl, UxilDecl, UxKey, UxRef, } from "./ast.js";
12
+ export type { UxilCode, UxilCodeEntry, UxilDiagnostic } from "./diagnostics.js";
13
+ export { UXIL_CODES, uxilDiagnostic, uxilDiagnosticAt } from "./diagnostics.js";
14
+ export type { Token, TokenKind } from "./lexer.js";
15
+ export { tokenize } from "./lexer.js";
16
+ export { parseChildSurfaceDecl, parseElementBullet, parseRootDecl, parseUxRef, } from "./grammar.js";
17
+ export type { UxilForm } from "./recognize.js";
18
+ export { classifyUxilForm } from "./recognize.js";
19
+ export type { UxElement, UxSurface, UxSurfaceTree } from "./assemble.js";
20
+ export { assembleUxSurface, UX_REF_OPS } from "./assemble.js";
21
+ export type { SurfaceRecord, UxRegistry } from "./registry.js";
22
+ export { buildUxRegistry } from "./registry.js";
23
+ export type { UxCitation } from "./citations.js";
24
+ export { extractUxCitations, isUxCitationText } from "./citations.js";
25
+ export { extractUxBullets, extractUxRootSpans, stripUxilLeadingSpan, } from "./surfaces.js";
26
+ export type { UxilValidateOptions, UxilValidation } from "./validator.js";
27
+ export { validateUxil } from "./validator.js";
28
+ export type { ProjectedElement, ProjectedSurface, UxProjection, } from "./projection.js";
29
+ export { projectUxRegistry } from "./projection.js";
30
+ export type { KindInfo, VerbInfo } from "./vocab.js";
31
+ export { isKnownKind, isKnownVerb, UX_KINDS, UX_VERBS } from "./vocab.js";
32
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/uxil/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,KAAK,GACN,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChF,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UX_VERBS = exports.UX_KINDS = exports.isKnownVerb = exports.isKnownKind = exports.projectUxRegistry = exports.validateUxil = exports.stripUxilLeadingSpan = exports.extractUxRootSpans = exports.extractUxBullets = exports.isUxCitationText = exports.extractUxCitations = exports.buildUxRegistry = exports.UX_REF_OPS = exports.assembleUxSurface = exports.classifyUxilForm = exports.parseUxRef = exports.parseRootDecl = exports.parseElementBullet = exports.parseChildSurfaceDecl = exports.tokenize = exports.uxilDiagnosticAt = exports.uxilDiagnostic = exports.UXIL_CODES = void 0;
4
+ var diagnostics_js_1 = require("./diagnostics.js");
5
+ Object.defineProperty(exports, "UXIL_CODES", { enumerable: true, get: function () { return diagnostics_js_1.UXIL_CODES; } });
6
+ Object.defineProperty(exports, "uxilDiagnostic", { enumerable: true, get: function () { return diagnostics_js_1.uxilDiagnostic; } });
7
+ Object.defineProperty(exports, "uxilDiagnosticAt", { enumerable: true, get: function () { return diagnostics_js_1.uxilDiagnosticAt; } });
8
+ var lexer_js_1 = require("./lexer.js");
9
+ Object.defineProperty(exports, "tokenize", { enumerable: true, get: function () { return lexer_js_1.tokenize; } });
10
+ var grammar_js_1 = require("./grammar.js");
11
+ Object.defineProperty(exports, "parseChildSurfaceDecl", { enumerable: true, get: function () { return grammar_js_1.parseChildSurfaceDecl; } });
12
+ Object.defineProperty(exports, "parseElementBullet", { enumerable: true, get: function () { return grammar_js_1.parseElementBullet; } });
13
+ Object.defineProperty(exports, "parseRootDecl", { enumerable: true, get: function () { return grammar_js_1.parseRootDecl; } });
14
+ Object.defineProperty(exports, "parseUxRef", { enumerable: true, get: function () { return grammar_js_1.parseUxRef; } });
15
+ var recognize_js_1 = require("./recognize.js");
16
+ Object.defineProperty(exports, "classifyUxilForm", { enumerable: true, get: function () { return recognize_js_1.classifyUxilForm; } });
17
+ var assemble_js_1 = require("./assemble.js");
18
+ Object.defineProperty(exports, "assembleUxSurface", { enumerable: true, get: function () { return assemble_js_1.assembleUxSurface; } });
19
+ Object.defineProperty(exports, "UX_REF_OPS", { enumerable: true, get: function () { return assemble_js_1.UX_REF_OPS; } });
20
+ var registry_js_1 = require("./registry.js");
21
+ Object.defineProperty(exports, "buildUxRegistry", { enumerable: true, get: function () { return registry_js_1.buildUxRegistry; } });
22
+ var citations_js_1 = require("./citations.js");
23
+ Object.defineProperty(exports, "extractUxCitations", { enumerable: true, get: function () { return citations_js_1.extractUxCitations; } });
24
+ Object.defineProperty(exports, "isUxCitationText", { enumerable: true, get: function () { return citations_js_1.isUxCitationText; } });
25
+ var surfaces_js_1 = require("./surfaces.js");
26
+ Object.defineProperty(exports, "extractUxBullets", { enumerable: true, get: function () { return surfaces_js_1.extractUxBullets; } });
27
+ Object.defineProperty(exports, "extractUxRootSpans", { enumerable: true, get: function () { return surfaces_js_1.extractUxRootSpans; } });
28
+ Object.defineProperty(exports, "stripUxilLeadingSpan", { enumerable: true, get: function () { return surfaces_js_1.stripUxilLeadingSpan; } });
29
+ var validator_js_1 = require("./validator.js");
30
+ Object.defineProperty(exports, "validateUxil", { enumerable: true, get: function () { return validator_js_1.validateUxil; } });
31
+ var projection_js_1 = require("./projection.js");
32
+ Object.defineProperty(exports, "projectUxRegistry", { enumerable: true, get: function () { return projection_js_1.projectUxRegistry; } });
33
+ var vocab_js_1 = require("./vocab.js");
34
+ Object.defineProperty(exports, "isKnownKind", { enumerable: true, get: function () { return vocab_js_1.isKnownKind; } });
35
+ Object.defineProperty(exports, "isKnownVerb", { enumerable: true, get: function () { return vocab_js_1.isKnownVerb; } });
36
+ Object.defineProperty(exports, "UX_KINDS", { enumerable: true, get: function () { return vocab_js_1.UX_KINDS; } });
37
+ Object.defineProperty(exports, "UX_VERBS", { enumerable: true, get: function () { return vocab_js_1.UX_VERBS; } });