fix comment parsing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
module Ex
|
module Ex
|
||||||
|
-- comment
|
||||||
data Bool : Type where
|
data Bool : Type where
|
||||||
True : Bool
|
True : Bool
|
||||||
False : Bool
|
False : Bool
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ rawTokens : Tokenizer (Token Kind)
|
|||||||
rawTokens
|
rawTokens
|
||||||
= match (alpha <+> many identMore) checkKW
|
= match (alpha <+> many identMore) checkKW
|
||||||
<|> match (some digit) (Tok Number)
|
<|> match (some digit) (Tok Number)
|
||||||
<|> match (some opChar) (\s => Tok Oper s)
|
|
||||||
<|> match (lineComment (exact "--")) (Tok Space)
|
<|> match (lineComment (exact "--")) (Tok Space)
|
||||||
|
<|> match (some opChar) (\s => Tok Oper s)
|
||||||
<|> match symbol (Tok Symbol)
|
<|> match symbol (Tok Symbol)
|
||||||
<|> match spaces (Tok Space)
|
<|> match spaces (Tok Space)
|
||||||
|
|
||||||
|
|||||||
@@ -71,4 +71,4 @@ main = do
|
|||||||
Right files <- listDir "eg"
|
Right files <- listDir "eg"
|
||||||
| Left err => printLn err
|
| Left err => printLn err
|
||||||
traverse_ testFile (filter (".newt" `isSuffixOf`) files)
|
traverse_ testFile (filter (".newt" `isSuffixOf`) files)
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public export
|
|||||||
data Literal = LString String | LInt Int | LBool Bool
|
data Literal = LString String | LInt Int | LBool Bool
|
||||||
public export
|
public export
|
||||||
data RigCount = Rig0 | RigW
|
data RigCount = Rig0 | RigW
|
||||||
|
-- I think I got Eq from pi-forall, it uses it for equality args (which are kinda like Prop/Rig0?)
|
||||||
public export
|
public export
|
||||||
data Plicity = Implicit | Explicit | Eq
|
data Plicity = Implicit | Explicit | Eq
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ data CaseAlt = MkAlt Pattern Raw
|
|||||||
|
|
||||||
public export
|
public export
|
||||||
data Raw
|
data Raw
|
||||||
= RVar Name
|
= RVar Name
|
||||||
| RLam Pattern Raw
|
| RLam Pattern Raw
|
||||||
| RApp Raw Raw
|
| RApp Raw Raw
|
||||||
| RU
|
| RU
|
||||||
|
|||||||
Reference in New Issue
Block a user