Require trailing semicolon for type declarations
This commit is contained in:
@ -51,7 +51,6 @@ declaration :: SymbolTable -> AST.Declaration -> NameAnalysis SymbolTable
|
||||
declaration globalTable (AST.TypeDefinition identifier typeExpression)
|
||||
= flip (SymbolTable.enter identifier) globalTable . TypeInfo
|
||||
<$> withSymbolTable globalTable (dataType typeExpression)
|
||||
|
||||
declaration globalTable (AST.ProcedureDefinition identifier _parameters _variables _body) =
|
||||
let localTable = SymbolTable.empty
|
||||
in pure $ SymbolTable.enter identifier (ProcedureInfo localTable mempty) globalTable
|
||||
|
@ -88,6 +88,7 @@ typeDefinitionP :: Parser Declaration
|
||||
typeDefinitionP = TypeDefinition
|
||||
<$> (symbol "type" *> identifierP)
|
||||
<*> (symbol "=" *> typeExpressionP)
|
||||
<* semicolonP
|
||||
<?> "type definition"
|
||||
|
||||
variableDeclarationP :: Parser VariableDeclaration
|
||||
|
Reference in New Issue
Block a user