Skip to content

Commit

Permalink
add syntax for inline examples
Browse files Browse the repository at this point in the history
  • Loading branch information
marklemay committed Apr 8, 2024
1 parent 4751b13 commit a9ba280
Show file tree
Hide file tree
Showing 3 changed files with 327 additions and 320 deletions.
3 changes: 3 additions & 0 deletions src/Env.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ type DefCtx = Map RefName (Term, Ty)

type Module = (Map TCName DataDef, DefCtx)

-- we can have some internal stuff in a module that should not be exposed (examples for instnace)
type OpenModule = (Module, [Term])

-- TODO clean up the notion of module, undermodule

-- | rempaps all the unbound vars that match dataconstructors and typeconstructors
Expand Down
4 changes: 2 additions & 2 deletions src/Ffi/Ffi.hs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ loadString s =

case parseModule webPath s of
Left ls -> parseError ls
Right m@(ddefs,trmdefs) ->
Right (m@(ddefs,trmdefs), examples) ->
-- loggg $ lfullshow m
let em = runExcept $ runFreshMT $ C.elabmodule (empTyEnv{dataCtx=ddefs,defCtx=trmdefs}) sr in

Expand All @@ -151,7 +151,7 @@ loadString s =



parseModule :: Path -> String -> Either ParseError Module
parseModule :: Path -> String -> Either ParseError Env.OpenModule
parseModule path s = prettyParse path s $ token modulep


Expand Down
Loading

0 comments on commit a9ba280

Please sign in to comment.