From 21da2d1d219c8ae47837be19d430ef5f469f66b1 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Sun, 5 Mar 2023 12:18:39 +0100 Subject: [PATCH] add - as an idCont char --- lib/Quox/CharExtra.idr | 2 +- tests/Tests/Lexer.idr | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Quox/CharExtra.idr b/lib/Quox/CharExtra.idr index b9a3572..8e7af2f 100644 --- a/lib/Quox/CharExtra.idr +++ b/lib/Quox/CharExtra.idr @@ -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 diff --git a/tests/Tests/Lexer.idr b/tests/Tests/Lexer.idr index 4eaa00a..537e2af 100644 --- a/tests/Tests/Lexer.idr +++ b/tests/Tests/Lexer.idr @@ -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 "λ"],