Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion haskell-lexeme.el
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ of a token."
((or (equal char ?_)
(member category '(Ll Lo)))
'varid)
((and (>= char ?0) (<= char 9))
((and (>= char ?0) (<= char ?9))
'number)
((member char '(?\] ?\[ ?\( ?\) ?\{ ?\} ?\` ?\, ?\;))
'special))))
Expand Down
10 changes: 10 additions & 0 deletions tests/haskell-lexeme-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ order."
(goto-char (match-end 0)))
(should (equal nil left-lexemes)))))

(ert-deftest haskell-lexeme-classify-chars-1 ()
(should (equal 'varsym (haskell-lexeme-classify-by-first-char ?=)))
(should (equal 'conid (haskell-lexeme-classify-by-first-char ?L)))
(should (equal 'consym (haskell-lexeme-classify-by-first-char ?:)))
(should (equal 'varid (haskell-lexeme-classify-by-first-char ?_)))
(should (equal 'varid (haskell-lexeme-classify-by-first-char ?x)))
(should (equal 'char (haskell-lexeme-classify-by-first-char ?')))
(should (equal 'string (haskell-lexeme-classify-by-first-char ?\")))
(should (equal 'special (haskell-lexeme-classify-by-first-char ?\;)))
(should (equal 'number (haskell-lexeme-classify-by-first-char ?4))))

(ert-deftest haskell-lexeme-basic-tokens-1 ()
"Get some basic self delimiting tokens right"
Expand Down