@driftsys/markspec 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +74 -20
  2. package/esm/ast/build.d.ts +11 -21
  3. package/esm/ast/build.d.ts.map +1 -1
  4. package/esm/ast/build.js +50 -139
  5. package/esm/ast/nodes.d.ts +11 -43
  6. package/esm/ast/nodes.d.ts.map +1 -1
  7. package/esm/ast/nodes.js +6 -1
  8. package/esm/ast/normalize.d.ts +8 -17
  9. package/esm/ast/normalize.d.ts.map +1 -1
  10. package/esm/ast/normalize.js +14 -72
  11. package/esm/compiler/constants.d.ts +16 -0
  12. package/esm/compiler/constants.d.ts.map +1 -0
  13. package/esm/compiler/constants.js +26 -0
  14. package/esm/compiler/discipline_classifier.d.ts +55 -0
  15. package/esm/compiler/discipline_classifier.d.ts.map +1 -0
  16. package/esm/compiler/discipline_classifier.js +191 -0
  17. package/esm/compiler/inverses.d.ts +7 -0
  18. package/esm/compiler/inverses.d.ts.map +1 -1
  19. package/esm/compiler/inverses.js +1 -18
  20. package/esm/compiler/mod.d.ts +30 -1
  21. package/esm/compiler/mod.d.ts.map +1 -1
  22. package/esm/compiler/mod.js +198 -65
  23. package/esm/compiler/schema.d.ts +15 -0
  24. package/esm/compiler/schema.d.ts.map +1 -1
  25. package/esm/compiler/schema.js +12 -0
  26. package/esm/config/markspec.d.ts +5 -0
  27. package/esm/config/markspec.d.ts.map +1 -1
  28. package/esm/config/markspec.js +17 -2
  29. package/esm/formatter/mod.d.ts +9 -3
  30. package/esm/formatter/mod.d.ts.map +1 -1
  31. package/esm/formatter/mod.js +97 -49
  32. package/esm/lexicons/loader.d.ts +35 -0
  33. package/esm/lexicons/loader.d.ts.map +1 -0
  34. package/esm/lexicons/loader.js +51 -0
  35. package/esm/lexicons/mod.d.ts +13 -0
  36. package/esm/lexicons/mod.d.ts.map +1 -0
  37. package/esm/lexicons/mod.js +12 -0
  38. package/esm/lint/glossary.d.ts +45 -0
  39. package/esm/lint/glossary.d.ts.map +1 -0
  40. package/esm/lint/glossary.js +85 -0
  41. package/esm/lint/mod.d.ts +4 -0
  42. package/esm/lint/mod.d.ts.map +1 -1
  43. package/esm/lint/mod.js +2 -0
  44. package/esm/lint/range_util.d.ts +25 -0
  45. package/esm/lint/range_util.d.ts.map +1 -0
  46. package/esm/lint/range_util.js +50 -0
  47. package/esm/lint/rules/ears.d.ts +39 -0
  48. package/esm/lint/rules/ears.d.ts.map +1 -0
  49. package/esm/lint/rules/ears.js +316 -0
  50. package/esm/lint/rules/incose_sentence.d.ts +46 -0
  51. package/esm/lint/rules/incose_sentence.d.ts.map +1 -0
  52. package/esm/lint/rules/incose_sentence.js +417 -0
  53. package/esm/lint/rules/modal_sentence.d.ts +46 -0
  54. package/esm/lint/rules/modal_sentence.d.ts.map +1 -0
  55. package/esm/lint/rules/modal_sentence.js +146 -0
  56. package/esm/lint/rules/passive.d.ts +64 -0
  57. package/esm/lint/rules/passive.d.ts.map +1 -0
  58. package/esm/lint/rules/passive.js +282 -0
  59. package/esm/lint/rules/suppression.d.ts +38 -3
  60. package/esm/lint/rules/suppression.d.ts.map +1 -1
  61. package/esm/lint/rules/suppression.js +58 -4
  62. package/esm/lint/rules/xref.d.ts +19 -0
  63. package/esm/lint/rules/xref.d.ts.map +1 -0
  64. package/esm/lint/rules/xref.js +248 -0
  65. package/esm/lint/runner.d.ts +31 -11
  66. package/esm/lint/runner.d.ts.map +1 -1
  67. package/esm/lint/runner.js +67 -26
  68. package/esm/lint/score.d.ts +64 -0
  69. package/esm/lint/score.d.ts.map +1 -0
  70. package/esm/lint/score.js +163 -0
  71. package/esm/lint/segmenter.d.ts +32 -0
  72. package/esm/lint/segmenter.d.ts.map +1 -0
  73. package/esm/lint/segmenter.js +79 -0
  74. package/esm/lint/types.d.ts +12 -0
  75. package/esm/lint/types.d.ts.map +1 -1
  76. package/esm/lock/canonical_edges.d.ts +31 -0
  77. package/esm/lock/canonical_edges.d.ts.map +1 -0
  78. package/esm/lock/canonical_edges.js +57 -0
  79. package/esm/lock/check.d.ts +24 -0
  80. package/esm/lock/check.d.ts.map +1 -0
  81. package/esm/lock/check.js +127 -0
  82. package/esm/lock/hash.d.ts +12 -0
  83. package/esm/lock/hash.d.ts.map +1 -0
  84. package/esm/lock/hash.js +32 -0
  85. package/esm/lock/mod.d.ts +19 -0
  86. package/esm/lock/mod.d.ts.map +1 -0
  87. package/esm/lock/mod.js +14 -0
  88. package/esm/lock/model.d.ts +81 -0
  89. package/esm/lock/model.d.ts.map +1 -0
  90. package/esm/lock/model.js +7 -0
  91. package/esm/lock/parser.d.ts +26 -0
  92. package/esm/lock/parser.d.ts.map +1 -0
  93. package/esm/lock/parser.js +195 -0
  94. package/esm/lock/resolve.d.ts +142 -0
  95. package/esm/lock/resolve.d.ts.map +1 -0
  96. package/esm/lock/resolve.js +389 -0
  97. package/esm/lock/serializer.d.ts +14 -0
  98. package/esm/lock/serializer.d.ts.map +1 -0
  99. package/esm/lock/serializer.js +104 -0
  100. package/esm/mod.d.ts +16 -9
  101. package/esm/mod.d.ts.map +1 -1
  102. package/esm/mod.js +12 -4
  103. package/esm/model/attributes.d.ts +6 -0
  104. package/esm/model/attributes.d.ts.map +1 -1
  105. package/esm/model/attributes.js +37 -0
  106. package/esm/model/discipline.d.ts +53 -0
  107. package/esm/model/discipline.d.ts.map +1 -0
  108. package/esm/model/discipline.js +50 -0
  109. package/esm/model/mod.d.ts +188 -30
  110. package/esm/model/mod.d.ts.map +1 -1
  111. package/esm/model/mod.js +42 -1
  112. package/esm/model/profile.d.ts +69 -0
  113. package/esm/model/profile.d.ts.map +1 -1
  114. package/esm/parser/attributes.d.ts.map +1 -1
  115. package/esm/parser/attributes.js +1 -10
  116. package/esm/parser/body_tokens.d.ts +35 -0
  117. package/esm/parser/body_tokens.d.ts.map +1 -0
  118. package/esm/parser/body_tokens.js +232 -0
  119. package/esm/parser/glossary.d.ts +8 -0
  120. package/esm/parser/glossary.d.ts.map +1 -1
  121. package/esm/parser/glossary.js +6 -4
  122. package/esm/parser/grammars.d.ts +5 -3
  123. package/esm/parser/grammars.d.ts.map +1 -1
  124. package/esm/parser/grammars.js +18 -4
  125. package/esm/parser/language_spec.d.ts +55 -0
  126. package/esm/parser/language_spec.d.ts.map +1 -0
  127. package/esm/parser/language_spec.js +419 -0
  128. package/esm/parser/line_map.d.ts +60 -0
  129. package/esm/parser/line_map.d.ts.map +1 -0
  130. package/esm/parser/line_map.js +41 -0
  131. package/esm/parser/markdown.d.ts +9 -0
  132. package/esm/parser/markdown.d.ts.map +1 -1
  133. package/esm/parser/markdown.js +97 -31
  134. package/esm/parser/mod.d.ts +4 -0
  135. package/esm/parser/mod.d.ts.map +1 -1
  136. package/esm/parser/mod.js +30 -8
  137. package/esm/parser/source.d.ts +39 -8
  138. package/esm/parser/source.d.ts.map +1 -1
  139. package/esm/parser/source.js +155 -65
  140. package/esm/parser/translate.d.ts +24 -0
  141. package/esm/parser/translate.d.ts.map +1 -0
  142. package/esm/parser/translate.js +99 -0
  143. package/esm/profile/chain.d.ts +8 -0
  144. package/esm/profile/chain.d.ts.map +1 -1
  145. package/esm/profile/chain.js +29 -1
  146. package/esm/profile/default_profile.d.ts +25 -0
  147. package/esm/profile/default_profile.d.ts.map +1 -0
  148. package/esm/profile/default_profile.js +43 -0
  149. package/esm/profile/discipline_mode.d.ts +64 -0
  150. package/esm/profile/discipline_mode.d.ts.map +1 -0
  151. package/esm/profile/discipline_mode.js +133 -0
  152. package/esm/profile/discipline_registry.d.ts +41 -0
  153. package/esm/profile/discipline_registry.d.ts.map +1 -0
  154. package/esm/profile/discipline_registry.js +67 -0
  155. package/esm/profile/load.d.ts +3 -1
  156. package/esm/profile/load.d.ts.map +1 -1
  157. package/esm/profile/load.js +24 -5
  158. package/esm/profile/manifest.d.ts.map +1 -1
  159. package/esm/profile/manifest.js +253 -20
  160. package/esm/profile/merge.d.ts.map +1 -1
  161. package/esm/profile/merge.js +112 -0
  162. package/esm/profile/mod.d.ts +2 -0
  163. package/esm/profile/mod.d.ts.map +1 -1
  164. package/esm/profile/mod.js +2 -0
  165. package/esm/sync/locked_attributes.d.ts +19 -0
  166. package/esm/sync/locked_attributes.d.ts.map +1 -0
  167. package/esm/sync/locked_attributes.js +27 -0
  168. package/esm/sync/log.d.ts +34 -0
  169. package/esm/sync/log.d.ts.map +1 -0
  170. package/esm/sync/log.js +48 -0
  171. package/esm/sync/mapping.d.ts +66 -0
  172. package/esm/sync/mapping.d.ts.map +1 -0
  173. package/esm/sync/mapping.js +165 -0
  174. package/esm/sync/mod.d.ts +16 -0
  175. package/esm/sync/mod.d.ts.map +1 -0
  176. package/esm/sync/mod.js +12 -0
  177. package/esm/sync/status.d.ts +23 -0
  178. package/esm/sync/status.d.ts.map +1 -0
  179. package/esm/sync/status.js +21 -0
  180. package/esm/typl/ast.d.ts +87 -0
  181. package/esm/typl/ast.d.ts.map +1 -0
  182. package/esm/typl/ast.js +21 -0
  183. package/esm/typl/bridge.d.ts +32 -0
  184. package/esm/typl/bridge.d.ts.map +1 -0
  185. package/esm/typl/bridge.js +27 -0
  186. package/esm/typl/bullet.d.ts +34 -0
  187. package/esm/typl/bullet.d.ts.map +1 -0
  188. package/esm/typl/bullet.js +44 -0
  189. package/esm/typl/diagnostics.d.ts +43 -0
  190. package/esm/typl/diagnostics.d.ts.map +1 -0
  191. package/esm/typl/diagnostics.js +61 -0
  192. package/esm/typl/fence.d.ts +31 -0
  193. package/esm/typl/fence.d.ts.map +1 -0
  194. package/esm/typl/fence.js +24 -0
  195. package/esm/typl/grammar.d.ts +20 -0
  196. package/esm/typl/grammar.d.ts.map +1 -0
  197. package/esm/typl/grammar.js +471 -0
  198. package/esm/typl/inline.d.ts +34 -0
  199. package/esm/typl/inline.d.ts.map +1 -0
  200. package/esm/typl/inline.js +48 -0
  201. package/esm/typl/lexer.d.ts +37 -0
  202. package/esm/typl/lexer.d.ts.map +1 -0
  203. package/esm/typl/lexer.js +234 -0
  204. package/esm/typl/mod.d.ts +23 -0
  205. package/esm/typl/mod.d.ts.map +1 -0
  206. package/esm/typl/mod.js +16 -0
  207. package/esm/typl/registry.d.ts +42 -0
  208. package/esm/typl/registry.d.ts.map +1 -0
  209. package/esm/typl/registry.js +26 -0
  210. package/esm/typl/validator.d.ts +29 -0
  211. package/esm/typl/validator.d.ts.map +1 -0
  212. package/esm/typl/validator.js +141 -0
  213. package/esm/util/line_endings.d.ts +33 -0
  214. package/esm/util/line_endings.d.ts.map +1 -0
  215. package/esm/util/line_endings.js +53 -0
  216. package/esm/util/modals.d.ts +29 -0
  217. package/esm/util/modals.d.ts.map +1 -0
  218. package/esm/util/modals.js +38 -0
  219. package/esm/validator/discipline.d.ts +35 -0
  220. package/esm/validator/discipline.d.ts.map +1 -0
  221. package/esm/validator/discipline.js +204 -0
  222. package/esm/validator/mod.d.ts +1 -1
  223. package/esm/validator/mod.d.ts.map +1 -1
  224. package/esm/validator/mod.js +23 -2
  225. package/esm/validator/modal_keywords.d.ts +15 -13
  226. package/esm/validator/modal_keywords.d.ts.map +1 -1
  227. package/esm/validator/modal_keywords.js +26 -109
  228. package/esm/validator/pattern.d.ts +15 -8
  229. package/esm/validator/pattern.d.ts.map +1 -1
  230. package/esm/validator/pattern.js +42 -19
  231. package/esm/validator/per_type_attrs.d.ts +2 -2
  232. package/esm/validator/per_type_attrs.d.ts.map +1 -1
  233. package/esm/validator/per_type_attrs.js +2 -2
  234. package/esm/validator/pipeline.d.ts +11 -0
  235. package/esm/validator/pipeline.d.ts.map +1 -1
  236. package/esm/validator/pipeline.js +37 -15
  237. package/esm/validator/type_resolution.d.ts +3 -3
  238. package/esm/validator/type_resolution.d.ts.map +1 -1
  239. package/esm/validator/type_resolution.js +31 -9
  240. package/package.json +2 -2
  241. package/script/ast/build.d.ts +11 -21
  242. package/script/ast/build.d.ts.map +1 -1
  243. package/script/ast/build.js +51 -140
  244. package/script/ast/nodes.d.ts +11 -43
  245. package/script/ast/nodes.d.ts.map +1 -1
  246. package/script/ast/nodes.js +6 -1
  247. package/script/ast/normalize.d.ts +8 -17
  248. package/script/ast/normalize.d.ts.map +1 -1
  249. package/script/ast/normalize.js +16 -74
  250. package/script/compiler/constants.d.ts +16 -0
  251. package/script/compiler/constants.d.ts.map +1 -0
  252. package/script/compiler/constants.js +29 -0
  253. package/script/compiler/discipline_classifier.d.ts +55 -0
  254. package/script/compiler/discipline_classifier.d.ts.map +1 -0
  255. package/script/compiler/discipline_classifier.js +196 -0
  256. package/script/compiler/inverses.d.ts +7 -0
  257. package/script/compiler/inverses.d.ts.map +1 -1
  258. package/script/compiler/inverses.js +2 -19
  259. package/script/compiler/mod.d.ts +30 -1
  260. package/script/compiler/mod.d.ts.map +1 -1
  261. package/script/compiler/mod.js +202 -69
  262. package/script/compiler/schema.d.ts +15 -0
  263. package/script/compiler/schema.d.ts.map +1 -1
  264. package/script/compiler/schema.js +12 -0
  265. package/script/config/markspec.d.ts +5 -0
  266. package/script/config/markspec.d.ts.map +1 -1
  267. package/script/config/markspec.js +17 -2
  268. package/script/formatter/mod.d.ts +9 -3
  269. package/script/formatter/mod.d.ts.map +1 -1
  270. package/script/formatter/mod.js +99 -51
  271. package/script/lexicons/loader.d.ts +35 -0
  272. package/script/lexicons/loader.d.ts.map +1 -0
  273. package/script/lexicons/loader.js +55 -0
  274. package/script/lexicons/mod.d.ts +13 -0
  275. package/script/lexicons/mod.d.ts.map +1 -0
  276. package/script/lexicons/mod.js +17 -0
  277. package/script/lint/glossary.d.ts +45 -0
  278. package/script/lint/glossary.d.ts.map +1 -0
  279. package/script/lint/glossary.js +88 -0
  280. package/script/lint/mod.d.ts +4 -0
  281. package/script/lint/mod.d.ts.map +1 -1
  282. package/script/lint/mod.js +6 -1
  283. package/script/lint/range_util.d.ts +25 -0
  284. package/script/lint/range_util.d.ts.map +1 -0
  285. package/script/lint/range_util.js +53 -0
  286. package/script/lint/rules/ears.d.ts +39 -0
  287. package/script/lint/rules/ears.d.ts.map +1 -0
  288. package/script/lint/rules/ears.js +320 -0
  289. package/script/lint/rules/incose_sentence.d.ts +46 -0
  290. package/script/lint/rules/incose_sentence.d.ts.map +1 -0
  291. package/script/lint/rules/incose_sentence.js +421 -0
  292. package/script/lint/rules/modal_sentence.d.ts +46 -0
  293. package/script/lint/rules/modal_sentence.d.ts.map +1 -0
  294. package/script/lint/rules/modal_sentence.js +150 -0
  295. package/script/lint/rules/passive.d.ts +64 -0
  296. package/script/lint/rules/passive.d.ts.map +1 -0
  297. package/script/lint/rules/passive.js +286 -0
  298. package/script/lint/rules/suppression.d.ts +38 -3
  299. package/script/lint/rules/suppression.d.ts.map +1 -1
  300. package/script/lint/rules/suppression.js +59 -3
  301. package/script/lint/rules/xref.d.ts +19 -0
  302. package/script/lint/rules/xref.d.ts.map +1 -0
  303. package/script/lint/rules/xref.js +251 -0
  304. package/script/lint/runner.d.ts +31 -11
  305. package/script/lint/runner.d.ts.map +1 -1
  306. package/script/lint/runner.js +67 -26
  307. package/script/lint/score.d.ts +64 -0
  308. package/script/lint/score.d.ts.map +1 -0
  309. package/script/lint/score.js +167 -0
  310. package/script/lint/segmenter.d.ts +32 -0
  311. package/script/lint/segmenter.d.ts.map +1 -0
  312. package/script/lint/segmenter.js +82 -0
  313. package/script/lint/types.d.ts +12 -0
  314. package/script/lint/types.d.ts.map +1 -1
  315. package/script/lock/canonical_edges.d.ts +31 -0
  316. package/script/lock/canonical_edges.d.ts.map +1 -0
  317. package/script/lock/canonical_edges.js +61 -0
  318. package/script/lock/check.d.ts +24 -0
  319. package/script/lock/check.d.ts.map +1 -0
  320. package/script/lock/check.js +130 -0
  321. package/script/lock/hash.d.ts +12 -0
  322. package/script/lock/hash.d.ts.map +1 -0
  323. package/script/lock/hash.js +36 -0
  324. package/script/lock/mod.d.ts +19 -0
  325. package/script/lock/mod.d.ts.map +1 -0
  326. package/script/lock/mod.js +31 -0
  327. package/script/lock/model.d.ts +81 -0
  328. package/script/lock/model.d.ts.map +1 -0
  329. package/script/lock/model.js +10 -0
  330. package/script/lock/parser.d.ts +26 -0
  331. package/script/lock/parser.d.ts.map +1 -0
  332. package/script/lock/parser.js +198 -0
  333. package/script/lock/resolve.d.ts +142 -0
  334. package/script/lock/resolve.d.ts.map +1 -0
  335. package/script/lock/resolve.js +397 -0
  336. package/script/lock/serializer.d.ts +14 -0
  337. package/script/lock/serializer.d.ts.map +1 -0
  338. package/script/lock/serializer.js +107 -0
  339. package/script/mod.d.ts +16 -9
  340. package/script/mod.d.ts.map +1 -1
  341. package/script/mod.js +111 -38
  342. package/script/model/attributes.d.ts +6 -0
  343. package/script/model/attributes.d.ts.map +1 -1
  344. package/script/model/attributes.js +38 -1
  345. package/script/model/discipline.d.ts +53 -0
  346. package/script/model/discipline.d.ts.map +1 -0
  347. package/script/model/discipline.js +53 -0
  348. package/script/model/mod.d.ts +188 -30
  349. package/script/model/mod.d.ts.map +1 -1
  350. package/script/model/mod.js +48 -1
  351. package/script/model/profile.d.ts +69 -0
  352. package/script/model/profile.d.ts.map +1 -1
  353. package/script/parser/attributes.d.ts.map +1 -1
  354. package/script/parser/attributes.js +1 -10
  355. package/script/parser/body_tokens.d.ts +35 -0
  356. package/script/parser/body_tokens.d.ts.map +1 -0
  357. package/script/parser/body_tokens.js +235 -0
  358. package/script/parser/glossary.d.ts +8 -0
  359. package/script/parser/glossary.d.ts.map +1 -1
  360. package/script/parser/glossary.js +7 -4
  361. package/script/parser/grammars.d.ts +5 -3
  362. package/script/parser/grammars.d.ts.map +1 -1
  363. package/script/parser/grammars.js +21 -8
  364. package/script/parser/language_spec.d.ts +55 -0
  365. package/script/parser/language_spec.d.ts.map +1 -0
  366. package/script/parser/language_spec.js +423 -0
  367. package/script/parser/line_map.d.ts +60 -0
  368. package/script/parser/line_map.d.ts.map +1 -0
  369. package/script/parser/line_map.js +44 -0
  370. package/script/parser/markdown.d.ts +9 -0
  371. package/script/parser/markdown.d.ts.map +1 -1
  372. package/script/parser/markdown.js +95 -29
  373. package/script/parser/mod.d.ts +4 -0
  374. package/script/parser/mod.d.ts.map +1 -1
  375. package/script/parser/mod.js +32 -7
  376. package/script/parser/source.d.ts +39 -8
  377. package/script/parser/source.d.ts.map +1 -1
  378. package/script/parser/source.js +156 -69
  379. package/script/parser/translate.d.ts +24 -0
  380. package/script/parser/translate.d.ts.map +1 -0
  381. package/script/parser/translate.js +102 -0
  382. package/script/profile/chain.d.ts +8 -0
  383. package/script/profile/chain.d.ts.map +1 -1
  384. package/script/profile/chain.js +29 -1
  385. package/script/profile/default_profile.d.ts +25 -0
  386. package/script/profile/default_profile.d.ts.map +1 -0
  387. package/script/profile/default_profile.js +46 -0
  388. package/script/profile/discipline_mode.d.ts +64 -0
  389. package/script/profile/discipline_mode.d.ts.map +1 -0
  390. package/script/profile/discipline_mode.js +138 -0
  391. package/script/profile/discipline_registry.d.ts +41 -0
  392. package/script/profile/discipline_registry.d.ts.map +1 -0
  393. package/script/profile/discipline_registry.js +70 -0
  394. package/script/profile/load.d.ts +3 -1
  395. package/script/profile/load.d.ts.map +1 -1
  396. package/script/profile/load.js +24 -5
  397. package/script/profile/manifest.d.ts.map +1 -1
  398. package/script/profile/manifest.js +252 -19
  399. package/script/profile/merge.d.ts.map +1 -1
  400. package/script/profile/merge.js +112 -0
  401. package/script/profile/mod.d.ts +2 -0
  402. package/script/profile/mod.d.ts.map +1 -1
  403. package/script/profile/mod.js +6 -1
  404. package/script/sync/locked_attributes.d.ts +19 -0
  405. package/script/sync/locked_attributes.d.ts.map +1 -0
  406. package/script/sync/locked_attributes.js +30 -0
  407. package/script/sync/log.d.ts +34 -0
  408. package/script/sync/log.d.ts.map +1 -0
  409. package/script/sync/log.js +52 -0
  410. package/script/sync/mapping.d.ts +66 -0
  411. package/script/sync/mapping.d.ts.map +1 -0
  412. package/script/sync/mapping.js +169 -0
  413. package/script/sync/mod.d.ts +16 -0
  414. package/script/sync/mod.d.ts.map +1 -0
  415. package/script/sync/mod.js +21 -0
  416. package/script/sync/status.d.ts +23 -0
  417. package/script/sync/status.d.ts.map +1 -0
  418. package/script/sync/status.js +24 -0
  419. package/script/typl/ast.d.ts +87 -0
  420. package/script/typl/ast.d.ts.map +1 -0
  421. package/script/typl/ast.js +24 -0
  422. package/script/typl/bridge.d.ts +32 -0
  423. package/script/typl/bridge.d.ts.map +1 -0
  424. package/script/typl/bridge.js +30 -0
  425. package/script/typl/bullet.d.ts +34 -0
  426. package/script/typl/bullet.d.ts.map +1 -0
  427. package/script/typl/bullet.js +47 -0
  428. package/script/typl/diagnostics.d.ts +43 -0
  429. package/script/typl/diagnostics.d.ts.map +1 -0
  430. package/script/typl/diagnostics.js +65 -0
  431. package/script/typl/fence.d.ts +31 -0
  432. package/script/typl/fence.d.ts.map +1 -0
  433. package/script/typl/fence.js +27 -0
  434. package/script/typl/grammar.d.ts +20 -0
  435. package/script/typl/grammar.d.ts.map +1 -0
  436. package/script/typl/grammar.js +474 -0
  437. package/script/typl/inline.d.ts +34 -0
  438. package/script/typl/inline.d.ts.map +1 -0
  439. package/script/typl/inline.js +51 -0
  440. package/script/typl/lexer.d.ts +37 -0
  441. package/script/typl/lexer.d.ts.map +1 -0
  442. package/script/typl/lexer.js +237 -0
  443. package/script/typl/mod.d.ts +23 -0
  444. package/script/typl/mod.d.ts.map +1 -0
  445. package/script/typl/mod.js +29 -0
  446. package/script/typl/registry.d.ts +42 -0
  447. package/script/typl/registry.d.ts.map +1 -0
  448. package/script/typl/registry.js +29 -0
  449. package/script/typl/validator.d.ts +29 -0
  450. package/script/typl/validator.d.ts.map +1 -0
  451. package/script/typl/validator.js +144 -0
  452. package/script/util/line_endings.d.ts +33 -0
  453. package/script/util/line_endings.d.ts.map +1 -0
  454. package/script/util/line_endings.js +58 -0
  455. package/script/util/modals.d.ts +29 -0
  456. package/script/util/modals.d.ts.map +1 -0
  457. package/script/util/modals.js +42 -0
  458. package/script/validator/discipline.d.ts +35 -0
  459. package/script/validator/discipline.d.ts.map +1 -0
  460. package/script/validator/discipline.js +207 -0
  461. package/script/validator/mod.d.ts +1 -1
  462. package/script/validator/mod.d.ts.map +1 -1
  463. package/script/validator/mod.js +23 -1
  464. package/script/validator/modal_keywords.d.ts +15 -13
  465. package/script/validator/modal_keywords.d.ts.map +1 -1
  466. package/script/validator/modal_keywords.js +26 -109
  467. package/script/validator/pattern.d.ts +15 -8
  468. package/script/validator/pattern.d.ts.map +1 -1
  469. package/script/validator/pattern.js +42 -19
  470. package/script/validator/per_type_attrs.d.ts +2 -2
  471. package/script/validator/per_type_attrs.d.ts.map +1 -1
  472. package/script/validator/per_type_attrs.js +2 -2
  473. package/script/validator/pipeline.d.ts +11 -0
  474. package/script/validator/pipeline.d.ts.map +1 -1
  475. package/script/validator/pipeline.js +40 -17
  476. package/script/validator/type_resolution.d.ts +3 -3
  477. package/script/validator/type_resolution.d.ts.map +1 -1
  478. package/script/validator/type_resolution.js +31 -9
  479. package/esm/parser/entity_refs.d.ts +0 -53
  480. package/esm/parser/entity_refs.d.ts.map +0 -1
  481. package/esm/parser/entity_refs.js +0 -151
  482. package/script/parser/entity_refs.d.ts +0 -53
  483. package/script/parser/entity_refs.d.ts.map +0 -1
  484. package/script/parser/entity_refs.js +0 -155
