From 1d33d368f05dfc65deb2c87c4565d51c2cc8d103 Mon Sep 17 00:00:00 2001 From: JohanWiltink Date: Sun, 4 Feb 2024 03:56:00 +0100 Subject: [PATCH 1/2] Update index.html rename `eq` to `eq?`, to test trailing `?` --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 3b8e469..40b85af 100644 --- a/index.html +++ b/index.html @@ -116,7 +116,7 @@

chunk = \ a b xs . row-s a (colS b xs) append = \ as bs . null as bs (cons (head as) (append (tail as) bs)) concat = foldr append nil -eq = \ a b . is-z a (is-z b) (is-z b false (eq (pred a) (pred b))) +eq? = \ a b . is-z a (is-z b) (is-z b false (eq? (pred a) (pred b))) all = foldr (\ a b . a b false) true allf = \ f xs . all (map f xs) From 3ade405707a572a200678542ae56bfe3d46d1278 Mon Sep 17 00:00:00 2001 From: JohanWiltink Date: Sun, 4 Feb 2024 04:00:38 +0100 Subject: [PATCH 2/2] Update lambdacalc.js add optional `?` at end of identifier names --- lambdacalc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lambdacalc.js b/lambdacalc.js index c7a39ac..47c00fe 100644 --- a/lambdacalc.js +++ b/lambdacalc.js @@ -17,10 +17,10 @@ CodeMirror.defineMode("lambdacalc", function(_config, modeConfig) { const SUPPRESS = "text"; const FAIL = "error"; - const defName = /[a-zA-Z][a-zA-Z0-9_\-']*/ + const defName = /[a-zA-Z][-'\w]*\??/ const assign = /=/ const brack = /\(|\)/ - const lamArg = /[a-zA-Z_][a-zA-Z0-9_\-']*|\./ + const lamArg = /[_a-zA-Z][-'\w]*\??|\./ const numconst = /-?\d+/ function expectDefOrTerm(stream, state) {