Skip to content

Commit 8eba8ee

Browse files
authored
Merge pull request #9 from JohanWiltink/main
Add support for identifiers ending in `?`
2 parents e67e162 + 3ade405 commit 8eba8ee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ <h1>
116116
chunk = \ a b xs . row-s a (colS b xs)
117117
append = \ as bs . null as bs (cons (head as) (append (tail as) bs))
118118
concat = foldr append nil
119-
eq = \ a b . is-z a (is-z b) (is-z b false (eq (pred a) (pred b)))
119+
eq? = \ a b . is-z a (is-z b) (is-z b false (eq? (pred a) (pred b)))
120120
all = foldr (\ a b . a b false) true
121121
allf = \ f xs . all (map f xs)
122122
</textarea>

lambdacalc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ CodeMirror.defineMode("lambdacalc", function(_config, modeConfig) {
1717
const SUPPRESS = "text";
1818
const FAIL = "error";
1919

20-
const defName = /[a-zA-Z][a-zA-Z0-9_\-']*/
20+
const defName = /[a-zA-Z][-'\w]*\??/
2121
const assign = /=/
2222
const brack = /\(|\)/
23-
const lamArg = /[a-zA-Z_][a-zA-Z0-9_\-']*|\./
23+
const lamArg = /[_a-zA-Z][-'\w]*\??|\./
2424
const numconst = /-?\d+/
2525

2626
function expectDefOrTerm(stream, state) {

0 commit comments

Comments
 (0)