@@ -6,120 +6,23 @@
6
6
  * (post-`splitBodyAndAttributes`) with the shared remark processor and
7
7
  * maps each mdast block child to the §2.4-2.6 node taxonomy.
8
8
  *
9
- * Inline markers (modal + $Identifier) are extracted for prose-bearing
10
- * nodes: Paragraph, List items, Table cells, Note bodies, Blockquotes,
11
- * and DefinitionList term/definitions. They are NOT extracted inside
12
- * Code, Feature, or Math blocks (spec §2.5).
13
- *
14
9
  * This module is pure library code: no `Deno.*` APIs.
15
10
  */
16
11
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.extractMarkersFromText = extractMarkersFromText;
18
12
  exports.verbatimSlice = verbatimSlice;
19
13
  exports.buildBodyAst = buildBodyAst;
14
+ exports.buildBodyAstWithTree = buildBodyAstWithTree;
20
15
  const remark_js_1 = require("../parser/remark.js");
21
- const entity_refs_js_1 = require("../parser/entity_refs.js");
22
- // ---------------------------------------------------------------------------
23
- // Inline marker recognition — modal keywords
24
- // ---------------------------------------------------------------------------
16
+ const line_endings_js_1 = require("../util/line_endings.js");
25
17
  /**
26
- * RFC 2119 tokens (lowercase canonical; matched case-insensitively in prose).
27
- * Multi-word forms listed first so the alternation greedily matches them.
18
+ * Build an InlineContent from verbatim source prose.
19
+ * `storedText` is the verbatim source prose that `render` emits (§5.1
20
+ * faithful). The `_recognitionText` and `_range` parameters are kept for
21
+ * call-site compatibility but are intentionally unused — inline-construct
22
+ * extraction has moved to `Entry.bodyTokens` (ADR-016).
28
23
  */
