X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=src%2Fparse.dcl;h=281c80451da52735801366035ebc4938985f3d9a;hb=f5231ebadae1ac54e25dbf5819debb3ab625826d;hp=62a0461c89c42021bedd72288bbdf7bb16bdd887;hpb=6e527e30012f8809594452cb9559b301b4a8afc6;p=cc1516.git diff --git a/src/parse.dcl b/src/parse.dcl index 62a0461..281c804 100644 --- a/src/parse.dcl +++ b/src/parse.dcl @@ -2,10 +2,11 @@ definition module parse from Data.Either import :: Either from Data.Maybe import :: Maybe +from StdString import class toString import lex -:: ParserOutput :== Either String AST +:: ParserOutput :== Either Error AST :: AST = AST [VarDecl] [FunDecl] :: VarDecl = VarDecl Type String Expr @@ -32,7 +33,7 @@ import lex :: Op1 = UnNegation | UnMinus :: Op2 = BiPlus | BiMinus | BiTimes | BiDivide | BiMod | BiEquals | BiLesser | BiGreater | BiLesserEq | BiGreaterEq | BiUnEqual | BiAnd | BiOr | BiCons -:: FunDecl = FunDecl String [String] FunType [VarDecl] [Stmt] +:: FunDecl = FunDecl String [String] (Maybe FunType) [VarDecl] [Stmt] :: FunType = FunType [Type] (Maybe Type) :: FunCall = FunCall String [Expr] :: Stmt