diff --git a/CHANGES.md b/CHANGES.md
index b1413c29a5..cd0797b0fd 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -26,6 +26,7 @@ Core Grammars:
- enh(json) add json5 support [Kerry Shetline][]
- fix(css) `unicode-range` parsing, issue #4253 [Kerry Shetline][]
- fix(csharp) Support digit separators [te-ing][]
+- fix(haxe) Restore highlighting of type after new keyword [Josh Tynjala][]
Documentation:
@@ -55,6 +56,7 @@ CONTRIBUTORS
[te-ing]: https://github.com/te-ing
[Anthony Martin]: https://github.com/anthony-c-martin
[NriotHrreion]: https://github.com/NriotHrreion
+[Josh Tynjala]: https://github.com/joshtynjala
## Version 11.11.1
diff --git a/src/languages/haxe.js b/src/languages/haxe.js
index 084b80263b..f1cefe1bd1 100644
--- a/src/languages/haxe.js
+++ b/src/languages/haxe.js
@@ -89,7 +89,7 @@ export default function(hljs) {
},
{
className: 'type', // instantiation
- beginKeywords: 'new',
+ begin: /new[ \t]+/,
end: /\W/,
excludeBegin: true,
excludeEnd: true
diff --git a/test/markup/haxe/default.expect.txt b/test/markup/haxe/default.expect.txt
index 72d1b25922..cd4d0869ff 100644
--- a/test/markup/haxe/default.expect.txt
+++ b/test/markup/haxe/default.expect.txt
@@ -84,7 +84,7 @@
class Main extends BaseClass implements SomeFunctionality {
var callback:Void->Void = null;
- var myArray:Array<Float> = new Array<Float>();
+ var myArray:Array<Float> = new Array<Float>();
var arr = [4,8,0,3,9,1,5,2,6,7];
public function new(x) {
@@ -120,8 +120,8 @@
done = true;
}
- var H:Int = cast new MyAbstract(42);
- var h:Int = cast(new MyAbstract(31), Int);
+ var H:Int = cast new MyAbstract(42);
+ var h:Int = cast(new MyAbstract(31), Int);
try {
throw "error";
@@ -130,7 +130,7 @@
trace(err);
}
- var map = new haxe.ds.IntMap<String>();
+ var map = new haxe.ds.IntMap<String>();
var f = map.set.bind(_, "12");
}
@@ -178,7 +178,7 @@
function generateNewArray(newArray:Array):Void {
var i = newArray;
- var array = new Array();
+ var array = new Array();
}
}
\ No newline at end of file