TmTheme and TmStyleMode are grammars
Bjolang 0.2.0 refuses #:tag on a union case: a grammar reads a quoted literal now. The two unions are grammars of bare keywords, so #:theme 'dark-plus and #:style 'classes read as before, and the types and their cases keep their names. 🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-4-7) Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
parent
3f0cb62a21
commit
2096724cd4
1 changed files with 25 additions and 23 deletions
48
src/core.bjo
48
src/core.bjo
|
|
@ -156,31 +156,33 @@
|
|||
;; ---------------------------------------------------------------------------
|
||||
|
||||
;; VS Code's themes, the ones TextMateSharp carries: #:theme 'dark-plus.
|
||||
(type (: TmTheme (Union (: ThemeDarkPlus #:tag dark-plus)
|
||||
(: ThemeLightPlus #:tag light-plus)
|
||||
(: ThemeDark #:tag dark)
|
||||
(: ThemeLight #:tag light)
|
||||
(: ThemeMonokai #:tag monokai)
|
||||
(: ThemeDimmedMonokai #:tag dimmed-monokai)
|
||||
(: ThemeOneDark #:tag one-dark)
|
||||
(: ThemeAtomOneDark #:tag atom-one-dark)
|
||||
(: ThemeAtomOneLight #:tag atom-one-light)
|
||||
(: ThemeDracula #:tag dracula)
|
||||
(: ThemeSolarizedDark #:tag solarized-dark)
|
||||
(: ThemeSolarizedLight #:tag solarized-light)
|
||||
(: ThemeQuietLight #:tag quiet-light)
|
||||
(: ThemeKimbieDark #:tag kimbie-dark)
|
||||
(: ThemeTomorrowNightBlue #:tag tomorrow-night-blue)
|
||||
(: ThemeAbyss #:tag abyss)
|
||||
(: ThemeRed #:tag red)
|
||||
(: ThemeHighContrastDark #:tag high-contrast-dark)
|
||||
(: ThemeHighContrastLight #:tag high-contrast-light)
|
||||
(: ThemeVisualStudioDark #:tag visual-studio-dark)
|
||||
(: ThemeVisualStudioLight #:tag visual-studio-light))))
|
||||
(def/grammar TmTheme
|
||||
(:or (: ThemeDarkPlus 'dark-plus)
|
||||
(: ThemeLightPlus 'light-plus)
|
||||
(: ThemeDark 'dark)
|
||||
(: ThemeLight 'light)
|
||||
(: ThemeMonokai 'monokai)
|
||||
(: ThemeDimmedMonokai 'dimmed-monokai)
|
||||
(: ThemeOneDark 'one-dark)
|
||||
(: ThemeAtomOneDark 'atom-one-dark)
|
||||
(: ThemeAtomOneLight 'atom-one-light)
|
||||
(: ThemeDracula 'dracula)
|
||||
(: ThemeSolarizedDark 'solarized-dark)
|
||||
(: ThemeSolarizedLight 'solarized-light)
|
||||
(: ThemeQuietLight 'quiet-light)
|
||||
(: ThemeKimbieDark 'kimbie-dark)
|
||||
(: ThemeTomorrowNightBlue 'tomorrow-night-blue)
|
||||
(: ThemeAbyss 'abyss)
|
||||
(: ThemeRed 'red)
|
||||
(: ThemeHighContrastDark 'high-contrast-dark)
|
||||
(: ThemeHighContrastLight 'high-contrast-light)
|
||||
(: ThemeVisualStudioDark 'visual-studio-dark)
|
||||
(: ThemeVisualStudioLight 'visual-studio-light)))
|
||||
|
||||
;; How a node is coloured: #:style 'inline or #:style 'classes.
|
||||
(type (: TmStyleMode (Union (: StyleInline #:tag inline)
|
||||
(: StyleClasses #:tag classes))))
|
||||
(def/grammar TmStyleMode
|
||||
(:or (: StyleInline 'inline)
|
||||
(: StyleClasses 'classes)))
|
||||
|
||||
;; How a piece of text looks. None is the theme's own colour, which the pre
|
||||
;; around the code already has.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue