add - as an idCont char

This commit is contained in:
rhiannon morris 2023-03-05 12:18:39 +01:00
parent f6bc8cad1f
commit 21da2d1d21
2 changed files with 3 additions and 1 deletions

View file

@ -129,7 +129,7 @@ isIdStart ch =
export export
isIdCont : Char -> Bool isIdCont : Char -> Bool
isIdCont ch = isIdCont ch =
isIdStart ch || ch == '\'' || isMark ch || isNumber ch isIdStart ch || ch == '\'' || ch == '-' || isMark ch || isNumber ch
export export
isIdConnector : Char -> Bool isIdConnector : Char -> Bool

View file

@ -55,6 +55,8 @@ tests = "lexer" :- [
"identifiers & keywords" :- [ "identifiers & keywords" :- [
lexes "abc" [I "abc"], lexes "abc" [I "abc"],
lexes "abc def" [I "abc", I "def"], lexes "abc def" [I "abc", I "def"],
lexes "abc_def" [I "abc_def"],
lexes "abc-def" [I "abc-def"],
lexes "abc{-comment-}def" [I "abc", I "def"], lexes "abc{-comment-}def" [I "abc", I "def"],
lexes "λ" [R "λ"], lexes "λ" [R "λ"],
lexes "fun" [R "λ"], lexes "fun" [R "λ"],