Browse Source

`enum abstract` syntax (#6982)

* [parser] support `enum abstract` syntax

closes #4282

* deprecate `@:enum abstract`

* fix test
Simon Krajewski 7 years ago
parent
commit
0edc98e4c3
100 changed files with 152 additions and 146 deletions
  1. 4 0
      extra/CHANGES.txt
  2. 30 20
      src/syntax/grammar.mly
  3. 1 0
      src/typing/typeloadFields.ml
  4. 1 1
      std/Xml.hx
  5. 1 1
      std/cpp/NativeXml.hx
  6. 2 2
      std/haxe/macro/CompilationServer.hx
  7. 2 2
      std/haxe/macro/Compiler.hx
  8. 1 1
      std/hl/Format.hx
  9. 1 1
      std/hl/Type.hx
  10. 1 1
      std/hl/UI.hx
  11. 1 1
      std/hl/uv/Loop.hx
  12. 1 1
      std/js/html/AlignSetting.hx
  13. 1 1
      std/js/html/AnimationPlayState.hx
  14. 1 1
      std/js/html/AudioChannel.hx
  15. 1 1
      std/js/html/AudioContextState.hx
  16. 1 1
      std/js/html/BinaryType.hx
  17. 1 1
      std/js/html/CanvasWindingRule.hx
  18. 1 1
      std/js/html/CompositeOperation.hx
  19. 1 1
      std/js/html/DOMRequestReadyState.hx
  20. 1 1
      std/js/html/DirectionSetting.hx
  21. 1 1
      std/js/html/FileMode.hx
  22. 1 1
      std/js/html/FillMode.hx
  23. 1 1
      std/js/html/FontFaceLoadStatus.hx
  24. 1 1
      std/js/html/FontFaceSetLoadStatus.hx
  25. 1 1
      std/js/html/FrameType.hx
  26. 1 1
      std/js/html/GamepadMappingType.hx
  27. 1 1
      std/js/html/IterationCompositeOperation.hx
  28. 1 1
      std/js/html/MediaSourceEndOfStreamError.hx
  29. 1 1
      std/js/html/MediaSourceReadyState.hx
  30. 1 1
      std/js/html/NotificationDirection.hx
  31. 1 1
      std/js/html/NotificationPermission.hx
  32. 1 1
      std/js/html/OrientationLockType.hx
  33. 1 1
      std/js/html/OrientationType.hx
  34. 1 1
      std/js/html/PermissionState.hx
  35. 1 1
      std/js/html/PlaybackDirection.hx
  36. 1 1
      std/js/html/RecordingState.hx
  37. 1 1
      std/js/html/ReferrerPolicy.hx
  38. 1 1
      std/js/html/RequestCache.hx
  39. 1 1
      std/js/html/RequestCredentials.hx
  40. 1 1
      std/js/html/RequestMode.hx
  41. 1 1
      std/js/html/RequestRedirect.hx
  42. 1 1
      std/js/html/ResponseType.hx
  43. 1 1
      std/js/html/ScrollRestoration.hx
  44. 1 1
      std/js/html/SelectionMode.hx
  45. 1 1
      std/js/html/ServiceWorkerState.hx
  46. 1 1
      std/js/html/SourceBufferAppendMode.hx
  47. 1 1
      std/js/html/SpeechRecognitionErrorCode.hx
  48. 1 1
      std/js/html/SpeechSynthesisErrorCode.hx
  49. 1 1
      std/js/html/SupportedType.hx
  50. 1 1
      std/js/html/TextTrackKind.hx
  51. 1 1
      std/js/html/TextTrackMode.hx
  52. 1 1
      std/js/html/VisibilityState.hx
  53. 1 1
      std/js/html/XMLHttpRequestResponseType.hx
  54. 1 1
      std/js/html/audio/BiquadFilterType.hx
  55. 1 1
      std/js/html/audio/ChannelCountMode.hx
  56. 1 1
      std/js/html/audio/ChannelInterpretation.hx
  57. 1 1
      std/js/html/audio/DistanceModelType.hx
  58. 1 1
      std/js/html/audio/OscillatorType.hx
  59. 1 1
      std/js/html/audio/OverSampleType.hx
  60. 1 1
      std/js/html/audio/PanningModelType.hx
  61. 1 1
      std/js/html/idb/CursorDirection.hx
  62. 1 1
      std/js/html/idb/RequestReadyState.hx
  63. 1 1
      std/js/html/idb/TransactionMode.hx
  64. 1 1
      std/js/html/rtc/DataChannelState.hx
  65. 1 1
      std/js/html/rtc/DataChannelType.hx
  66. 1 1
      std/js/html/rtc/IceConnectionState.hx
  67. 1 1
      std/js/html/rtc/IceGatheringState.hx
  68. 1 1
      std/js/html/rtc/SdpType.hx
  69. 1 1
      std/js/html/rtc/SignalingState.hx
  70. 1 1
      std/lua/Coroutine.hx
  71. 15 15
      std/lua/Io.hx
  72. 1 1
      std/lua/LocaleCategory.hx
  73. 1 1
      std/lua/Lua.hx
  74. 1 1
      std/lua/lib/luasocket/socket/ReceivePattern.hx
  75. 1 1
      std/lua/lib/luasocket/socket/ShutdownMode.hx
  76. 1 1
      std/lua/lib/luasocket/socket/TcpOption.hx
  77. 1 1
      std/lua/lib/luasocket/socket/TimeoutMode.hx
  78. 1 1
      std/lua/lib/luv/fs/Open.hx
  79. 1 1
      std/neko/NativeXml.hx
  80. 1 1
      std/python/lib/io/IOBase.hx
  81. 1 1
      std/sys/ssl/DigestAlgorithm.hx
  82. 1 2
      tests/display/src/ModuleSymbolEntry.hx
  83. 1 1
      tests/display/src/cases/Issue5166.hx
  84. 1 1
      tests/misc/projects/Issue2997/Main.hx
  85. 1 1
      tests/misc/projects/Issue2997/compile1.hxml
  86. 1 1
      tests/misc/projects/Issue3621/Main1.hx
  87. 1 1
      tests/misc/projects/Issue4904/Main.hx
  88. 1 1
      tests/misc/projects/Issue4907/Main.hx
  89. 1 1
      tests/misc/projects/Issue5833/Main.hx
  90. 1 1
      tests/optimization/src/Test.hx
  91. 1 2
      tests/optimization/src/TestLocalDce.hx
  92. 1 1
      tests/runci/TestTarget.hx
  93. 2 2
      tests/unit/src/unit/MyAbstract.hx
  94. 1 1
      tests/unit/src/unit/issues/Issue2633.hx
  95. 3 6
      tests/unit/src/unit/issues/Issue2786.hx
  96. 1 2
      tests/unit/src/unit/issues/Issue2939.hx
  97. 2 4
      tests/unit/src/unit/issues/Issue3063.hx
  98. 1 1
      tests/unit/src/unit/issues/Issue3181.hx
  99. 1 1
      tests/unit/src/unit/issues/Issue3649.hx
  100. 1 2
      tests/unit/src/unit/issues/Issue3665.hx

+ 4 - 0
extra/CHANGES.txt

@@ -1,5 +1,9 @@
 XXXX-XX-XX: 4.0.0-preview.4
 
+	New features:
+
+	all : allow `enum abstract` syntax instead of `@:enum abstract` (#4282)
+
 	General improvements and optimizations:
 
 	all : implemented `for` loop unrolling (#3784)

+ 30 - 20
src/syntax/grammar.mly

@@ -106,21 +106,39 @@ and parse_type_decls pack acc s =
 		) acc;
 		raise (TypePath (pack,Some(name,true),b))
 
+and parse_abstract doc meta flags = parser
+	| [< '(Kwd Abstract,p1); name = type_name; tl = parse_constraint_params; st = parse_abstract_subtype; sl = plist parse_abstract_relations; '(BrOpen,_); fl, p2 = parse_class_fields false p1 >] ->
+		let flags = List.map decl_flag_to_abstract_flag flags in
+		let flags = (match st with None -> flags | Some t -> AbOver t :: flags) in
+		({
+			d_name = name;
+			d_doc = doc;
+			d_meta = meta;
+			d_params = tl;
+			d_flags = flags @ sl;
+			d_data = fl;
+		},punion p1 p2)
+
 and parse_type_decl s =
 	match s with parser
 	| [< '(Kwd Import,p1) >] -> parse_import s p1
 	| [< '(Kwd Using,p1) >] -> parse_using s p1
 	| [< doc = get_doc; meta = parse_meta; c = parse_common_flags; s >] ->
 		match s with parser
-		| [< n , p1 = parse_enum_flags; name = type_name; tl = parse_constraint_params; '(BrOpen,_); l = plist parse_enum; '(BrClose,p2) >] ->
-			(EEnum {
-				d_name = name;
-				d_doc = doc;
-				d_meta = meta;
-				d_params = tl;
-				d_flags = List.map decl_flag_to_enum_flag c @ n;
-				d_data = l
-			}, punion p1 p2)
+		| [< '(Kwd Enum,p1) >] ->
+			begin match s with parser
+			| [< a,p = parse_abstract doc ((Meta.Enum,[],null_pos) :: meta) c >] ->
+				(EAbstract a,p)
+			| [< name = type_name; tl = parse_constraint_params; '(BrOpen,_); l = plist parse_enum; '(BrClose,p2) >] ->
+				(EEnum {
+					d_name = name;
+					d_doc = doc;
+					d_meta = meta;
+					d_params = tl;
+					d_flags = List.map decl_flag_to_enum_flag c;
+					d_data = l
+				}, punion p1 p2)
+			end
 		| [< n , p1 = parse_class_flags; name = type_name; tl = parse_constraint_params; hl = plist parse_class_herit; '(BrOpen,_); fl, p2 = parse_class_fields false p1 >] ->
 			(EClass {
 				d_name = name;
@@ -142,17 +160,9 @@ and parse_type_decl s =
 				d_flags = List.map decl_flag_to_enum_flag c;
 				d_data = t;
 			}, punion p1 (pos t))
-		| [< '(Kwd Abstract,p1); name = type_name; tl = parse_constraint_params; st = parse_abstract_subtype; sl = plist parse_abstract_relations; '(BrOpen,_); fl, p2 = parse_class_fields false p1 >] ->
-			let flags = List.map decl_flag_to_abstract_flag c in
-			let flags = (match st with None -> flags | Some t -> AbOver t :: flags) in
-			(EAbstract {
-				d_name = name;
-				d_doc = doc;
-				d_meta = meta;
-				d_params = tl;
-				d_flags = flags @ sl;
-				d_data = fl;
-			},punion p1 p2)
+		| [< a,p = parse_abstract doc meta c >] ->
+			EAbstract a,p
+
 
 and parse_class doc meta cflags need_name s =
 	let opt_name = if need_name then type_name else (fun s -> match popt type_name s with None -> "",null_pos | Some n -> n) in

+ 1 - 0
src/typing/typeloadFields.ml

@@ -324,6 +324,7 @@ let build_module_def ctx mt meta fvars context_init fbuild =
 		| Meta.Enum,_,p -> f_build,Some (fun () ->
 				begin match mt with
 					| TClassDecl ({cl_kind = KAbstractImpl a} as c) ->
+						if p <> null_pos then ctx.com.warning "`@:enum abstract` is deprecated in favor of `enum abstract`" p;
 						context_init();
 						let e = build_enum_abstract ctx c a (fvars()) p in
 						fbuild e;

+ 1 - 1
std/Xml.hx

@@ -25,7 +25,7 @@
 
 	@see https://haxe.org/manual/std-Xml.html
 **/
-@:enum abstract XmlType(Int) {
+enum abstract XmlType(Int) {
 	/**
 		Represents an XML element type.
 	**/

+ 1 - 1
std/cpp/NativeXml.hx

@@ -21,7 +21,7 @@
  */
 package cpp;
 
-@:enum abstract XmlType(Int) {
+enum abstract XmlType(Int) {
    /**
       Represents an XML element type.
    **/

+ 2 - 2
std/haxe/macro/CompilationServer.hx

@@ -2,7 +2,7 @@ package haxe.macro;
 
 import haxe.macro.Compiler;
 
-@:enum
+enum
 abstract ModuleCheckPolicy(Int) {
 	/**
 		Disables file modification checks, avoiding some filesystem operations.
@@ -28,7 +28,7 @@ abstract ModuleCheckPolicy(Int) {
 	var NoCheckShadowing = 3;
 }
 
-@:enum abstract ContextOptions(Int) {
+enum abstract ContextOptions(Int) {
 	/**
 		Affects only the normal context.
 	**/

+ 2 - 2
std/haxe/macro/Compiler.hx

@@ -191,7 +191,7 @@ class Compiler {
 				}else{
 					ignoreString.push(ignoreRule);
 				}
-			} 
+			}
 		}
 		var skip = if( ignore == null ) {
 			function(c) return false;
@@ -450,7 +450,7 @@ class Compiler {
 
 }
 
-@:enum abstract IncludePosition(String) from String to String {
+enum abstract IncludePosition(String) from String to String {
 	/**
 		Prepend the file content to the output file.
 	*/

+ 1 - 1
std/hl/Format.hx

@@ -21,7 +21,7 @@
  */
 package hl;
 
-@:enum abstract PixelFormat(Int) {
+enum abstract PixelFormat(Int) {
   var RGB = 0;
   var BGR = 1;
   var RGBX = 2;

+ 1 - 1
std/hl/Type.hx

@@ -21,7 +21,7 @@
  */
 package hl;
 
-@:enum
+enum
 abstract TypeKind(Int) {
 	public var HVoid = 0;
 	public var HUI8 = 1;

+ 1 - 1
std/hl/UI.hx

@@ -131,7 +131,7 @@ enum DialogFlags {
 	IsError;
 }
 
-@:enum abstract LoopResult(Int) {
+enum abstract LoopResult(Int) {
 	var NoMessage = 0;
 	var HandledMessage = 1;
 	var Quit = 2;

+ 1 - 1
std/hl/uv/Loop.hx

@@ -1,6 +1,6 @@
 package hl.uv;
 
-@:enum abstract LoopRunMode(Int) {
+enum abstract LoopRunMode(Int) {
 	var Default = 0;
 	var Once = 1;
 	var NoWait = 2;

+ 1 - 1
std/js/html/AlignSetting.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract AlignSetting(String)
+enum abstract AlignSetting(String)
 {
 	var START = "start";
 	var MIDDLE = "middle";

+ 1 - 1
std/js/html/AnimationPlayState.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract AnimationPlayState(String)
+enum abstract AnimationPlayState(String)
 {
 	var IDLE = "idle";
 	var PENDING = "pending";

+ 1 - 1
std/js/html/AudioChannel.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract AudioChannel(String)
+enum abstract AudioChannel(String)
 {
 	var NORMAL = "normal";
 	var CONTENT = "content";

+ 1 - 1
std/js/html/AudioContextState.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract AudioContextState(String)
+enum abstract AudioContextState(String)
 {
 	var SUSPENDED = "suspended";
 	var RUNNING = "running";

+ 1 - 1
std/js/html/BinaryType.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract BinaryType(String)
+enum abstract BinaryType(String)
 {
 	var BLOB = "blob";
 	var ARRAYBUFFER = "arraybuffer";

+ 1 - 1
std/js/html/CanvasWindingRule.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract CanvasWindingRule(String)
+enum abstract CanvasWindingRule(String)
 {
 	var NONZERO = "nonzero";
 	var EVENODD = "evenodd";

+ 1 - 1
std/js/html/CompositeOperation.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract CompositeOperation(String)
+enum abstract CompositeOperation(String)
 {
 	var REPLACE = "replace";
 	var ADD = "add";

+ 1 - 1
std/js/html/DOMRequestReadyState.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract DOMRequestReadyState(String)
+enum abstract DOMRequestReadyState(String)
 {
 	var PENDING = "pending";
 	var DONE = "done";

+ 1 - 1
std/js/html/DirectionSetting.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract DirectionSetting(String)
+enum abstract DirectionSetting(String)
 {
 	var NONE = "";
 	var RL = "rl";

+ 1 - 1
std/js/html/FileMode.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract FileMode(String)
+enum abstract FileMode(String)
 {
 	var READONLY = "readonly";
 	var READWRITE = "readwrite";

+ 1 - 1
std/js/html/FillMode.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract FillMode(String)
+enum abstract FillMode(String)
 {
 	var NONE = "none";
 	var FORWARDS = "forwards";

+ 1 - 1
std/js/html/FontFaceLoadStatus.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract FontFaceLoadStatus(String)
+enum abstract FontFaceLoadStatus(String)
 {
 	var UNLOADED = "unloaded";
 	var LOADING = "loading";

+ 1 - 1
std/js/html/FontFaceSetLoadStatus.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract FontFaceSetLoadStatus(String)
+enum abstract FontFaceSetLoadStatus(String)
 {
 	var LOADING = "loading";
 	var LOADED = "loaded";

+ 1 - 1
std/js/html/FrameType.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract FrameType(String)
+enum abstract FrameType(String)
 {
 	var AUXILIARY = "auxiliary";
 	var TOP_LEVEL = "top-level";

+ 1 - 1
std/js/html/GamepadMappingType.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract GamepadMappingType(String)
+enum abstract GamepadMappingType(String)
 {
 	var NONE = "";
 	var STANDARD = "standard";

+ 1 - 1
std/js/html/IterationCompositeOperation.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract IterationCompositeOperation(String)
+enum abstract IterationCompositeOperation(String)
 {
 	var REPLACE = "replace";
 	var ACCUMULATE = "accumulate";

+ 1 - 1
std/js/html/MediaSourceEndOfStreamError.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract MediaSourceEndOfStreamError(String)
+enum abstract MediaSourceEndOfStreamError(String)
 {
 	var NETWORK = "network";
 	var DECODE = "decode";

+ 1 - 1
std/js/html/MediaSourceReadyState.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract MediaSourceReadyState(String)
+enum abstract MediaSourceReadyState(String)
 {
 	var CLOSED = "closed";
 	var OPEN = "open";

+ 1 - 1
std/js/html/NotificationDirection.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract NotificationDirection(String)
+enum abstract NotificationDirection(String)
 {
 	var AUTO = "auto";
 	var LTR = "ltr";

+ 1 - 1
std/js/html/NotificationPermission.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract NotificationPermission(String)
+enum abstract NotificationPermission(String)
 {
 	var DEFAULT_ = "default";
 	var DENIED = "denied";

+ 1 - 1
std/js/html/OrientationLockType.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract OrientationLockType(String)
+enum abstract OrientationLockType(String)
 {
 	var ANY = "any";
 	var NATURAL = "natural";

+ 1 - 1
std/js/html/OrientationType.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract OrientationType(String)
+enum abstract OrientationType(String)
 {
 	var PORTRAIT_PRIMARY = "portrait-primary";
 	var PORTRAIT_SECONDARY = "portrait-secondary";

+ 1 - 1
std/js/html/PermissionState.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract PermissionState(String)
+enum abstract PermissionState(String)
 {
 	var GRANTED = "granted";
 	var DENIED = "denied";

+ 1 - 1
std/js/html/PlaybackDirection.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract PlaybackDirection(String)
+enum abstract PlaybackDirection(String)
 {
 	var NORMAL = "normal";
 	var REVERSE = "reverse";

+ 1 - 1
std/js/html/RecordingState.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract RecordingState(String)
+enum abstract RecordingState(String)
 {
 	var INACTIVE = "inactive";
 	var RECORDING = "recording";

+ 1 - 1
std/js/html/ReferrerPolicy.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract ReferrerPolicy(String)
+enum abstract ReferrerPolicy(String)
 {
 	var NONE = "";
 	var NO_REFERRER = "no-referrer";

+ 1 - 1
std/js/html/RequestCache.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract RequestCache(String)
+enum abstract RequestCache(String)
 {
 	var DEFAULT_ = "default";
 	var NO_STORE = "no-store";

+ 1 - 1
std/js/html/RequestCredentials.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract RequestCredentials(String)
+enum abstract RequestCredentials(String)
 {
 	var OMIT = "omit";
 	var SAME_ORIGIN = "same-origin";

+ 1 - 1
std/js/html/RequestMode.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract RequestMode(String)
+enum abstract RequestMode(String)
 {
 	var SAME_ORIGIN = "same-origin";
 	var NO_CORS = "no-cors";

+ 1 - 1
std/js/html/RequestRedirect.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract RequestRedirect(String)
+enum abstract RequestRedirect(String)
 {
 	var FOLLOW = "follow";
 	var ERROR = "error";

+ 1 - 1
std/js/html/ResponseType.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract ResponseType(String)
+enum abstract ResponseType(String)
 {
 	var BASIC = "basic";
 	var CORS = "cors";

+ 1 - 1
std/js/html/ScrollRestoration.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract ScrollRestoration(String)
+enum abstract ScrollRestoration(String)
 {
 	var AUTO = "auto";
 	var MANUAL = "manual";

+ 1 - 1
std/js/html/SelectionMode.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract SelectionMode(String)
+enum abstract SelectionMode(String)
 {
 	var SELECT = "select";
 	var START = "start";

+ 1 - 1
std/js/html/ServiceWorkerState.hx

@@ -31,7 +31,7 @@ package js.html;
 
 	@see <https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerState>
 **/
-@:enum abstract ServiceWorkerState(String)
+enum abstract ServiceWorkerState(String)
 {
 	var INSTALLING = "installing";
 	var INSTALLED = "installed";

+ 1 - 1
std/js/html/SourceBufferAppendMode.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract SourceBufferAppendMode(String)
+enum abstract SourceBufferAppendMode(String)
 {
 	var SEGMENTS = "segments";
 	var SEQUENCE = "sequence";

+ 1 - 1
std/js/html/SpeechRecognitionErrorCode.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract SpeechRecognitionErrorCode(String)
+enum abstract SpeechRecognitionErrorCode(String)
 {
 	var NO_SPEECH = "no-speech";
 	var ABORTED = "aborted";

+ 1 - 1
std/js/html/SpeechSynthesisErrorCode.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract SpeechSynthesisErrorCode(String)
+enum abstract SpeechSynthesisErrorCode(String)
 {
 	var CANCELED = "canceled";
 	var INTERRUPTED = "interrupted";

+ 1 - 1
std/js/html/SupportedType.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract SupportedType(String)
+enum abstract SupportedType(String)
 {
 	var TEXT_HTML = "text/html";
 	var TEXT_XML = "text/xml";

+ 1 - 1
std/js/html/TextTrackKind.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract TextTrackKind(String)
+enum abstract TextTrackKind(String)
 {
 	var SUBTITLES = "subtitles";
 	var CAPTIONS = "captions";

+ 1 - 1
std/js/html/TextTrackMode.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract TextTrackMode(String)
+enum abstract TextTrackMode(String)
 {
 	var DISABLED = "disabled";
 	var HIDDEN = "hidden";

+ 1 - 1
std/js/html/VisibilityState.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract VisibilityState(String)
+enum abstract VisibilityState(String)
 {
 	var HIDDEN = "hidden";
 	var VISIBLE = "visible";

+ 1 - 1
std/js/html/XMLHttpRequestResponseType.hx

@@ -24,7 +24,7 @@
 
 package js.html;
 
-@:enum abstract XMLHttpRequestResponseType(String)
+enum abstract XMLHttpRequestResponseType(String)
 {
 	var NONE = "";
 	var ARRAYBUFFER = "arraybuffer";

+ 1 - 1
std/js/html/audio/BiquadFilterType.hx

@@ -24,7 +24,7 @@
 
 package js.html.audio;
 
-@:enum abstract BiquadFilterType(String)
+enum abstract BiquadFilterType(String)
 {
 	var LOWPASS = "lowpass";
 	var HIGHPASS = "highpass";

+ 1 - 1
std/js/html/audio/ChannelCountMode.hx

@@ -24,7 +24,7 @@
 
 package js.html.audio;
 
-@:enum abstract ChannelCountMode(String)
+enum abstract ChannelCountMode(String)
 {
 	var MAX = "max";
 	var CLAMPED_MAX = "clamped-max";

+ 1 - 1
std/js/html/audio/ChannelInterpretation.hx

@@ -24,7 +24,7 @@
 
 package js.html.audio;
 
-@:enum abstract ChannelInterpretation(String)
+enum abstract ChannelInterpretation(String)
 {
 	var SPEAKERS = "speakers";
 	var DISCRETE = "discrete";

+ 1 - 1
std/js/html/audio/DistanceModelType.hx

@@ -24,7 +24,7 @@
 
 package js.html.audio;
 
-@:enum abstract DistanceModelType(String)
+enum abstract DistanceModelType(String)
 {
 	var LINEAR = "linear";
 	var INVERSE = "inverse";

+ 1 - 1
std/js/html/audio/OscillatorType.hx

@@ -24,7 +24,7 @@
 
 package js.html.audio;
 
-@:enum abstract OscillatorType(String)
+enum abstract OscillatorType(String)
 {
 	var SINE = "sine";
 	var SQUARE = "square";

+ 1 - 1
std/js/html/audio/OverSampleType.hx

@@ -24,7 +24,7 @@
 
 package js.html.audio;
 
-@:enum abstract OverSampleType(String)
+enum abstract OverSampleType(String)
 {
 	var NONE = "none";
 	var _2X = "2x";

+ 1 - 1
std/js/html/audio/PanningModelType.hx

@@ -24,7 +24,7 @@
 
 package js.html.audio;
 
-@:enum abstract PanningModelType(String)
+enum abstract PanningModelType(String)
 {
 	var EQUALPOWER = "equalpower";
 	var HRTF = "HRTF";

+ 1 - 1
std/js/html/idb/CursorDirection.hx

@@ -24,7 +24,7 @@
 
 package js.html.idb;
 
-@:enum abstract CursorDirection(String)
+enum abstract CursorDirection(String)
 {
 	var NEXT = "next";
 	var NEXTUNIQUE = "nextunique";

+ 1 - 1
std/js/html/idb/RequestReadyState.hx

@@ -24,7 +24,7 @@
 
 package js.html.idb;
 
-@:enum abstract RequestReadyState(String)
+enum abstract RequestReadyState(String)
 {
 	var PENDING = "pending";
 	var DONE = "done";

+ 1 - 1
std/js/html/idb/TransactionMode.hx

@@ -24,7 +24,7 @@
 
 package js.html.idb;
 
-@:enum abstract TransactionMode(String)
+enum abstract TransactionMode(String)
 {
 	var READONLY = "readonly";
 	var READWRITE = "readwrite";

+ 1 - 1
std/js/html/rtc/DataChannelState.hx

@@ -24,7 +24,7 @@
 
 package js.html.rtc;
 
-@:enum abstract DataChannelState(String)
+enum abstract DataChannelState(String)
 {
 	var CONNECTING = "connecting";
 	var OPEN = "open";

+ 1 - 1
std/js/html/rtc/DataChannelType.hx

@@ -24,7 +24,7 @@
 
 package js.html.rtc;
 
-@:enum abstract DataChannelType(String)
+enum abstract DataChannelType(String)
 {
 	var ARRAYBUFFER = "arraybuffer";
 	var BLOB = "blob";

+ 1 - 1
std/js/html/rtc/IceConnectionState.hx

@@ -24,7 +24,7 @@
 
 package js.html.rtc;
 
-@:enum abstract IceConnectionState(String)
+enum abstract IceConnectionState(String)
 {
 	var NEW_ = "new";
 	var CHECKING = "checking";

+ 1 - 1
std/js/html/rtc/IceGatheringState.hx

@@ -24,7 +24,7 @@
 
 package js.html.rtc;
 
-@:enum abstract IceGatheringState(String)
+enum abstract IceGatheringState(String)
 {
 	var NEW_ = "new";
 	var GATHERING = "gathering";

+ 1 - 1
std/js/html/rtc/SdpType.hx

@@ -24,7 +24,7 @@
 
 package js.html.rtc;
 
-@:enum abstract SdpType(String)
+enum abstract SdpType(String)
 {
 	var OFFER = "offer";
 	var PRANSWER = "pranswer";

+ 1 - 1
std/js/html/rtc/SignalingState.hx

@@ -24,7 +24,7 @@
 
 package js.html.rtc;
 
-@:enum abstract SignalingState(String)
+enum abstract SignalingState(String)
 {
 	var STABLE = "stable";
 	var HAVE_LOCAL_OFFER = "have-local-offer";

+ 1 - 1
std/lua/Coroutine.hx

@@ -79,7 +79,7 @@ extern class Coroutine<T:Function> extends Thread {
 /**
 	A enumerator that describes the output of `Coroutine.status()`.
 **/
-@:enum
+enum
 abstract CoroutineState(String) {
 	/**
 		If the coroutine is suspended in a call to yield, or if it has not started

+ 15 - 15
std/lua/Io.hx

@@ -54,36 +54,36 @@ extern class Io {
 	public static function input(file : FileHandle) : Void;
 
 	/**
-		Opens the given file name in read mode and returns an iterator function that, 
-		each time it is called, returns a new line from the file. 
+		Opens the given file name in read mode and returns an iterator function that,
+		each time it is called, returns a new line from the file.
 	**/
 	public static function lines(?file : String) : NativeIterator<String>;
 
 	/**
 		This function opens a file, in the mode specified in the string mode.
 		It returns a new file handle, or, in case of errors, `null` plus an error message.
-		
+
 		The mode string can be any of the following:
-		
+
 		 * `"r"`: read mode (the default)
 		 * `"w"`: write mode
 		 * `"a"`: append mode
 		 * `"r+"`: update mode, all previous data is preserved
 		 * `"w+"`: update mode, all previous data is erased
-		 * `"a+"`: append update mode, previous data is preserved, writing is only 
+		 * `"a+"`: append update mode, previous data is preserved, writing is only
 		    allowed at the end of file
-		
-		The mode string can also have a `b` at the end, which is needed in some systems 
-		to open the file in binary mode. This string is exactly what is used in the 
+
+		The mode string can also have a `b` at the end, which is needed in some systems
+		to open the file in binary mode. This string is exactly what is used in the
 		standard C function fopen.
 	**/
 	public static function open (filename : String, ?mode : String) : FileHandle;
 
 	/**
-		Starts program `command` in a separated process and returns a file handle that 
-		you can use to read data from this program (if mode is `"r"`, the default) 
+		Starts program `command` in a separated process and returns a file handle that
+		you can use to read data from this program (if mode is `"r"`, the default)
 		or to write data to this program (if mode is `"w"`).
-		
+
 		This function is system dependent and is not available on all platforms.
 	**/
 	public static function popen(command  : String, ?mode : String) : FileHandle;
@@ -92,8 +92,8 @@ extern class Io {
 	public static function read(?filename : String) : String;
 
 	/**
-		Writes the value of each of its arguments to the file. The arguments must 
-		be strings or numbers. 
+		Writes the value of each of its arguments to the file. The arguments must
+		be strings or numbers.
 		To write other values, use `Lua.tostring` or `NativeStringTools.format`
 		before write.
 	**/
@@ -108,7 +108,7 @@ extern class Io {
 	public static function tmpfile() : FileHandle;
 
 	/**
-		Checks whether `obj` is a valid file handle. 
+		Checks whether `obj` is a valid file handle.
 	**/
 	public static function type(obj : FileHandle) : IoType;
 }
@@ -116,7 +116,7 @@ extern class Io {
 /**
 	A enumerator that describes the output of `Io.type()`.
 **/
-@:enum
+enum
 abstract IoType(String) {
 	var File = "file";
 	var ClosedFile = "closed file";

+ 1 - 1
std/lua/LocaleCategory.hx

@@ -1,5 +1,5 @@
 package lua;
-@:enum
+enum
 abstract LocaleCategory(String){
 	var All      = "all";
 	var Collate  = "collate";

+ 1 - 1
std/lua/Lua.hx

@@ -178,7 +178,7 @@ extern class Lua {
 /**
 	Enum for describing garbage collection options
 **/
-@:enum
+enum
 abstract CollectGarbageOption(String) {
 	var Stop = "stop";
 	var Restart = "restart";

+ 1 - 1
std/lua/lib/luasocket/socket/ReceivePattern.hx

@@ -21,7 +21,7 @@
  */
 
 package lua.lib.luasocket.socket;
-@:enum abstract ReceivePattern(String)  {
+enum abstract ReceivePattern(String)  {
 	var All  = "*a";
 	var Line = "*l";
 }

+ 1 - 1
std/lua/lib/luasocket/socket/ShutdownMode.hx

@@ -21,7 +21,7 @@
  */
 
 package lua.lib.luasocket.socket;
-@:enum abstract ShutdownMode(String)  {
+enum abstract ShutdownMode(String)  {
 	var Both    = "both";
 	var Send    = "send";
 	var Receive = "receive";

+ 1 - 1
std/lua/lib/luasocket/socket/TcpOption.hx

@@ -21,7 +21,7 @@
  */
 
 package lua.lib.luasocket.socket;
-@:enum abstract TcpOption(String)  {
+enum abstract TcpOption(String)  {
 	var KeepAlive    = "keepalive";
 	var Linger       = "linger";
 	var ReuseAddress = "reuseaddr";

+ 1 - 1
std/lua/lib/luasocket/socket/TimeoutMode.hx

@@ -22,7 +22,7 @@
 
 
 package lua.lib.luasocket.socket;
-@:enum abstract TimeoutMode(String) {
+enum abstract TimeoutMode(String) {
 	var Block = "b";
 	var Total = "t";
 }

+ 1 - 1
std/lua/lib/luv/fs/Open.hx

@@ -22,7 +22,7 @@
 
 package lua.lib.luv.fs;
 
-@:enum
+enum
 abstract Open(String) {
   var ReadOnly                 = "r";
   var ReadOnlySync             = "rs";

+ 1 - 1
std/neko/NativeXml.hx

@@ -21,7 +21,7 @@
  */
 package neko;
 
-@:enum abstract XmlType(String) {}
+enum abstract XmlType(String) {}
 
 typedef NativeXml = Xml;
 

+ 1 - 1
std/python/lib/io/IOBase.hx

@@ -21,7 +21,7 @@
  */
 package python.lib.io;
 
-@:enum abstract SeekSet(Int) {
+enum abstract SeekSet(Int) {
 	var SeekSet = 0;
 	var SeekCur = 1;
 	var SeekEnd = 2;

+ 1 - 1
std/sys/ssl/DigestAlgorithm.hx

@@ -1,6 +1,6 @@
 package sys.ssl;
 
-@:enum
+enum
 abstract DigestAlgorithm(String) to String {
 	var MD5 = "MD5";
 	var SHA1 = "SHA1";

+ 1 - 2
tests/display/src/ModuleSymbolEntry.hx

@@ -1,7 +1,6 @@
 // Taken from vshaxe... not ideal to copy it here
 
-@:enum
-private abstract ModuleSymbolKind(Int) {
+private enum abstract ModuleSymbolKind(Int) {
     var MClass = 1;
     var MInterface = 2;
     var MEnum = 3;

+ 1 - 1
tests/display/src/cases/Issue5166.hx

@@ -2,7 +2,7 @@ package cases;
 
 class Issue5166 extends DisplayTestCase {
 	/**
-		@:enum abstract E(Int) {
+		enum abstract E(Int) {
 			{-2-}var A{-1-} = 5;{-3-}
 		}
 

+ 1 - 1
tests/misc/projects/Issue2997/Main.hx

@@ -1,4 +1,4 @@
-@:enum abstract MyEnum(Int) {
+enum abstract MyEnum(Int) {
     var A = 1;
     var B = 2;
     var C = 3;

+ 1 - 1
tests/misc/projects/Issue2997/compile1.hxml

@@ -1 +1 @@
---display Main.hx@136@position
+--display Main.hx@134@position

+ 1 - 1
tests/misc/projects/Issue3621/Main1.hx

@@ -1,5 +1,5 @@
 @:native("lol")
-@:enum extern abstract E(String) {
+extern enum abstract E(String) {
     var A;
     var B;
     var C;

+ 1 - 1
tests/misc/projects/Issue4904/Main.hx

@@ -4,7 +4,7 @@ class Main {
 	}
 }
 
-@:enum
+enum
 abstract TestAbstract(Int) {
 	private var f = 0;
 }

+ 1 - 1
tests/misc/projects/Issue4907/Main.hx

@@ -9,7 +9,7 @@ class Main {
     }
 }
 
-@:enum
+enum
 abstract EnumAbstract(Int) {
     public static var VALUE = 0;
 }

+ 1 - 1
tests/misc/projects/Issue5833/Main.hx

@@ -1,4 +1,4 @@
-@:enum abstract A(Int) {
+enum abstract A(Int) {
 	var Typo = 0;
 }
 

+ 1 - 1
tests/optimization/src/Test.hx

@@ -8,7 +8,7 @@ class InlineCtor {
 	}
 }
 
-@:enum abstract MyEnum(String) to String {
+enum abstract MyEnum(String) to String {
 	var A = "a";
 }
 

+ 1 - 2
tests/optimization/src/TestLocalDce.hx

@@ -10,8 +10,7 @@ private class InlineCtor {
 	}
 }
 
-@:enum
-private abstract MyEnum(String) to String {
+private enum abstract MyEnum(String) to String {
 	var A = "a";
 }
 

+ 1 - 1
tests/runci/TestTarget.hx

@@ -1,6 +1,6 @@
 package runci;
 
-@:enum
+enum
 abstract TestTarget(String) from String {
 	var Macro = "macro";
 	var Neko = "neko";

+ 2 - 2
tests/unit/src/unit/MyAbstract.hx

@@ -306,7 +306,7 @@ abstract MyDebugString(String) to String {
 }
 
 #if !macro
-@:enum
+enum
 abstract FakeEnumAbstract(Int) {
 	var NotFound = 404;
 	var MethodNotAllowed = 405;
@@ -320,7 +320,7 @@ abstract ExposingAbstract<S>(Array<S>) {
 }
 #end
 
-@:enum abstract GADTEnumAbstract<T:haxe.Constraints.Function>(Int) {
+enum abstract GADTEnumAbstract<T:haxe.Constraints.Function>(Int) {
 	var A:GADTEnumAbstract<Void->Void> = 1;
 	var B:GADTEnumAbstract<Int->Void> = 2;
 }

+ 1 - 1
tests/unit/src/unit/issues/Issue2633.hx

@@ -1,7 +1,7 @@
 package unit.issues;
 import unit.Test;
 
-@:enum abstract WorldRegion(Int) {
+enum abstract WorldRegion(Int) {
 	static public inline var MiddleCenter = 1;
 }
 

+ 3 - 6
tests/unit/src/unit/issues/Issue2786.hx

@@ -1,22 +1,19 @@
 package unit.issues;
 
-@:enum
-private abstract E(Int) to Int {
+private enum abstract E(Int) to Int {
 	var A = 1;
 	var B = 2;
 	@:op(a | b) static function or(a:E, b:E):E;
 }
 
-@:enum
-private abstract E2(Int) to Int {
+private enum abstract E2(Int) to Int {
 	var A = 1;
 	var B = 2;
 	@:op(a | b) static function or(a:E2, b:E2):E2;
 	@:op(a | b) static function or2(a:E2, b:E2):E2;
 }
 
-@:enum
-private abstract E3(Int) to Int {
+private enum abstract E3(Int) to Int {
 	var A = 1;
 	var B = 2;
 	@:op(a | b) static function or(a:E3, b:E3):E3;

+ 1 - 2
tests/unit/src/unit/issues/Issue2939.hx

@@ -1,7 +1,6 @@
 package unit.issues;
 
-@:enum
-private abstract A(Int) to Int {
+private enum abstract A(Int) to Int {
 	var a = 1;
 	var b = 2;
 

+ 2 - 4
tests/unit/src/unit/issues/Issue3063.hx

@@ -1,12 +1,10 @@
 package unit.issues;
 
-@:enum
-private abstract AString(String) to String {
+private enum abstract AString(String) to String {
 	var CTOR1 = "foo";
 }
 
-@:enum
-private abstract AInt(Int) to Int {
+private enum abstract AInt(Int) to Int {
 	var CTOR2 = 12;
 }
 

+ 1 - 1
tests/unit/src/unit/issues/Issue3181.hx

@@ -1,6 +1,6 @@
 package unit.issues;
 
-@:enum private abstract A(Int) { }
+private enum abstract A(Int) { }
 
 class Issue3181 extends Test {
 	function test() {

+ 1 - 1
tests/unit/src/unit/issues/Issue3649.hx

@@ -1,6 +1,6 @@
 package unit.issues;
 
-@:enum
+enum
 abstract HttpStatus(Int) {
 	var NotFound = 404;
 	var MethodNotAllowed = 405;

+ 1 - 2
tests/unit/src/unit/issues/Issue3665.hx

@@ -1,7 +1,6 @@
 package unit.issues;
 
-@:enum
-private abstract E(Int) {
+private enum abstract E(Int) {
 	var A = 1;
 	var B = 2;
 }

Some files were not shown because too many files changed in this diff