Sfoglia il codice sorgente

Show @:persistent in --help-metas and completion

Jens Fischer 6 anni fa
parent
commit
a239c56561
2 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 7 0
      src-json/meta.json
  2. 1 1
      src/macro/eval/evalPrototype.ml

+ 7 - 0
src-json/meta.json

@@ -785,6 +785,13 @@
 		"params": ["Function specification (no expression)"],
 		"targets": ["TClassField"]
 	},
+	{
+		"name": "Persistent",
+		"metadata": ":persistent",
+		"doc": "Keeps the value of static variables in macro context across compilations",
+		"targets": ["TAnyField"],
+		"platforms": ["eval"]
+	},
 	{
 		"name": "PhpGlobal",
 		"metadata": ":phpGlobal",

+ 1 - 1
src/macro/eval/evalPrototype.ml

@@ -173,7 +173,7 @@ let is_removable_field cf =
 	has_class_field_flag cf CfExtern || Meta.has Meta.Generic cf.cf_meta
 
 let is_persistent cf =
-	Meta.has (Meta.Custom ":persistent") cf.cf_meta
+	Meta.has Meta.Persistent cf.cf_meta
 
 let create_static_prototype ctx mt =
 	let path = (t_infos mt).mt_path in