@driftsys/markspec 0.5.0 → 0.6.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 (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 +12 -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 +107 -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 +15 -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 +105 -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
@@ -56,6 +56,16 @@ export interface ProfileConvention {
56
56
  readonly settings: Readonly<Record<string, string>>;
57
57
  readonly description?: string;
58
58
  }
59
+ /**
60
+ * Resolved discipline mode per ADR-017 Slice 5. The mode shapes
61
+ * downstream behaviour (Doctor reporting, LSP scaffold ordering,
62
+ * Slice 4 mixed-allocation rule activation).
63
+ */
64
+ export type DisciplineMode = "flat" | "tiered" | "none";
65
+ /** A profile-declared discipline kind. */
66
+ export interface KindDecl {
67
+ readonly description?: string;
68
+ }
59
69
  export type EnforcementMode = "off" | "warn" | "error";
60
70
  export interface TypeDef {
61
71
  readonly name: string;
@@ -69,6 +79,12 @@ export interface TypeDef {
69
79
  /** Optional semantic color-role name (key into `ProfileManifest.colors`). */
70
80
  readonly color?: string;
71
81
  readonly description?: string;
82
+ /**
83
+ * Discipline kind explicitly assigned to this type. When absent, the
84
+ * effective discipline registry auto-inherits from the type's `extends:`
85
+ * ancestor (see core/profile/discipline_registry.ts).
86
+ */
87
+ readonly discipline?: string;
72
88
  }
73
89
  export interface DocTypeDef {
74
90
  readonly id: string;
@@ -89,6 +105,8 @@ export type ProfileSpecifier = {
89
105
  readonly scope?: string;
90
106
  readonly name: string;
91
107
  readonly range: string;
108
+ } | {
109
+ readonly kind: "builtin";
92
110
  };
93
111
  /** Parsed `markspec.yaml` content — the manifest authored in a profile. */
94
112
  export interface ProfileManifest {
@@ -114,6 +132,31 @@ export interface ProfileManifest {
114
132
  readonly types: readonly DocTypeDef[];
115
133
  readonly frontMatter: readonly AttrDecl[];
116
134
  };
135
+ /**
136
+ * Profile-declared discipline kinds (ADR-017 Invariant 2). Maps kind
137
+ * name → declaration metadata. Empty when the manifest does not declare
138
+ * `profile.kinds:`.
139
+ */
140
+ readonly kinds: ReadonlyMap<string, KindDecl>;
141
+ /**
142
+ * Prose-analysis configuration. All lexicon lists are additive across
143
+ * the profile chain (parent entries first, child entries appended,
144
+ * duplicates dropped).
145
+ */
146
+ readonly prose: {
147
+ readonly lexicons: {
148
+ /** Extra tokens that are never flagged as undefined capitalized terms. */
149
+ readonly "capitalized-allow": readonly string[];
150
+ /** Extra abbreviation tokens that suppress false sentence-end detection. */
151
+ readonly "sentence-abbrev": readonly string[];
152
+ };
153
+ };
154
+ /**
155
+ * Author-declared discipline mode (ADR-017 Slice 5). `undefined` when
156
+ * the manifest does not declare `profile.discipline-mode:`; the merge
157
+ * layer then runs inference to populate `EffectiveProfile.disciplineMode`.
158
+ */
159
+ readonly disciplineMode?: DisciplineMode;
117
160
  }
118
161
  /**
119
162
  * A profile after it has been resolved and parsed. One tier of a
@@ -175,6 +218,12 @@ export interface EffectiveTypeDef {
175
218
  readonly description: ProvenancedValue<string | undefined>;
176
219
  readonly attrDescriptions: ProvenancedMap<string>;
177
220
  readonly relationDescriptions: ProvenancedMap<string>;
221
+ /**
222
+ * Discipline kind explicitly assigned to this type by some tier of the
223
+ * profile chain. `value` is `undefined` when no tier assigned one — the
224
+ * registry builder then walks the `extends:` chain to resolve.
225
+ */
226
+ readonly discipline: ProvenancedValue<string | undefined>;
178
227
  }
179
228
  /**
180
229
  * The merged, validator-ready view of a profile chain. Every field carries
@@ -191,5 +240,25 @@ export interface EffectiveProfile {
191
240
  readonly types: ProvenancedMap<DocTypeDef>;
192
241
  readonly frontMatter: ProvenancedMap<AttrDecl>;
193
242
  };
243
+ /** Discipline kinds declared across the profile chain (ADR-017). */
244
+ readonly kinds: ProvenancedMap<KindDecl>;
245
+ /**
246
+ * Prose-analysis configuration merged across the chain. Each lexicon list
247
+ * is list-additive: parent entries first, child entries appended, duplicates
248
+ * dropped (profile-schema §5.1).
249
+ */
250
+ readonly prose: {
251
+ readonly lexicons: {
252
+ readonly "capitalized-allow": ProvenancedValue<readonly string[]>;
253
+ readonly "sentence-abbrev": ProvenancedValue<readonly string[]>;
254
+ };
255
+ };
256
+ /**
257
+ * Resolved discipline mode after the chain folds (ADR-017 Slice 5).
258
+ * Always defined — `origin` is `"declared"` when at least one tier
259
+ * supplied a value, otherwise `"inferred"` (computed from the
260
+ * effective type graph by `inferDisciplineMode()`).
261
+ */
262
+ readonly disciplineMode: ProvenancedValue<DisciplineMode>;
194
263
  }
195
264
  //# sourceMappingURL=profile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/model/profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,mEAAmE;AACnE,eAAO,MAAM,WAAW,qJAed,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAEnD,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,SAAS,CAGlD,CAAC;AAMH,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAC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B,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;SACjE,CAAC;KACH,CAAC;IACF;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAC3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/parser/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAalE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,CAgBrE;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,QAA6B,CAAC;AAYvD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,eAAe,CA6BjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,GACd,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA+BpB"}
1
+ {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/parser/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAalE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,CAgBrE;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,QAA6B,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,eAAe,CA6BjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,GACd,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA+BpB"}
@@ -5,7 +5,7 @@
5
5
  * Handles trailing backslash separators and distinguishes
6
6
  * trailing attribute blocks from body prose.
7
7
  */
8
- import { attributeSpec } from "../model/attributes.js";
8
+ import { attributeSpec, CSV_SPLITTABLE_TYPES } from "../model/attributes.js";
9
9
  /**
10
10
  * Pattern matching a `Key: Value` attribute line.
11
11
  * Key must start with an uppercase letter, may contain lowercase letters and hyphens.
@@ -46,15 +46,6 @@ export function parseAttributes(lines) {
46
46
  * Used to detect attribute blocks at the end of entry bodies.
47
47
  */
48
48
  export const ATTR_LINE_RE = /^[A-Z][A-Za-z-]*: .+\\?$/;
49
- /**
50
- * Types whose values may be CSV-split on input per ADR-002 §2.6.
51
- * `citation` is deliberately excluded because locators may contain commas.
52
- */
53
- const CSV_SPLITTABLE_TYPES = new Set([
54
- "id-list",
55
- "tag-list",
56
- "external-id",
57
- ]);
58
49
  /**
59
50
  * Collate a flat list of parsed attributes into a typed, keyed map per
60
51
  * ADR-002 §2.6.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @module core/parser/body_tokens
3
+ *
4
+ * Inline-construct token extraction (ADR-016). Scans entry body prose for
5
+ * the six BodyTokenKind variants, skipping verbatim regions (code, math,
6
+ * inline-code spans). Inside ` ```feature ` / ` ```gherkin ` fences the
7
+ * modal/EARS/entity-ref scanners are suppressed and the gherkin
8
+ * section/step scanners run instead.
9
+ *
10
+ * Single source of truth for inline-construct extraction. Replaces the
11
+ * pre-ADR-016 marker mechanism (`InlineContent.markers`) and the
12
+ * `Entry.entityRefs` field.
13
+ */
14
+ import type { BodyToken, SourceLocation } from "../model/mod.js";
15
+ import type { BodyBlock } from "../ast/nodes.js";
16
+ import type { Root } from "@types/mdast";
17
+ /**
18
+ * Extract body-token stream from an entry body.
19
+ *
20
+ * @param body - entry body string (post-`splitBodyAndAttributes`)
21
+ * @param bodyAst - canonical body AST for the same body (drives
22
+ * code/math/feature fence detection)
23
+ * @param baseLocation - `SourceLocation` of the body's first line; the
24
+ * `file` field is propagated to every emitted token
25
+ * @param columnOffset - Number of source characters stripped from the
26
+ * start of each body line before the body string was built. Added to
27
+ * every emitted column value so columns are relative to the containing
28
+ * buffer line, not the stripped body text. Defaults to 0. Source-file
29
+ * callers (via parseMarkdown's lineMap path) supply the list-item
30
+ * indent width so the LineMap receives buffer-relative columns.
31
+ * @returns tokens sorted by `(line, column)`. Empty when no constructs
32
+ * are recognised.
33
+ */
34
+ export declare function extractBodyTokens(body: string, bodyAst: readonly BodyBlock[], baseLocation: SourceLocation, columnOffset?: number, mdastTree?: Root): readonly BodyToken[];
35
+ //# sourceMappingURL=body_tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body_tokens.d.ts","sourceRoot":"","sources":["../../src/parser/body_tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,SAAS,EAET,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,cAAc,CAAC;AA+JtD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,SAAS,EAAE,EAC7B,YAAY,EAAE,cAAc,EAC5B,YAAY,SAAI,EAChB,SAAS,CAAC,EAAE,IAAI,GACf,SAAS,SAAS,EAAE,CAsEtB"}
@@ -0,0 +1,232 @@
1
+ /**
2
+ * @module core/parser/body_tokens
3
+ *
4
+ * Inline-construct token extraction (ADR-016). Scans entry body prose for
5
+ * the six BodyTokenKind variants, skipping verbatim regions (code, math,
6
+ * inline-code spans). Inside ` ```feature ` / ` ```gherkin ` fences the
7
+ * modal/EARS/entity-ref scanners are suppressed and the gherkin
8
+ * section/step scanners run instead.
9
+ *
10
+ * Single source of truth for inline-construct extraction. Replaces the
11
+ * pre-ADR-016 marker mechanism (`InlineContent.markers`) and the
12
+ * `Entry.entityRefs` field.
13
+ */
14
+ import { processor } from "./remark.js";
15
+ /**
16
+ * Decide the case convention of an entity-reference identifier per spec
17
+ * §2.5.2:
18
+ *
19
+ * - `constant` — all-uppercase letters/digits/underscores, contains at
20
+ * least one underscore or digit, ends with `[A-Z0-9]`. Distinguishes
21
+ * `$DEBOUNCE_WINDOW` from a single-segment PascalCase like `$ASIL`.
22
+ * - `type` — starts with an uppercase letter (PascalCase / single
23
+ * uppercase segment).
24
+ * - `instance` — starts with a lowercase letter (camelCase).
25
+ */
26
+ function classifyConvention(ident) {
27
+ if (/^[A-Z][A-Z0-9_]*[A-Z0-9]$/.test(ident) && /[_0-9]/.test(ident)) {
28
+ return "constant";
29
+ }
30
+ if (/^[A-Z]/.test(ident))
31
+ return "type";
32
+ return "instance";
33
+ }
34
+ /** RFC 2119 modal verbs — matched case-insensitively as whole words.
35
+ * Multi-word compounds (shall not, should not, must not) come first
36
+ * so the leftmost-eager JS regex engine picks them before the bare verb. */
37
+ const MODAL_RE = /\b(shall not|should not|must not|shall|should|may|must|will)\b/gi;
38
+ /** EARS pattern triggers — capital-initial, whole word, case-sensitive. */
39
+ const EARS_RE = /\b(When|While|If|Where|Then)\b/g;
40
+ /** `$Identifier` entity reference (spec §2.5.2). */
41
+ const ENTITY_REF_RE = /\$([A-Za-z][A-Za-z0-9_]*)/g;
42
+ /** Gherkin section headers — class-like tokens. */
43
+ const GHERKIN_SECTION_RE = /\b(Feature|Background|Rule|Scenario Outline|Scenario Template|Scenarios|Examples|Scenario)\b/g;
44
+ /** Gherkin step keywords. */
45
+ const GHERKIN_STEP_RE = /\b(Given|When|Then|And|But)\b/g;
46
+ /**
47
+ * Collect body-relative 1-based line numbers that fall inside verbatim
48
+ * blocks: fenced code, fenced feature, math. Lines in this set are
49
+ * skipped by the modal / EARS / entity-ref scanner.
50
+ *
51
+ * Recurses through list items so nested verbatim blocks (e.g., a code
52
+ * fence inside a list item) are also captured.
53
+ */
54
+ function collectVerbatimLines(blocks) {
55
+ const lines = new Set();
56
+ for (const block of blocks) {
57
+ if (block.kind === "code" || block.kind === "feature" ||
58
+ block.kind === "math") {
59
+ for (let ln = block.range.start.line; ln <= block.range.end.line; ln++) {
60
+ lines.add(ln);
61
+ }
62
+ }
63
+ else if (block.kind === "list") {
64
+ for (const item of block.items) {
65
+ for (const ln of collectVerbatimLines(item.blocks))
66
+ lines.add(ln);
67
+ }
68
+ }
69
+ }
70
+ return lines;
71
+ }
72
+ /**
73
+ * Walk `bodyAst` for `feature` nodes. For each, scan its source text for
74
+ * Gherkin section + step keywords. Positions are body-relative based on
75
+ * the node's `range.start.line`.
76
+ */
77
+ function emitGherkin(blocks, out, baseLocation, columnOffset) {
78
+ for (const block of blocks) {
79
+ if (block.kind === "feature") {
80
+ const startLine = block.range.start.line;
81
+ const lines = block.source.split("\n");
82
+ for (let li = 0; li < lines.length; li++) {
83
+ const line = lines[li];
84
+ // Body-relative line; feature fence's opening ``` line is at startLine,
85
+ // content begins at startLine + 1.
86
+ const lineNo = baseLocation.line + (startLine - 1) + (li + 1);
87
+ let m;
88
+ GHERKIN_SECTION_RE.lastIndex = 0;
89
+ while ((m = GHERKIN_SECTION_RE.exec(line)) !== null) {
90
+ out.push({
91
+ kind: "gherkin-section",
92
+ text: m[1],
93
+ location: {
94
+ file: baseLocation.file,
95
+ line: lineNo,
96
+ column: m.index + 1 + columnOffset,
97
+ },
98
+ });
99
+ }
100
+ GHERKIN_STEP_RE.lastIndex = 0;
101
+ while ((m = GHERKIN_STEP_RE.exec(line)) !== null) {
102
+ out.push({
103
+ kind: "gherkin-step",
104
+ text: m[1],
105
+ location: {
106
+ file: baseLocation.file,
107
+ line: lineNo,
108
+ column: m.index + 1 + columnOffset,
109
+ },
110
+ });
111
+ }
112
+ }
113
+ }
114
+ else if (block.kind === "list") {
115
+ for (const item of block.items) {
116
+ emitGherkin(item.blocks, out, baseLocation, columnOffset);
117
+ }
118
+ }
119
+ }
120
+ }
121
+ /**
122
+ * Walk the mdast for the body and emit one `inline-code` token per
123
+ * `inlineCode` node. Markdown line/column positions translate directly
124
+ * to body-relative line/column.
125
+ */
126
+ function emitInlineCode(tree, out, baseLocation, columnOffset) {
127
+ const visit = (node) => {
128
+ if (node.type === "inlineCode" && node.position &&
129
+ node.value !== undefined) {
130
+ out.push({
131
+ kind: "inline-code",
132
+ text: `\`${node.value}\``,
133
+ location: {
134
+ file: baseLocation.file,
135
+ line: baseLocation.line + node.position.start.line - 1,
136
+ column: node.position.start.column + columnOffset,
137
+ },
138
+ });
139
+ return;
140
+ }
141
+ if ("children" in node && Array.isArray(node.children)) {
142
+ for (const child of node.children)
143
+ visit(child);
144
+ }
145
+ };
146
+ visit(tree);
147
+ }
148
+ /**
149
+ * Extract body-token stream from an entry body.
150
+ *
151
+ * @param body - entry body string (post-`splitBodyAndAttributes`)
152
+ * @param bodyAst - canonical body AST for the same body (drives
153
+ * code/math/feature fence detection)
154
+ * @param baseLocation - `SourceLocation` of the body's first line; the
155
+ * `file` field is propagated to every emitted token
156
+ * @param columnOffset - Number of source characters stripped from the
157
+ * start of each body line before the body string was built. Added to
158
+ * every emitted column value so columns are relative to the containing
159
+ * buffer line, not the stripped body text. Defaults to 0. Source-file
160
+ * callers (via parseMarkdown's lineMap path) supply the list-item
161
+ * indent width so the LineMap receives buffer-relative columns.
162
+ * @returns tokens sorted by `(line, column)`. Empty when no constructs
163
+ * are recognised.
164
+ */
165
+ export function extractBodyTokens(body, bodyAst, baseLocation, columnOffset = 0, mdastTree) {
166
+ const tokens = [];
167
+ const verbatimLines = collectVerbatimLines(bodyAst);
168
+ const lines = body.split("\n");
169
+ for (let li = 0; li < lines.length; li++) {
170
+ const line = lines[li];
171
+ const lineNo = baseLocation.line + li;
172
+ if (verbatimLines.has(li + 1))
173
+ continue;
174
+ MODAL_RE.lastIndex = 0;
175
+ let m;
176
+ while ((m = MODAL_RE.exec(line)) !== null) {
177
+ const text = m[1];
178
+ tokens.push({
179
+ kind: "modal",
180
+ text,
181
+ case: text === text.toLowerCase() ? "lower" : "upper",
182
+ location: {
183
+ file: baseLocation.file,
184
+ line: lineNo,
185
+ column: m.index + 1 + columnOffset,
186
+ },
187
+ });
188
+ }
189
+ EARS_RE.lastIndex = 0;
190
+ while ((m = EARS_RE.exec(line)) !== null) {
191
+ const text = m[1];
192
+ tokens.push({
193
+ kind: "ears-trigger",
194
+ text,
195
+ trigger: text,
196
+ location: {
197
+ file: baseLocation.file,
198
+ line: lineNo,
199
+ column: m.index + 1 + columnOffset,
200
+ },
201
+ });
202
+ }
203
+ ENTITY_REF_RE.lastIndex = 0;
204
+ while ((m = ENTITY_REF_RE.exec(line)) !== null) {
205
+ // Skip second half of `$$…$$` math fence
206
+ if (m.index > 0 && line[m.index - 1] === "$")
207
+ continue;
208
+ // Skip escaped `\$`
209
+ if (m.index > 0 && line[m.index - 1] === "\\")
210
+ continue;
211
+ const ident = m[0]; // includes leading `$`
212
+ const bare = m[1];
213
+ tokens.push({
214
+ kind: "entity-ref",
215
+ text: ident,
216
+ convention: classifyConvention(bare),
217
+ location: {
218
+ file: baseLocation.file,
219
+ line: lineNo,
220
+ column: m.index + 1 + columnOffset,
221
+ },
222
+ });
223
+ }
224
+ }
225
+ emitGherkin(bodyAst, tokens, baseLocation, columnOffset);
226
+ const tree = mdastTree ?? processor.parse(body);
227
+ emitInlineCode(tree, tokens, baseLocation, columnOffset);
228
+ tokens.sort((a, b) => a.location.line !== b.location.line
229
+ ? a.location.line - b.location.line
230
+ : a.location.column - b.location.column);
231
+ return tokens;
232
+ }
@@ -7,6 +7,7 @@
7
7
  * blocks. This module walks the mdast AST to validate the four structural
8
8
  * rules (R4-a through R4-e) and emits MSL-L020–L024 diagnostics.
9
9
  */
10
+ import type { Heading } from "@types/mdast";
10
11
  import type { Diagnostic } from "../model/mod.js";
11
12
  /** Options for {@linkcode validateGlossaryStructure}. */
12
13
  export interface GlossaryValidationOptions {
@@ -25,6 +26,13 @@ export interface GlossaryValidationResult {
25
26
  * drop chars outside [a-z0-9._/-]
26
27
  */
27
28
  export declare function deriveTermSlug(text: string): string;
29
+ /**
30
+ * Extract the plain-text content from a heading node by walking its
31
+ * inline children and concatenating `text` and `inlineCode` node values.
32
+ * Exported so the lint pipeline (`core/lint/glossary.ts`) can reuse the
33
+ * same convention without duplicating the walk.
34
+ */
35
+ export declare function extractHeadingText(node: Heading): string;
28
36
  /**
29
37
  * Walk a glossary document's mdast AST and validate the H1/H2/H3
30
38
  * heading-shape grammar (spec §4.2).
@@ -1 +1 @@
1
- {"version":3,"file":"glossary.d.ts","sourceRoot":"","sources":["../../src/parser/glossary.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,iBAAiB,CAAC;AAGlE,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+CAA+C;AAC/C,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnD;AAkBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,yBAAyB,GAClC,wBAAwB,CAoN1B"}
1
+ {"version":3,"file":"glossary.d.ts","sourceRoot":"","sources":["../../src/parser/glossary.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,iBAAiB,CAAC;AAGlE,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+CAA+C;AAC/C,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAUxD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,yBAAyB,GAClC,wBAAwB,CAoN1B"}
@@ -22,9 +22,11 @@ export function deriveTermSlug(text) {
22
22
  }
23
23
  /**
24
24
  * Extract the plain-text content from a heading node by walking its
25
- * inline children and concatenating Text node values.
25
+ * inline children and concatenating `text` and `inlineCode` node values.
26
+ * Exported so the lint pipeline (`core/lint/glossary.ts`) can reuse the
27
+ * same convention without duplicating the walk.
26
28
  */
27
- function headingText(node) {
29
+ export function extractHeadingText(node) {
28
30
  let text = "";
29
31
  for (const child of node.children) {
30
32
  if (child.type === "text") {
@@ -60,7 +62,7 @@ export function validateGlossaryStructure(markdown, options) {
60
62
  const h = node;
61
63
  nodes.push({
62
64
  depth: h.depth,
63
- text: headingText(h),
65
+ text: extractHeadingText(h),
64
66
  line: h.position?.start.line ?? 1,
65
67
  column: h.position?.start.column ?? 1,
66
68
  });
@@ -105,7 +107,7 @@ export function validateGlossaryStructure(markdown, options) {
105
107
  events.push({
106
108
  kind: "heading",
107
109
  depth: h.depth,
108
- text: headingText(h),
110
+ text: extractHeadingText(h),
109
111
  line: h.position?.start.line ?? 1,
110
112
  col: h.position?.start.column ?? 1,
111
113
  });
@@ -4,7 +4,7 @@
4
4
  * Lazy-loading tree-sitter grammar resolver. Maps file extensions to
5
5
  * grammar WASM files and caches loaded languages for reuse.
6
6
  */
7
- import Parser from "web-tree-sitter";
7
+ import { Language } from "web-tree-sitter";
8
8
  /** Check whether a file extension has a supported grammar. */
9
9
  export declare function isSupportedExtension(ext: string): boolean;
10
10
  /**
@@ -12,11 +12,13 @@ export declare function isSupportedExtension(ext: string): boolean;
12
12
  *
13
13
  * Initializes the Parser WASM runtime on first call. Grammar languages
14
14
  * are cached — repeated calls with the same extension return the
15
- * same `Parser.Language` instance. Concurrent-safe: stores the loading
15
+ * same `Language` instance. Concurrent-safe: stores the loading
16
16
  * promise so parallel calls await the same load.
17
17
  *
18
18
  * @param ext - File extension including the dot (e.g., `.rs`, `.java`)
19
19
  * @throws If the extension is unsupported or the WASM file cannot be loaded
20
20
  */
21
- export declare function loadGrammar(ext: string): Promise<Parser.Language>;
21
+ export declare function loadGrammar(ext: string): Promise<Language>;
22
+ export { languageIdForExtension } from "./language_spec.js";
23
+ export type { SupportedLanguage } from "./language_spec.js";
22
24
  //# sourceMappingURL=grammars.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grammars.d.ts","sourceRoot":"","sources":["../../src/parser/grammars.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AA+BrC,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAYjE"}
1
+ {"version":3,"file":"grammars.d.ts","sourceRoot":"","sources":["../../src/parser/grammars.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAsCnD,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAY1D;AAmBD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Lazy-loading tree-sitter grammar resolver. Maps file extensions to
5
5
  * grammar WASM files and caches loaded languages for reuse.
6
6
  */
7
- import Parser from "web-tree-sitter";
7
+ import { Language, Parser } from "web-tree-sitter";
8
8
  import { join } from "@std/path";
9
9
  /** Map file extensions to grammar WASM file names. */
10
10
  const EXT_TO_GRAMMAR = {
@@ -19,6 +19,13 @@ const EXT_TO_GRAMMAR = {
19
19
  ".cxx": "tree-sitter-cpp",
20
20
  ".hpp": "tree-sitter-cpp",
21
21
  ".hxx": "tree-sitter-cpp",
22
+ ".ts": "tree-sitter-typescript",
23
+ ".tsx": "tree-sitter-tsx",
24
+ ".jsx": "tree-sitter-tsx",
25
+ ".js": "tree-sitter-javascript",
26
+ ".mjs": "tree-sitter-javascript",
27
+ ".cjs": "tree-sitter-javascript",
28
+ ".cs": "tree-sitter-c-sharp",
22
29
  };
23
30
  /** Directory containing grammar WASM files. */
24
31
  const GRAMMARS_DIR = join(globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).dirname, "..", "..", "..", "..", "grammars");
@@ -33,7 +40,7 @@ export function isSupportedExtension(ext) {
33
40
  *
34
41
  * Initializes the Parser WASM runtime on first call. Grammar languages
35
42
  * are cached — repeated calls with the same extension return the
36
- * same `Parser.Language` instance. Concurrent-safe: stores the loading
43
+ * same `Language` instance. Concurrent-safe: stores the loading
37
44
  * promise so parallel calls await the same load.
38
45
  *
39
46
  * @param ext - File extension including the dot (e.g., `.rs`, `.java`)
@@ -62,9 +69,10 @@ async function doLoad(grammarName) {
62
69
  const binPath = join(GRAMMARS_DIR, `${grammarName}.wasm.bin`);
63
70
  try {
64
71
  await Deno.stat(binPath);
65
- return Parser.Language.load(binPath);
72
+ return Language.load(binPath);
66
73
  }
67
74
  catch {
68
- return Parser.Language.load(join(GRAMMARS_DIR, `${grammarName}.wasm`));
75
+ return Language.load(join(GRAMMARS_DIR, `${grammarName}.wasm`));
69
76
  }
70
77
  }
78
+ export { languageIdForExtension } from "./language_spec.js";
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @module parser/language_spec
3
+ *
4
+ * Per-grammar doc-comment dispatch table. Each tree-sitter grammar names
5
+ * its comment nodes differently (Rust splits `line_comment`/`block_comment`;
6
+ * Kotlin uses `multiline_comment` for block; C/C++ collapses all comments
7
+ * to a single `comment` node), so the walker reads node-type names plus
8
+ * text predicates from this table rather than hard-coding them.
9
+ *
10
+ * Adding a new language is a single row here plus an extension entry in
11
+ * {@linkcode languageIdForExtension}.
12
+ */
13
+ import type { Node as SyntaxNode } from "web-tree-sitter";
14
+ import type { SupportedLanguage } from "../model/mod.js";
15
+ export type { SupportedLanguage };
16
+ export interface LanguageDocCommentSpec {
17
+ /** Tree-sitter node type(s) for block (multi-line) comments. */
18
+ readonly blockCommentTypes: readonly string[];
19
+ /** Tree-sitter node type(s) for line (single-line) comments. */
20
+ readonly lineCommentTypes: readonly string[];
21
+ /** Predicate: this block-comment node text starts a doc block. */
22
+ isDocBlock(text: string): boolean;
23
+ /** Predicate: this line-comment node text is a doc-line comment. */
24
+ isDocLine(text: string): boolean;
25
+ /** Tree-sitter node types that an enclosing "item" (function, class,
26
+ * struct, impl, mod, etc.) might be. Walker searches the doc comment's
27
+ * next sibling for one of these. */
28
+ readonly enclosingItemTypes: readonly string[];
29
+ /** Tree-sitter node types to skip during the enclosing-item walk
30
+ * (attributes, annotations, comments). */
31
+ readonly attributeSkipTypes: readonly string[];
32
+ /** Extract a name from an enclosing-item node. Each grammar uses a
33
+ * different convention. Returns undefined for anonymous items or
34
+ * extraction failures (operator overloads, destructors, etc.). */
35
+ itemName(node: SyntaxNode): string | undefined;
36
+ }
37
+ /** Set of every enclosing-item node type across TypeScript, TSX, and JS.
38
+ * Used by {@linkcode jsLikeItemName} when unwrapping `export_statement`
39
+ * and `expression_statement` to recognise the real item among the
40
+ * wrapper's children. Probe-verified against tree-sitter-typescript@0.23.2
41
+ * and tree-sitter-javascript@0.23.1.
42
+ *
43
+ * Exported for the drift-guard test in `language_spec_test.ts` — every
44
+ * non-wrapper member of `typescriptSpec.enclosingItemTypes` and
45
+ * `javascriptSpec.enclosingItemTypes` must appear here. */
46
+ export declare const JS_LIKE_ENCLOSING_TYPES: Set<string>;
47
+ /**
48
+ * Closed-form table indexed by {@linkcode SupportedLanguage}. The walker in
49
+ * `parser/source.ts` consults this map to know which AST node types to
50
+ * inspect and how to discriminate doc comments from regular ones.
51
+ */
52
+ export declare const LANGUAGE_SPECS: Record<SupportedLanguage, LanguageDocCommentSpec>;
53
+ /** Map a file extension (including the dot) to its language id. */
54
+ export declare function languageIdForExtension(ext: string): SupportedLanguage | undefined;
55
+ //# sourceMappingURL=language_spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language_spec.d.ts","sourceRoot":"","sources":["../../src/parser/language_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,MAAM,WAAW,sBAAsB;IACrC,gEAAgE;IAChE,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,gEAAgE;IAChE,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,kEAAkE;IAClE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,oEAAoE;IACpE,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC;;wCAEoC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C;8CAC0C;IAC1C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C;;sEAEkE;IAClE,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;CAChD;AAqGD;;;;;;;;2DAQ2D;AAC3D,eAAO,MAAM,uBAAuB,aAYlC,CAAC;AA0IH;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAgI1E,CAAC;AAEJ,mEAAmE;AACnE,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,GACV,iBAAiB,GAAG,SAAS,CAgC/B"}