From b9a161d474b538006881a80bb406f7386b10ffac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=AA=E3=82=AD=E8=90=8C?= Date: Mon, 1 Sep 2025 17:17:54 +0200 Subject: [PATCH] make it possible to use the characters ' and ? anywhere in identifiers closes #129 --- crates/haku/src/lexer.rs | 2 +- static/brush-box.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/haku/src/lexer.rs b/crates/haku/src/lexer.rs index 64683a9..d577937 100644 --- a/crates/haku/src/lexer.rs +++ b/crates/haku/src/lexer.rs @@ -57,7 +57,7 @@ fn one_or_two(l: &mut Lexer<'_>, kind1: TokenKind, c2: char, kind2: TokenKind) - } fn is_ident_char(c: char) -> bool { - matches!(c, 'a'..='z' | 'A'..='Z' | '0'..='9' | '_') + matches!(c, 'a'..='z' | 'A'..='Z' | '0'..='9' | '_' | '\'' | '?') } fn ident(l: &mut Lexer<'_>) -> TokenKind { diff --git a/static/brush-box.js b/static/brush-box.js index 92d01d7..2ff5fed 100644 --- a/static/brush-box.js +++ b/static/brush-box.js @@ -45,8 +45,8 @@ or_: \\a, b -> else b withDotter \\d -> - visible = mod (d Num) length < length * duty - if (visible) + visible? = mod (d Num) length < length * duty + if (visible?) stroke thickness color (line (d From) (d To)) else ()