2
0
Rudy Ges 5 сар өмнө
parent
commit
9a0cc60e63

+ 1 - 1
src/filters/filters.ml

@@ -710,7 +710,7 @@ let run tctx main before_destruction =
 	] in
 	] in
 	List.iter (run_expression_filters tctx detail_times filters) new_types;
 	List.iter (run_expression_filters tctx detail_times filters) new_types;
 	let filters = [
 	let filters = [
-		"local_statics",LocalStatic.run tctx;
+		(* "local_statics",LocalStatic.run tctx; *)
 		"fix_return_dynamic_from_void_function",fix_return_dynamic_from_void_function true;
 		"fix_return_dynamic_from_void_function",fix_return_dynamic_from_void_function true;
 		"check_local_vars_init",check_local_vars_init tctx;
 		"check_local_vars_init",check_local_vars_init tctx;
 		"check_abstract_as_value",check_abstract_as_value;
 		"check_abstract_as_value",check_abstract_as_value;

+ 1 - 0
src/macro/macroApi.ml

@@ -938,6 +938,7 @@ and decode_expr v =
 				let name = ((decode_string (field v "name")), name_pos)
 				let name = ((decode_string (field v "name")), name_pos)
 				and t = opt decode_ctype (field v "type")
 				and t = opt decode_ctype (field v "type")
 				and eo = opt loop (field v "expr") in
 				and eo = opt loop (field v "expr") in
+				if static then raise (Error.Error (Error.make_error (Custom ("Unexpected local static " ^ (fst name))) (snd name)));
 				mk_evar ~final ~static ?t ?eo ~meta name
 				mk_evar ~final ~static ?t ?eo ~meta name
 			) (decode_array vl))
 			) (decode_array vl))
 		| 11, [kind;f] ->
 		| 11, [kind;f] ->

+ 3 - 2
src/syntax/grammar.mly

@@ -1169,8 +1169,9 @@ and parse_block_elt = parser
 	| [< '(Kwd Static,p); s >] ->
 	| [< '(Kwd Static,p); s >] ->
 		begin match s with parser
 		begin match s with parser
 		| [< (vl,p) = parse_block_var >] ->
 		| [< (vl,p) = parse_block_var >] ->
-			let vl = List.map (fun ev -> {ev with ev_static = true}) vl in
-			(EVars vl,p)
+			(* let vl = List.map (fun ev -> {ev with ev_static = true}) vl in *)
+			(* (EVars vl,p) *)
+			syntax_error (Expected ["var";"final"]) s (mk_null_expr p)
 		| [<>] -> syntax_error (Expected ["var";"final"]) s (mk_null_expr p)
 		| [<>] -> syntax_error (Expected ["var";"final"]) s (mk_null_expr p)
 		end
 		end
 	| [< '(Binop OpLt,p1); s >] ->
 	| [< '(Binop OpLt,p1); s >] ->