checkpoint

This commit is contained in:
2023-05-20 17:10:58 -07:00
parent ec3cf04db4
commit 6850725d3b
2 changed files with 15 additions and 3 deletions

View File

@@ -1,9 +1,21 @@
-- comment with double hyphen, takes precedence over operators
module Ex module Ex
-- comment -- imports not implemented yet
import Foo
-- inductive data type declaration (not supported in language yet)
data Bool : Type where data Bool : Type where
True : Bool True : Bool
False : Bool False : Bool
-- claim
id : a -> a id : a -> a
id = \ a => a -- declaration
id = \ a => a * a + 2 * (3 + x)
-- this is complicated with patterns because we need to group stuff together.
-- I really should make a simple grammar
-- I want to put this on ice, there is so much to do before patterns..
blah : Either a a -> a
blah = \ x => let x = 1 in x * x

View File

@@ -189,7 +189,7 @@ parseDecl = parseImport <|> parseSig <|> parseDef <|> parseData
export export
parseMod : Parser Module parseMod : Parser Module
parseMod = do parseMod = do
keyword "module" sameLevel $ keyword "module"
name <- ident name <- ident
-- probably should be manySame, and we want to start with col -1 -- probably should be manySame, and we want to start with col -1
-- if we enforce blocks indent more than parent -- if we enforce blocks indent more than parent