summaryrefslogtreecommitdiff
path: root/src/pretty.ml
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2013-11-16 11:59:42 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2013-11-16 11:59:42 +0100
commitec7d5bcc03e4bad22b6cc790aa69cb310ec452e4 (patch)
tree915d0a738cb3bbd0e81a98b00eab03415678a152 /src/pretty.ml
parentdeb235f3045138908339cec56f0ce34dbb4e936b (diff)
downloadLPC-Projet-ec7d5bcc03e4bad22b6cc790aa69cb310ec452e4.tar.gz
LPC-Projet-ec7d5bcc03e4bad22b6cc790aa69cb310ec452e4.zip
Functionning parser with no conflicts! No support for classes and OOP yet.
Diffstat (limited to 'src/pretty.ml')
-rw-r--r--src/pretty.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pretty.ml b/src/pretty.ml
index dd36422..8553c81 100644
--- a/src/pretty.ml
+++ b/src/pretty.ml
@@ -80,7 +80,7 @@ let rec expr_string = function
| ENull -> "NULL"
| EIdent(i) -> i
| EAssign(k, p) -> "(" ^ (expr_string k) ^ " = " ^ (expr_string p) ^ ")"
- | ECall(e, f) -> (expr_string e) ^ (List.fold_left (fun x k -> x ^ ", " ^ (expr_string k)) "" f) ^ ")"
+ | ECall(e, f) -> (expr_string e) ^ "(" ^ (List.fold_left (fun x k -> x ^ ", " ^ (expr_string k)) "" f) ^ ")"
| EUnary(e, f) -> (unop_str e) ^ (expr_string f)
| EBinary(e1, o, e2) -> "(" ^ (expr_string e1) ^ " " ^ (binop_str o) ^ " " ^ (expr_string e2) ^ ")"
@@ -91,7 +91,7 @@ let rec print_stmt l x =
| SExpr(e) -> print_string ((expr_string e) ^ "\n")
| SIf(e, a, b) -> print_string ("if " ^ (expr_string e) ^ "\n");
print_stmt (l+1) a;
- for i = 0 to l do print_string " " done;
+ for i = 1 to l do print_string " " done;
print_string "else\n";
print_stmt (l+1) b
| SWhile(e, a) -> print_string ("while " ^ (expr_string e) ^ "\n");