(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
|
|
@ -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