Browse Source

generator fixes for TMeta

Simon Krajewski 12 years ago
parent
commit
58927a427f
3 changed files with 9 additions and 6 deletions
  1. 3 2
      genas3.ml
  2. 3 2
      genjs.ml
  3. 3 2
      genphp.ml

+ 3 - 2
genas3.ml

@@ -593,7 +593,7 @@ and gen_expr ctx e =
 		gen_value ctx e;
 		spr ctx ")";
 	| TMeta (_,e) ->
-		gen_value ctx e
+		gen_expr ctx e
 	| TReturn eo ->
 		if ctx.in_value <> None then unsupported e.epos;
 		(match eo with
@@ -823,7 +823,6 @@ and gen_value ctx e =
 	| TEnumParameter _
 	| TTypeExpr _
 	| TParenthesis _
-	| TMeta _
 	| TObjectDecl _
 	| TArrayDecl _
 	| TCall _
@@ -831,6 +830,8 @@ and gen_value ctx e =
 	| TUnop _
 	| TFunction _ ->
 		gen_expr ctx e
+	| TMeta (_,e1) ->
+		gen_value ctx e1
 	| TCast (e1,None) ->
 		let s = type_str ctx e.etype e1.epos in
 		if s = "*" then

+ 3 - 2
genjs.ml

@@ -463,7 +463,7 @@ and gen_expr ctx e =
 		gen_value ctx e;
 		spr ctx ")";
 	| TMeta (_,e) ->
-		gen_value ctx e
+		gen_expr ctx e
 	| TReturn eo ->
 		if ctx.in_value <> None then unsupported e.epos;
 		(match eo with
@@ -741,13 +741,14 @@ and gen_value ctx e =
 	| TEnumParameter _
 	| TTypeExpr _
 	| TParenthesis _
-	| TMeta _
 	| TObjectDecl _
 	| TArrayDecl _
 	| TNew _
 	| TUnop _
 	| TFunction _ ->
 		gen_expr ctx e
+	| TMeta (_,e1) ->
+		gen_value ctx e1
 	| TCall (e,el) ->
 		gen_call ctx e el true
 	| TReturn _

+ 3 - 2
genphp.ml

@@ -1244,7 +1244,7 @@ and gen_expr ctx e =
 			spr ctx ")"
 		);
 	| TMeta (_,e) ->
-		gen_value ctx e
+		gen_expr ctx e
 	| TReturn eo ->
 		(match eo with
 		| None ->
@@ -1725,7 +1725,6 @@ and gen_value ctx e =
 	| TEnumParameter _
 	| TField _
 	| TParenthesis _
-	| TMeta _
 	| TObjectDecl _
 	| TArrayDecl _
 	| TCall _
@@ -1733,6 +1732,8 @@ and gen_value ctx e =
 	| TNew _
 	| TFunction _ ->
 		gen_expr ctx e
+	| TMeta (_,e1) ->
+		gen_value ctx e1
 	| TBlock [] ->
 		()
 	| TCast (e, _)