character lits, initial work on literal case trees

This commit is contained in:
2024-10-21 22:46:26 -07:00
parent 33ec03f2da
commit 9148852eb5
12 changed files with 209 additions and 62 deletions

View File

@@ -1,7 +1,7 @@
module Lib.Parser
import Lib.Types
import Debug.Trace
import Data.String
-- app: foo {a} a b
-- lam: λ {A} {b : A} (c : Blah) d e f => something
@@ -50,8 +50,14 @@ intLit = do
pure $ RLit fc (LInt (cast t))
charLit : Parser Raw
charLit = do
fc <- getPos
v <- token Character
pure $ RLit fc (LChar $ assert_total $ strIndex v 1)
lit : Parser Raw
lit = intLit <|> stringLit
lit = intLit <|> stringLit <|> charLit
-- typeExpr is term with arrows.
export typeExpr : Parser Raw