Commit 13adac8
committed
gen-tm(vue): full block-language coverage — exotic langs + custom blocks (PR #6085)
Monogram's Vue grammar only embedded ts/tsx/jsx (script), scss/less/stylus/
postcss (style), pug (template) — far short of the hand-written grammar, which
embeds via a generic `<anytag lang="X">` catch-all. Add the rest:
- named blocks: <script lang="coffee">→source.coffee, <style lang="sass">
→source.sass (added to their lang maps; emitRaw handles them robustly).
- NEW customBlockEmbed map (markup config) for the data/custom-block langs on
ANY tag: md→text.html.markdown, json→source.json, jsonc→source.json.comments,
json5→source.json5, yaml→source.yaml, toml→source.toml, gql/graphql→
source.graphql. So `<i18n lang="yaml">`, `<docs lang="md">`, `<gql lang=
"graphql">` all embed correctly — Vue SFC custom blocks Monogram had no
mechanism for.
gen-tm emits one begin/end per custom lang: the tag NAME is captured and the
close is its backreference (`</\2>`), so it's tag-agnostic; a `lang=<x>`
lookahead gates it; start-tag attrs re-tokenize via #attribute; body embeds the
mapped grammar. Emitted before the named rawText blocks. Vue-only (driven by
vue.ts data); the 5 non-Vue grammars stay byte-identical. agnostic 8/8, tsc
clean, vue-issues + vue-dropin 19/19, gen deterministic.1 parent a7cf6bd commit 13adac8
4 files changed
Lines changed: 615 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3247 | 3247 | | |
3248 | 3248 | | |
3249 | 3249 | | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
3250 | 3269 | | |
3251 | 3270 | | |
3252 | 3271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| |||
0 commit comments