29
- const RFC2119_RE = /\b(shall not|should not|must not|shall|should|must|may)\b/gi;
30
- // EARS keywords recognised: When, While, Where, Unless.
31
- const EARS_RE = /\b(When|While|Where|Unless)\b/g;
32
- /** `$Identifier` entity reference — must not be preceded by another `$`. */
33
- const ENTITY_REF_RE = /\$([A-Za-z][A-Za-z0-9_]*)/g;
34
- /**
35
- * Extract all inline markers from a prose text string.
36
- * `lineOffset` is the 0-based line index of the text within the body
37
- * (used for SourceRange line numbers).
38
- *
39
- * For multi-line text the SourceRange carries the first line's 1-based
40
- * column; this is best-effort for PR 2 (noted as DONE_WITH_CONCERNS:
41
- * multi-line paragraph ranges are approximated to the starting line).
42
- *
43
- * Exported so the AST-native §3.4.1 normalisation pass
44
- * (`core/ast/normalize.ts`) re-derives `InlineContent.markers` from the
45
- * normalised text with the SAME extraction the builder uses — no regex
46
- * duplication.
47
- */
48
- function extractMarkersFromText(text, startRange) {
49
- const markers = [];
50
- const lines = text.split("\n");
51
- for (let li = 0; li < lines.length; li++) {
52
- const line = lines[li];
53
- const lineNo = startRange.start.line + li;
54
- // ---- RFC 2119 ---------------------------------------------------
55
- RFC2119_RE.lastIndex = 0;
56
- let m;
57
- while ((m = RFC2119_RE.exec(line)) !== null) {
58
- const raw = m[1];
59
- const canonical = raw.toLowerCase();
60
- const col = m.index + 1;
61
- markers.push({
62
- kind: "modal",
63
- cls: "rfc2119",
64
- canonical,
65
- raw, // preserve source form for uppercase-keyword detection (MSL-M060)
66
- range: {
67
- start: { line: lineNo, column: col },
68
- end: { line: lineNo, column: col + raw.length },
69
- },
70
- });
71
- }
72
- // ---- EARS -------------------------------------------------------
73
- EARS_RE.lastIndex = 0;
74
- while ((m = EARS_RE.exec(line)) !== null) {
75
- const raw = m[1];
76
- const col = m.index + 1;
77
- markers.push({
78
- kind: "modal",
79
- cls: "ears",
80
- canonical: raw, // EARS: source form is canonical
81
- raw, // same as canonical for EARS
82
- range: {
83
- start: { line: lineNo, column: col },
84
- end: { line: lineNo, column: col + raw.length },
85
- },
86
- });
87
- }
88
- // ---- $Identifier ------------------------------------------------
89
- ENTITY_REF_RE.lastIndex = 0;
90
- while ((m = ENTITY_REF_RE.exec(line)) !== null) {
91
- // Discard if preceded by another `$` (math fence `$$…$$`)
92
- if (m.index > 0 && line[m.index - 1] === "$")
93
- continue;
94
- // Discard if preceded by `\` (escaped)
95
- if (m.index > 0 && line[m.index - 1] === "\\")
96
- continue;
97
- const ident = m[0]; // includes leading `$`
98
- const bare = m[1];
99
- const col = m.index + 1;
100
- markers.push({
101
- kind: "entity",
102
- ident,
103
- convention: (0, entity_refs_js_1.classifyConvention)(bare),
104
- range: {
105
- start: { line: lineNo, column: col },
106
- end: { line: lineNo, column: col + ident.length },
107
- },
108
- });
109
- }
110
- }
111
- return markers;
112
- }
113
- /**
114
- * Build an InlineContent. `storedText` is the verbatim source prose that
115
- * `render` emits (§5.1 faithful); `recognitionText` is the flattened
116
- * projection that modal / $Identifier recognition runs on (so `\bshall\b`
117
- * still matches inside `_shall_`). For nodes whose text carries no inline
118
- * markup the two are identical and behaviour is unchanged.
119
- */
120
- function inlineContent(storedText, recognitionText, range) {
121
- const markers = extractMarkersFromText(recognitionText, range);
122
- return { text: storedText, markers };
24
+ function inlineContent(storedText, _recognitionText, _range) {
25
+ return { text: storedText };
123
26
  }
124
27
  // ---------------------------------------------------------------------------
125
28
  // mdast position → SourceRange
@@ -274,7 +177,6 @@ function splitVerbatimDeflist(verbatim) {
274
177
  // ---------------------------------------------------------------------------
275
178
  // mdast text extraction helper
276
179
  // ---------------------------------------------------------------------------
277
- // deno-lint-ignore no-explicit-any
278
180
  function extractMdastText(node) {
279
181
  if (!node)
280
182
  return "";
@@ -282,10 +184,10 @@ function extractMdastText(node) {
282
184
  // re-add the backtick delimiters so the round-trip is byte-identical.
283
185
  if (node.type === "inlineCode")
284
186
  return `\`${node.value}\``;
285
- if (typeof node.value === "string")
187
+ if ("value" in node && typeof node.value === "string")
286
188
  return node.value;
287
- if (Array.isArray(node.children)) {
288
- return node.children.map(extractMdastText).join("");
189
+ if ("children" in node) {
190
+ return node.children.map((c) => extractMdastText(c)).join("");
289
191
  }
290
192
  return "";
291
193
  }
@@ -365,7 +267,6 @@ function deQuote(rawBlockquote) {
365
267
  // ---------------------------------------------------------------------------
366
268
  // Main builder — mdast node → BodyBlock
367
269
  // ---------------------------------------------------------------------------
368
- // deno-lint-ignore no-explicit-any
369
270
  function mapMdastNode(node, body) {
370
271
  const range = positionToRange(node.position);
371
272
  switch (node.type) {
@@ -444,16 +345,12 @@ function mapMdastNode(node, body) {
444
345
  };
445
346
  }
446
347
  case "list": {
348
+ const listNode = node;
447
349
  // Detect GFM task-list items (remark-gfm sets `checked` to true/false).
448
- // deno-lint-ignore no-explicit-any
449
- const hasTaskItems = node.children.some((item) => item.checked != null);
450
- const items = node.children.map(
451
- // deno-lint-ignore no-explicit-any
452
- (item) => {
350
+ const hasTaskItems = listNode.children.some((item) => item.checked != null);
351
+ const items = listNode.children.map((item) => {
453
352
  const itemRange = positionToRange(item.position);
454
- const subBlocks = (item.children ?? []).map(
455
- // deno-lint-ignore no-explicit-any
456
- (child) => mapMdastNode(child, body));
353
+ const subBlocks = (item.children ?? []).map((child) => mapMdastNode(child, body));
457
354
  return {
458
355
  blocks: subBlocks,
459
356
  ...(item.checked != null ? { checked: item.checked } : {}),
@@ -463,19 +360,20 @@ function mapMdastNode(node, body) {
463
360
  });
464
361
  return {
465
362
  kind: "list",
466
- ordered: node.ordered ?? false,
467
- spread: node.spread ?? false,
363
+ ordered: listNode.ordered ?? false,
364
+ spread: listNode.spread ?? false,
468
365
  items,
469
366
  ...(hasTaskItems ? { hasTaskItems: true } : {}),
470
367
  range,
471
368
  };
472
369
  }
473
370
  case "table": {
474
- // deno-lint-ignore no-explicit-any
475
- const rows = node.children.map((row) =>
476
- // deno-lint-ignore no-explicit-any
477
- (row.children ?? []).map((cell) => {
478
- const cellText = extractMdastText(cell);
371
+ const tableNode = node;
372
+ const rows = tableNode.children.map((row) => row.children.map((cell) => {
373
+ // TableCell children are PhrasingContent ⊂ RootContent ⊂ Nodes.
374
+ const cellText = cell.children
375
+ .map((c) => extractMdastText(c))
376
+ .join("");
479
377
  const cellRange = positionToRange(cell.position);
480
378
  // stored == recognition (table cells render via TableNode.raw; Task 5 confirms)
481
379
  return inlineContent(cellText, cellText, cellRange);
@@ -492,7 +390,7 @@ function mapMdastNode(node, body) {
492
390
  }
493
391
  case "code": {
494
392
  const lang = node.lang ?? undefined; // empty string → undefined
495
- if (lang === "gherkin") {
393
+ if (lang === "gherkin" || lang === "feature") {
496
394
  return {
497
395
  kind: "feature",
498
396
  source: node.value ?? "",
@@ -507,8 +405,9 @@ function mapMdastNode(node, body) {
507
405
  };
508
406
  }
509
407
  case "blockquote": {
510
- const verbatim = deQuote(verbatimSlice(body, node.position));
511
- const firstChild = node.children?.[0];
408
+ const bqNode = node;
409
+ const verbatim = deQuote(verbatimSlice(body, bqNode.position));
410
+ const firstChild = bqNode.children?.[0];
512
411
  if (firstChild?.type === "paragraph") {
513
412
  const paraText = extractMdastText(firstChild);
514
413
  const admonMatch = ADMONITION_FIRST_LINE_RE.exec(paraText.trim());
@@ -517,9 +416,8 @@ function mapMdastNode(node, body) {
517
416
  // Flattened recognition text (unchanged from prior behaviour):
518
417
  // marker-stripped first paragraph + remaining paragraphs.
519
418
  const rest = paraText.replace(ADMONITION_FIRST_LINE_RE, "").trim();
520
- const otherText = node.children
419
+ const otherText = bqNode.children
521
420
  .slice(1)
522
- // deno-lint-ignore no-explicit-any
523
421
  .map((c) => extractMdastText(c))
524
422
  .join("\n\n");
525
423
  const flattened = [rest, otherText].filter(Boolean).join("\n\n");
@@ -549,8 +447,7 @@ function mapMdastNode(node, body) {
549
447
  };
550
448
  }
551
449
  }
552
- const bqFlattened = node.children
553
- // deno-lint-ignore no-explicit-any
450
+ const bqFlattened = bqNode.children
554
451
  .map((c) => extractMdastText(c))
555
452
  .join("\n\n");
556
453
  return {
@@ -561,8 +458,7 @@ function mapMdastNode(node, body) {
561
458
  }
562
459
  default: {
563
460
  let subkind;
564
- if (node.type === "heading" ||
565
- node.type === "setextHeading") {
461
+ if (node.type === "heading") {
566
462
  subkind = "heading";
567
463
  }
568
464
  else if (node.type === "thematicBreak") {
@@ -601,10 +497,25 @@ function mapMdastNode(node, body) {
601
497
  * only for single-line paragraphs.
602
498
  */
603
499
  function buildBodyAst(body) {
604
- if (!body.trim())
605
- return [];
606
- const tree = remark_js_1.processor.parse(body);
607
- const blocks = tree.children.map((node) => mapMdastNode(node, body));
500
+ return buildBodyAstWithTree(body).blocks;
501
+ }
502
+ /**
503
+ * Like {@linkcode buildBodyAst} but also returns the intermediate mdast
504
+ * `Root` so callers that need it (e.g. body-token extraction) avoid
505
+ * re-parsing.
506
+ */
507
+ function buildBodyAstWithTree(body) {
508
+ // Line-ending normalisation is a §3.4 spec-permitted transformation:
509
+ // every AST is built from LF-canonical text so `\r` never reaches a
510
+ // node's text or markers. Without this, `buildBodyAst("a\r\nb")` and
511
+ // `buildBodyAst("a\nb")` would produce different ASTs, breaking the
512
+ // build/render/format contract for CRLF-bearing inputs.
513
+ const normalised = (0, line_endings_js_1.normalizeLineEndings)(body);
514
+ if (!normalised.trim()) {
515
+ return { blocks: [], tree: { type: "root", children: [] } };
516
+ }
517
+ const tree = remark_js_1.processor.parse(normalised);
518
+ const blocks = tree.children.map((node) => mapMdastNode(node, normalised));
608
519
  // Post-pass: assign caption positions
609
- return assignCaptionPositions(blocks);
520
+ return { blocks: assignCaptionPositions(blocks), tree };
610
521
  }
@@ -3,13 +3,17 @@
3
3
  *
4
4
  * Canonical body-AST node taxonomy. Authoritative spec:
5
5
  * `docs/specs/markspec-core-data-model.md` §2.4 (closed 10-block
6
- * catalogue), §2.5 (inline markers), §2.6 (captions).
6
+ * catalogue), §2.6 (captions).
7
7
  *
8
8
  * PR 1 of the canonical-body-AST plan: pure type contract, zero
9
9
  * behaviour. The builder (`build.ts`) and renderer (`render.ts`)
10
10
  * land in later PRs.
11
+ *
12
+ * ADR-016: inline-construct extraction (modal keywords, EARS triggers,
13
+ * entity refs, Gherkin tokens) has moved to `Entry.bodyTokens` —
14
+ * see `core/parser/body_tokens.ts`. `InlineContent` now carries only
15
+ * verbatim source text.
11
16
  */
12
- import type { EntityRefConvention } from "../model/mod.js";
13
17
  /** Body-relative source span. 1-based line/column, matching the
14
18
  * codebase's {@link SourceLocation} convention. No `file`: that
15
19
  * lives on the owning {@link Entry}. */
@@ -23,51 +27,15 @@ export interface SourceRange {
23
27
  readonly column: number;
24
28
  };
25
29
  }
26
- /** RFC 2119 vs EARS modal class (spec §2.5.1). */
27
- export type ModalMarkerClass = "rfc2119" | "ears";
28
- /** A recognised modal keyword occurrence in prose (spec §2.5.1). */
29
- export interface ModalMarker {
30
- readonly kind: "modal";
31
- readonly cls: ModalMarkerClass;
32
- /** Canonical (lowercased RFC 2119 / case-preserved EARS) form. */
33
- readonly canonical: string;
34
- /**
35
- * Original source text as it appears in the body (may differ from
36
- * `canonical` for RFC 2119 keywords written in uppercase, e.g.
37
- * `"SHALL"` vs `canonical = "shall"`). Used by the MSL-M060 validator
38
- * to report the exact uppercase form in the diagnostic message and to
39
- * detect whether the keyword deviates from canonical form.
40
- *
41
- * Populated by {@link extractMarkersFromText} in `core/ast/build.ts`.
42
- * Absent only for `ModalMarker` values constructed outside the builder
43
- * (e.g. in tests that predate this field).
44
- */
45
- readonly raw?: string;
46
- readonly range: SourceRange;
47
- }
48
- /** An inline `$Identifier` entity reference (spec §2.5.2). Reuses
49
- * the existing {@link EntityRefConvention}. */
50
- export interface EntityRefMarker {
51
- readonly kind: "entity";
52
- /** Identifier including the leading `$`. */
53
- readonly ident: string;
54
- readonly convention: EntityRefConvention;
55
- readonly range: SourceRange;
56
- }
57
- /** Inline marker union (spec §2.5). */
58
- export type InlineMarker = ModalMarker | EntityRefMarker;
59
- /**
60
- * Prose text plus the inline markers recognised within it.
30
+ /** Prose text. Verbatim source (markup-preserving per spec §5.1).
61
31
  *
62
32
  * `text` is the **verbatim source prose** (markup-preserving — emphasis,
63
33
  * strong, links, autolinks, hard line breaks survive byte-identically per
64
- * spec §5.1). `markers` are recognised from the flattened projection so
65
- * modal / $Identifier detection is unaffected by surrounding markup.
66
- * Marker `range` columns are best-effort relative to the verbatim text.
34
+ * spec §5.1). Inline-construct extraction (modal keywords, EARS triggers,
35
+ * entity refs) has moved to `Entry.bodyTokens` (ADR-016 Decision 5).
67
36
  */
68
37
  export interface InlineContent {
69
38
  readonly text: string;
70
- readonly markers: readonly InlineMarker[];
71
39
  }
72
40
  /** A list item: a sequence of blocks (spec §2.4 `List`). */
73
41
  export interface ListItemNode {
@@ -95,7 +63,7 @@ export interface DefinitionPair {
95
63
  }
96
64
  /** GitHub-style admonition kinds (spec §2.4 `Note`). */
97
65
  export type AdmonitionKind = "NOTE" | "TIP" | "IMPORTANT" | "WARNING" | "CAUTION";
98
- /** CommonMark paragraph; carries inline markers (spec §2.4). */
66
+ /** CommonMark paragraph (spec §2.4). */
99
67
  export interface ParagraphNode {
100
68
  readonly kind: "paragraph";
101
69
  readonly content: InlineContent;
@@ -145,7 +113,7 @@ export interface CodeNode {
145
113
  readonly text: string;
146
114
  readonly range: SourceRange;
147
115
  }
148
- /** Fenced code with info-string `gherkin`. Gherkin is kept verbatim
116
+ /** Fenced code with info-string `gherkin` or `feature`. Content is kept verbatim
149
117
  * for now; structured scenario parsing is deferred to a later PR
150
118
  * (see the canonical-body-AST plan). */
151
119
  export interface FeatureNode {
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/ast/nodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;wCAEwC;AACxC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,QAAQ,CAAC,GAAG,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAClE;AAED,kDAAkD;AAClD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAAC;AAElD,oEAAoE;AACpE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED;+CAC+C;AAC/C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED,uCAAuC;AACvC,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,eA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,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED;qEACqE;AACrE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,gBAAgB,GAAG,MAAM,CAAC;IACzD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED,uEAAuE;AACvE,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,QAAQ,GACR,SAAS,GACT,UAAU,GACV,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,kBAAkB,GAClB,QAAQ,GACR,cAAc,GACd,WAAW,GACX,WAAW,CAAC"}
@@ -4,10 +4,15 @@
4
4
  *
5
5
  * Canonical body-AST node taxonomy. Authoritative spec:
6
6
  * `docs/specs/markspec-core-data-model.md` §2.4 (closed 10-block
7
- * catalogue), §2.5 (inline markers), §2.6 (captions).
7
+ * catalogue), §2.6 (captions).
8
8
  *
9
9
  * PR 1 of the canonical-body-AST plan: pure type contract, zero
10
10
  * behaviour. The builder (`build.ts`) and renderer (`render.ts`)
11
11
  * land in later PRs.
12
+ *
13
+ * ADR-016: inline-construct extraction (modal keywords, EARS triggers,
14
+ * entity refs, Gherkin tokens) has moved to `Entry.bodyTokens` —
15
+ * see `core/parser/body_tokens.ts`. `InlineContent` now carries only
16
+ * verbatim source text.
12
17
  */
13
18
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,28 +5,20 @@
5
5
  *
6
6
  * `normalizeBodyAst` is a deterministic, total, pure AST→AST transform
7
7
  * that applies the §3.4.1 modal-keyword case rule to every prose-bearing
8
- * node's `InlineContent.text` and re-derives `InlineContent.markers` from
9
- * the normalised text via the SAME extraction the builder uses
10
- * (`extractMarkersFromText`, re-exported from `core/ast/build.ts`).
8
+ * node's `InlineContent.text`.
11
9
  *
12
- * §3.4.1 rule (`docs/specs/markspec-core-data-model.md` §3.4.1), ported
13
- * verbatim from the string pass `normalizeModalKeywords` in
14
- * `core/formatter/mod.ts`:
10
+ * §3.4.1 rule (`docs/specs/markspec-core-data-model.md` §3.4.1):
15
11
  *
16
12
  * - RFC 2119 (`SHALL`, `SHOULD`, `MAY`, `MUST`, optionally `… NOT`) —
17
13
  * always lowercased.
18
14
  * - EARS (`When`, `While`, `Where`, `Unless`) — lowercased
19
15
  * mid-sentence, capitalisation preserved when sentence-initial.
20
16
  *
21
- * The regexes and `isSentenceInitial` logic are intentionally a faithful
22
- * copy of `core/formatter/mod.ts`. The string pass cannot be imported:
23
- * `core/formatter/` already depends on `core/ast/`, so an `ast →
24
- * formatter` import would invert the one-directional dependency flow and
25
- * create a cycle. The formatter now delegates to THIS module for the AST
26
- * path (SP3 Task 5), but `normalizeModalKeywords` in `formatter/mod.ts`
27
- * is retained for the title/trailer string paths. Full deduplication is
28
- * deferred to a future sprint (TODO SP4: unify the two implementations
29
- * once all prose paths migrate to the AST path).
17
+ * The shared `RFC2119_MODAL_RE`, `EARS_KEYWORD_RE`, and `isSentenceInitial`
18
+ * helpers are imported from `core/util/modals.ts` (D11 consolidation).
19
+ * They cannot be imported from `formatter/mod.ts` because `formatter/`
20
+ * depends on `ast/`, making an `ast → formatter` import a dependency cycle.
21
+ * `core/util/` is the base level that both modules can import from.
30
22
  *
31
23
  * Invariants (HARD — never weaken):
32
24
  * - Pure: no `Deno.*`, no I/O.
@@ -44,8 +36,7 @@
44
36
  import type { BodyBlock } from "./nodes.js";
45
37
  /**
46
38
  * Apply the §3.4.1 modal-keyword case rule to every prose-bearing node
47
- * in a body AST, re-deriving `InlineContent.markers` from the normalised
48
- * text.
39
+ * in a body AST.
49
40
  *
50
41
  * Pure, deterministic, total (never throws; unknown shapes pass
51
42
  * through), idempotent, and non-mutating: a fresh top-level array is
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/ast/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAIH,OAAO,KAAK,EAEV,SAAS,EASV,MAAM,YAAY,CAAC;AAkMpB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,EAAE,CAEb"}
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/ast/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAQH,OAAO,KAAK,EAEV,SAAS,EASV,MAAM,YAAY,CAAC;AAiJpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,EAAE,CAEb"}
@@ -6,28 +6,20 @@
6
6
  *
7
7
  * `normalizeBodyAst` is a deterministic, total, pure AST→AST transform
8
8
  * that applies the §3.4.1 modal-keyword case rule to every prose-bearing
9
- * node's `InlineContent.text` and re-derives `InlineContent.markers` from
10
- * the normalised text via the SAME extraction the builder uses
11
- * (`extractMarkersFromText`, re-exported from `core/ast/build.ts`).
9
+ * node's `InlineContent.text`.
12
10
  *
13
- * §3.4.1 rule (`docs/specs/markspec-core-data-model.md` §3.4.1), ported
14
- * verbatim from the string pass `normalizeModalKeywords` in
15
- * `core/formatter/mod.ts`:
11
+ * §3.4.1 rule (`docs/specs/markspec-core-data-model.md` §3.4.1):
16
12
  *
17
13
  * - RFC 2119 (`SHALL`, `SHOULD`, `MAY`, `MUST`, optionally `… NOT`) —
18
14
  * always lowercased.
19
15
  * - EARS (`When`, `While`, `Where`, `Unless`) — lowercased
20
16
  * mid-sentence, capitalisation preserved when sentence-initial.
21
17
  *
22
- * The regexes and `isSentenceInitial` logic are intentionally a faithful
23
- * copy of `core/formatter/mod.ts`. The string pass cannot be imported:
24
- * `core/formatter/` already depends on `core/ast/`, so an `ast →
25
- * formatter` import would invert the one-directional dependency flow and
26
- * create a cycle. The formatter now delegates to THIS module for the AST
27
- * path (SP3 Task 5), but `normalizeModalKeywords` in `formatter/mod.ts`
28
- * is retained for the title/trailer string paths. Full deduplication is
29
- * deferred to a future sprint (TODO SP4: unify the two implementations
30
- * once all prose paths migrate to the AST path).
18
+ * The shared `RFC2119_MODAL_RE`, `EARS_KEYWORD_RE`, and `isSentenceInitial`
19
+ * helpers are imported from `core/util/modals.ts` (D11 consolidation).
20
+ * They cannot be imported from `formatter/mod.ts` because `formatter/`
21
+ * depends on `ast/`, making an `ast → formatter` import a dependency cycle.
22
+ * `core/util/` is the base level that both modules can import from.
31
23
  *
32
24
  * Invariants (HARD — never weaken):
33
25
  * - Pure: no `Deno.*`, no I/O.
@@ -45,45 +37,11 @@
45
37
  Object.defineProperty(exports, "__esModule", { value: true });
46
38
  exports.normalizeBodyAst = normalizeBodyAst;
47
39
  const fence_js_1 = require("../util/fence.js");
48
- const build_js_1 = require("./build.js");
40
+ const modals_js_1 = require("../util/modals.js");
49
41
  // ---------------------------------------------------------------------------
50
- // §3.4.1 string helper — faithful port of formatter/mod.ts
51
- // (RFC2119_MODAL_RE, EARS_KEYWORD_RE, isSentenceInitial,
52
- // normalizeModalKeywords). Kept byte-for-byte equivalent so the AST
53
- // port matches the string pass exactly; Task 5 collapses the two.
42
+ // §3.4.1 string helper — uses shared RFC2119_MODAL_RE, EARS_KEYWORD_RE,
43
+ // and isSentenceInitial from core/util/modals.ts (D11 consolidation).
54
44
  // ---------------------------------------------------------------------------
55
- /**
56
- * RFC 2119 modal keywords in uppercase form, with optional ` NOT` suffix.
57
- * Captured for canonical-form normalisation per spec §3.4.1: uppercase
58
- * input is accepted but emitted lowercase, unconditionally.
59
- */
60
- const RFC2119_MODAL_RE = /\b(SHALL|SHOULD|MAY|MUST)(\s+NOT)?\b/g;
61
- /**
62
- * EARS keywords subject to the sentence-initial rule of spec §3.4.1:
63
- * lowercased when mid-sentence, preserved when starting a sentence.
64
- * `If…then` is deferred to a later slice because its multi-token form
65
- * needs separate handling.
66
- */
67
- const EARS_KEYWORD_RE = /\b(When|While|Where|Unless)\b/g;
68
- /**
69
- * Decide whether the EARS keyword at `offset` in `line` is at sentence
70
- * start (return value true). Walks left over whitespace and reports true
71
- * when it hits the beginning of the line or a sentence-terminating
72
- * punctuation character (`.`, `!`, `?`).
73
- *
74
- * Faithful copy of `isSentenceInitial` in `core/formatter/mod.ts`.
75
- */
76
- function isSentenceInitial(line, offset) {
77
- if (offset === 0)
78
- return true;
79
- let i = offset - 1;
80
- while (i >= 0 && (line[i] === " " || line[i] === "\t"))
81
- i--;
82
- if (i < 0)
83
- return true;
84
- const prev = line[i];
85
- return prev === "." || prev === "!" || prev === "?";
86
- }
87
45
  /**
88
46
  * Apply the §3.4.1 modal-keyword case rule to a prose string.
89
47
  *
@@ -103,8 +61,8 @@ function normalizeModalsInText(text) {
103
61
  // Indented-code / attribute-trailer lines aren't prose either.
104
62
  if (/^( {4}|\t)/.test(line))
105
63
  return;
106
- let normalized = line.replace(RFC2119_MODAL_RE, (m) => m.toLowerCase());
107
- normalized = normalized.replace(EARS_KEYWORD_RE, (m, _g1, offset) => isSentenceInitial(normalized, offset) ? m : m.toLowerCase());
64
+ let normalized = line.replace(modals_js_1.RFC2119_MODAL_RE, (m) => m.toLowerCase());
65
+ normalized = normalized.replace(modals_js_1.EARS_KEYWORD_RE, (m, _g1, offset) => (0, modals_js_1.isSentenceInitial)(normalized, offset) ? m : m.toLowerCase());
108
66
  lines[i] = normalized;
109
67
  });
110
68
  return lines.join("\n");
@@ -114,31 +72,16 @@ function normalizeModalsInText(text) {
114
72
  // ---------------------------------------------------------------------------
115
73
  /**
116
74
  * Return a NEW `InlineContent` whose `text` has every modal keyword
117
- * normalised per §3.4.1 and whose `markers` are RE-DERIVED from the
118
- * normalised text via the builder's `extractMarkersFromText` (so the
119
- * marker set never goes stale relative to the text).
120
- *
121
- * The marker `range` start is anchored at the original content's first
122
- * marker line when available, else (1,1); this mirrors the builder's
123
- * best-effort, body-relative range convention and is irrelevant to the
124
- * equivalence relation (which elides every `range`).
75
+ * normalised per §3.4.1.
125
76
  *
126
77
  * If the normalised text equals the original, the original node is
127
- * returned UNCHANGED (preserves the builder's exact ranges / markers and
128
- * makes the no-op case allocation-free).
78
+ * returned UNCHANGED (makes the no-op case allocation-free).
129
79
  */
130
80
  function normalizeInline(content) {
131
81
  const normalizedText = normalizeModalsInText(content.text);
132
82
  if (normalizedText === content.text)
133
83
  return content;
134
- const startRange = {
135
- start: { line: 1, column: 1 },
136
- end: { line: 1, column: 1 },
137
- };
138
- return {
139
- text: normalizedText,
140
- markers: (0, build_js_1.extractMarkersFromText)(normalizedText, startRange),
141
- };
84
+ return { text: normalizedText };
142
85
  }
143
86
  // ---------------------------------------------------------------------------
144
87
  // Per-node normalisation — recurse structurally; verbatim nodes untouched
@@ -234,8 +177,7 @@ function normalizeBlocks(blocks) {
234
177
  // ---------------------------------------------------------------------------
235
178
  /**
236
179
  * Apply the §3.4.1 modal-keyword case rule to every prose-bearing node
237
- * in a body AST, re-deriving `InlineContent.markers` from the normalised
238
- * text.
180
+ * in a body AST.
239
181
  *
240
182
  * Pure, deterministic, total (never throws; unknown shapes pass
241
183
  * through), idempotent, and non-mutating: a fresh top-level array is
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @module compiler/constants
3
+ *
4
+ * Shared constants for the compiler pipeline.
5
+ */
6
+ import type { LinkKind } from "../model/mod.js";
7
+ /**
8
+ * Attribute keys that produce traceability links per ADR-002.
9
+ *
10
+ * Spec attributes: Satisfies, Derived-from, References, Allocated-to.
11
+ * Test attributes: Verifies, Tests.
12
+ * Element attributes: Realizes, Depends-on, Part-of, Generated-from.
13
+ * Universal: Supersedes (same-family).
14
+ */
15
+ export declare const ATTR_TO_LINK_KIND: Readonly<Record<string, LinkKind>>;
16
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/compiler/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAYhE,CAAC"}