(std set) is (std hashset), and the grammar knows the new forms
The prelude's set is HashSet now, with hashset-* functions. The grammar highlights please-hoist-i-promise-i-am-not-naughty and the path macros get, try-get, set and update as the other special forms are. 🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-4-5) Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
parent
e51b7170a9
commit
eeb113389a
3 changed files with 6 additions and 6 deletions
|
|
@ -311,7 +311,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"match": "(?<=\\()(spawn/detached|parameterize\\*|with-deadline|with-response|parameterize|syntax-match|syntax-quote|spawn/daemon|with-return|with-cancel|with-shield|record-set!|struct-set!|task->event|record-ref|record-set|struct-ref|struct-set|yield-from|bjoroutine|with-open|spawn-evt|let/mono|when-let|with-run|time-it|unless|letrec|if-let|some->|match|begin|yield|spawn|when|case|else|let\\*|loop|seql|set!|cast|cond|let|seq|try|fun|and|not|bjo|if|do|or)(?![^\\s()\\[\\]{},:\"';])",
|
||||
"match": "(?<=\\()(please-hoist-i-promise-i-am-not-naughty|spawn/detached|parameterize\\*|with-deadline|with-response|parameterize|syntax-match|syntax-quote|spawn/daemon|with-return|with-cancel|with-shield|record-set!|struct-set!|task->event|record-ref|record-set|struct-ref|struct-set|yield-from|bjoroutine|with-open|spawn-evt|let/mono|when-let|with-run|time-it|try-get|unless|letrec|if-let|some->|update|match|begin|yield|spawn|when|case|else|let\\*|loop|seql|set!|cast|cond|let|seq|try|get|set|fun|and|not|bjo|if|do|or)(?![^\\s()\\[\\]{},:\"';])",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.bjolang"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
(package
|
||||
(name (textmate-bjolang))
|
||||
(version "0.1.1")
|
||||
(version "0.1.2")
|
||||
(description "Syntax highlighting for Bjolang: VS Code's TextMate grammars and themes, through TextMateSharp, as (text xml) nodes.")
|
||||
(license "MPL-2.0")
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
highlight->nodes highlight->node code->node)
|
||||
|
||||
(import (std prelude))
|
||||
(import (only (std set) list->set set-contains?))
|
||||
(import (only (std hashset) list->hashset hashset-contains?))
|
||||
(import (text xml))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
|
@ -553,8 +553,8 @@
|
|||
"entity.name.variable" "entity.other.inherited-class" "entity.other.attribute-name"
|
||||
"punctuation.section.embedded"))
|
||||
|
||||
(: class-vocabulary (Set string))
|
||||
(def class-vocabulary (list->set class-scopes))
|
||||
(: class-vocabulary (HashSet string))
|
||||
(def class-vocabulary (list->hashset class-scopes))
|
||||
|
||||
;; The class scope a grammar scope comes under: the longest one it begins
|
||||
;; with, a whole segment at a time. None for a scope that says nothing about
|
||||
|
|
@ -569,7 +569,7 @@
|
|||
(loop (:for k (range 1 (+ (min 3 (vec-length segments)) 1)))
|
||||
(:acc found (folding None
|
||||
(let ((prefix (string-join (vec-slice segments 0 k) ".")))
|
||||
(if (set-contains? class-vocabulary prefix) (Some prefix) found))))))))
|
||||
(if (hashset-contains? class-vocabulary prefix) (Some prefix) found))))))))
|
||||
|
||||
(: class-name (-> string string))
|
||||
(defun (class-name scope) (str "tm-" (string-replace scope "." "-")))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue