Selaa lähdekoodia

allow positions in make_expr to become PosInfos (supports $(Context.currentPos())

Simon Krajewski 13 vuotta sitten
vanhempi
commit
09da254f4d
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 7 0
      interp.ml

+ 7 - 0
interp.ml

@@ -2062,6 +2062,13 @@ let macro_lib =
 					| VBool b -> (Ast.EConst (Ast.Ident (if b then "true" else "false")),p)
 					| VInt i -> (Ast.EConst (Ast.Int (string_of_int i)),p)
 					| VFloat f -> (Ast.EConst (Ast.Float (string_of_float f)),p)
+					| VAbstract (APos p) ->
+						(Ast.EObjectDecl (
+							("fileName" , (Ast.EConst (Ast.String p.Ast.pfile) , p)) ::
+							("lineNumber" , (Ast.EConst (Ast.Int (string_of_int (Lexer.get_error_line p))),p)) ::
+							("className" , (Ast.EConst (Ast.String ("")),p)) ::
+							[]
+						), p)
 					| VString _ | VArray _ | VAbstract _ | VFunction _ | VClosure _ as v -> error v
 					| VObject o as v ->
 						match o.oproto with