Skip to content

Commit

Permalink
Define a parser for line comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
robrix committed Oct 20, 2020
1 parent e5b1d18 commit be6626c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Facet/Lexer.hs
Expand Up @@ -3,8 +3,10 @@ module Facet.Lexer
, TokenKind(..)
) where

import Control.Applicative (Alternative(..))
import Facet.Name
import Facet.Span
import Text.Parser.Char

-- Lexer

Expand All @@ -25,3 +27,9 @@ data TokenKind
| MIdent MName
| EIdent EName
| TIdent TName


kind_ :: CharParsing p => p TokenKind
kind_ = comment
where
comment = Comment <$ char '#' <*> many (satisfy (/= '\n'))

0 comments on commit be6626c

Please sign in to comment.