From 1d206518cf289df5e281f23b28f9419267e441c5 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 12 Sep 2026 03:48:30 +0700 Subject: [PATCH] Colour the primitive type names too, since only the capitalised ones showed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rule was "capitalised is a type", which leaves i32 and string looking like ordinary names in the one position — a signature — where the reader is there to see the types. --- web/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index 2ecbe34..df57f6a 100644 --- a/web/index.html +++ b/web/index.html @@ -1237,6 +1237,8 @@ macro is a function from Form to Form, which needs "declare declare-c import package let if when unless cond do and or not while " + "until dotimes match set return some try defer signal error handler-bind " + "restart-case invoke-restart fn quote defmacro gensym").split(" ")); + // Capitalised names are types; these are the ones that are not capitalised. + var TYPES = new Set(("i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 bool string").split(" ")); var TOKEN = /(;[^\n]*)|("(?:\\.|[^"\\])*")|(\\[A-Za-z0-9]+)|(:[A-Za-z][\w?!*<>=+-]*)|(\b0[xX][0-9a-fA-F]+\b|\b\d[\d.]*\b)|([A-Za-z][\w*?!<>=./+-]*)/g; function esc(s) { return s.replace(/&/g, "&").replace(//g, ">"); @@ -1253,7 +1255,8 @@ macro is a function from Form to Form, which needs if (num) return '' + m + ""; if (word) { if (FORMS.has(word)) return '' + m + ""; - if (/^[A-Z]/.test(word)) return '' + m + ""; + if (TYPES.has(word) || /^[A-Z]/.test(word)) + return '' + m + ""; } return m; });