Skip to content

Commit

Permalink
added completion expressions in macros
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Sep 16, 2010
1 parent 1d319d0 commit 5e8395d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 10 additions & 4 deletions interp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2109,10 +2109,12 @@ let encode_expr e =
23, [loop e]
| ECast (e,t) ->
24, [loop e; null encode_type t]
| EDisplay (e,flag) ->
25, [loop e; VBool flag]
| EDisplayNew t ->
26, [encode_path t]
| ETernary (econd,e1,e2) ->
25, [loop econd;loop e1;loop e2]
| EDisplay _ | EDisplayNew _ ->
assert false
27, [loop econd;loop e1;loop e2]
in
enc_obj [
"pos", encode_pos p;
Expand Down Expand Up @@ -2327,7 +2329,11 @@ let decode_expr v =
EThrow (loop e)
| 24, [e;t] ->
ECast (loop e,opt decode_type t)
| 25, [e1;e2;e3] ->
| 25, [e;f] ->
EDisplay (loop e,dec_bool f)
| 26, [t] ->
EDisplayNew (decode_path t)
| 27, [e1;e2;e3] ->
ETernary (loop e1,loop e2,loop e3)
| _ ->
raise Invalid_expr
Expand Down
2 changes: 2 additions & 0 deletions std/haxe/macro/Expr.hx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ enum ExprDef {
EUntyped( e : Expr );
EThrow( e : Expr );
ECast( e : Expr, t : Null<TypePath> );
EDisplay( e : Expr, isCall : Bool );
EDisplayNew( t : TypePath );
ETernary( econd : Expr, eif : Expr, eelse : Expr );
}

Expand Down

0 comments on commit 5e8395d

Please sign in to comment.