X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fast.ml;h=a8a5248721d5f80cb712f1b971842d1a64867b5b;hb=c07380a3a4dca44a29df4cb09265d10442c1d06f;hp=922827c9cc2a9ed27dc842b22c48e9acd483aec0;hpb=a48b05d35f0646322e8178ff10f8ed7af3e739aa;p=goals.git diff --git a/src/ast.ml b/src/ast.ml index 922827c..a8a5248 100644 --- a/src/ast.ml +++ b/src/ast.ml @@ -54,11 +54,12 @@ and expr = and constant = | CString of string and goal = param_decl list * pattern list * expr list * code option -and func = param_decl list * code +and func = param_decl list * returning * code and tactic = param_decl list * code and param_decl = id and id = string and code = substs +and returning = RetExpr | RetStrings | RetString and substs = subst list and subst = | SString of string @@ -163,9 +164,12 @@ and string_goal () (name, (param_decls, patterns, exprs, code)) = (String.concat ", " (List.map (string_expr ()) exprs)) (match code with None -> "" | Some code -> " = { ... }") -and string_func () (name, (param_decls, code)) = - sprintf "function%s (%s) = { ... }" +and string_func () (name, (param_decls, returning, code)) = + sprintf "function%s returning %s (%s) = { ... }" (match name with None -> "" | Some name -> " " ^ name) + (match returning with RetExpr -> "expression" + | RetString -> "string" + | RetStrings -> "strings") (String.concat ", " (List.map (string_param_decl ()) param_decls)) and string_tactic () (name, (param_decls, code)) =