diff --git a/lib/Quox/Parser/Parser.idr b/lib/Quox/Parser/Parser.idr index b066f7e..5072bdc 100644 --- a/lib/Quox/Parser/Parser.idr +++ b/lib/Quox/Parser/Parser.idr @@ -326,6 +326,9 @@ defIntro : Grammar True Qty defIntro = symbols [(Zero, "def0"), (Any, "defω")] <|> resC "def" *> option Any (qty <* resC ".") +skipSemis : Grammar False () +skipSemis = ignore $ many $ resC ";" + export covering definition : Grammar True PDefinition definition = @@ -339,7 +342,8 @@ mutual export covering namespace_ : Grammar True PNamespace namespace_ = - [|MkPNamespace (resC "namespace" *> mods) (braces $ many decl)|] + [|MkPNamespace (resC "namespace" *> mods) + (braces $ many $ decl <* skipSemis)|] export covering decl : Grammar True PDecl @@ -354,7 +358,6 @@ topLevel = [|PLoad load|] export covering input : Grammar False (List PTopLevel) input = skipSemis *> many (topLevel <* skipSemis) - where skipSemis = ignore $ many $ resC ";" public export