From e51b7170a9eb4ae406da609f3a4d4c1ebf4c3fb8bc6ba77278782f41006992ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Bj=C3=B6rnstam?= Date: Fri, 2 Oct 2026 14:39:31 +0200 Subject: [PATCH] The Bjolang grammar is a resource, so bjo publish copies it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module reads grammars/bjolang from beside its src/, found from its own DLL. Declared with (resources "grammars"), bjo publish copies it to the same place relative to the module, and a published program highlights Bjolang. Version 0.1.1. 🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5) Co-Authored-By: eca-agent --- manifest.bjodat | 6 +++++- src/core.bjo | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/manifest.bjodat b/manifest.bjodat index c876856..856fcda 100644 --- a/manifest.bjodat +++ b/manifest.bjodat @@ -1,6 +1,6 @@ (package (name (textmate-bjolang)) - (version "0.1.0") + (version "0.1.1") (description "Syntax highlighting for Bjolang: VS Code's TextMate grammars and themes, through TextMateSharp, as (text xml) nodes.") (license "MPL-2.0") @@ -12,5 +12,9 @@ (packages (nuget (id "TextMateSharp.Grammars") (version "[2.0.4,2.1)"))) + ;; Bjolang's own grammar, read at run time from beside src/. Declared so + ;; that bjo publish copies it along with the module. + (resources "grammars") + ;; A library: there is no src/main.bjo. ) diff --git a/src/core.bjo b/src/core.bjo index 6887491..c347633 100644 --- a/src/core.bjo +++ b/src/core.bjo @@ -36,8 +36,10 @@ ;; - TextMateSharp takes a theme's own rules before the ones it includes, ;; however specific: Light+ colours `this` as a variable, where VS Code ;; gives it the included theme's blue. Both styles here follow TextMateSharp. -;; - The Bjolang grammar is found beside the DLL. A program copied somewhere -;; without grammars/ — what a bjo publish would do — has no bjolang. +;; - The Bjolang grammar is found beside the DLL. The manifest declares +;; grammars/ as a resource, so bjo publish copies it to the same place +;; relative to the module; a program copied by hand without it has no +;; bjolang. ;; - A highlighter tokenizes one line at a time, under a lock: TextMateSharp ;; compiles a grammar's rules as it meets them and says nothing about ;; threads. Parallel work wants a highlighter per thread.