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
isIdCont : Char -> Bool
isIdCont ch =
isIdStart ch || ch == '\'' || isMark ch || isNumber ch
isIdStart ch || ch == '\'' || ch == '-' || isMark ch || isNumber ch
export
isIdConnector : Char -> Bool

View File

@ -55,6 +55,8 @@ tests = "lexer" :- [
"identifiers & keywords" :- [
lexes "abc" [I "abc"],
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 "λ" [R "λ"],
lexes "fun" [R "λ"],