From eeb113389acc0f3464b6c57aff180a684c0db56d9cdbaac1d9ddece71da30a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Bj=C3=B6rnstam?= Date: Sat, 3 Oct 2026 14:48:03 +0200 Subject: [PATCH] (std set) is (std hashset), and the grammar knows the new forms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- grammars/bjolang/syntaxes/bjolang.tmLanguage.json | 2 +- manifest.bjodat | 2 +- src/core.bjo | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/grammars/bjolang/syntaxes/bjolang.tmLanguage.json b/grammars/bjolang/syntaxes/bjolang.tmLanguage.json index e413851..267ace4 100644 --- a/grammars/bjolang/syntaxes/bjolang.tmLanguage.json +++ b/grammars/bjolang/syntaxes/bjolang.tmLanguage.json @@ -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" diff --git a/manifest.bjodat b/manifest.bjodat index 856fcda..4573821 100644 --- a/manifest.bjodat +++ b/manifest.bjodat @@ -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") diff --git a/src/core.bjo b/src/core.bjo index c347633..bea8ee0 100644 --- a/src/core.bjo +++ b/src/core.bjo @@ -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 "." "-")))