Skip to content

Commit

Permalink
Merge pull request #9 from JohanWiltink/main
Browse files Browse the repository at this point in the history
Add support for identifiers ending in `?`
  • Loading branch information
Kacarott authored Feb 9, 2024
2 parents e67e162 + 3ade405 commit 8eba8ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1>
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)
</textarea>
Expand Down
4 changes: 2 additions & 2 deletions lambdacalc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8eba8ee

Please sign in to comment.