diff --git a/CHANGES.md b/CHANGES.md index 703b5ba363..8a42a86249 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -30,6 +30,7 @@ Core Grammars: - fix(types) fix interface LanguageDetail > keywords [Patrick Chiu] - enh(java) add `goto` to be recognized as a keyword in Java [Alvin Joy][] - enh(bash) add keyword `sudo` [Alvin Joy][] +- fix(haxe) captures `new` keyword without capturing it within variables/class names [Cameron Taylor][] - fix(go) fix go number literals to accept `_` separators, add hex p exponents [Lisa Ugray][] - enh(markdown) add entity support [David Schach][] [TaraLei][] - enh(css) add `justify-items` and `justify-self` attributes [Vasily Polovnyov][] @@ -75,12 +76,14 @@ Themes: [Alvin Joy]: https://github.com/alvinsjoy [Lisa Ugray]: https://github.com/lugray [TaraLei]: https://github.com/TaraLei +[Cameron Taylor]: https://github.com/ninjamuffin99 [Vasily Polovnyov]: https://github.com/vast [Arman Uguray]: https://github.com/armansito [RĂșnar Bjarnason]: https://github.com/runarorama [Carl RĂ€fting]: https://github.com/carlrafting + ## Version 11.9.0 CAVEATS / POTENTIALLY BREAKING CHANGES diff --git a/src/languages/haxe.js b/src/languages/haxe.js index 68507d69c8..084b80263b 100644 --- a/src/languages/haxe.js +++ b/src/languages/haxe.js @@ -89,7 +89,7 @@ export default function(hljs) { }, { className: 'type', // instantiation - begin: /new */, + beginKeywords: 'new', end: /\W/, excludeBegin: true, excludeEnd: true diff --git a/test/markup/haxe/default.expect.txt b/test/markup/haxe/default.expect.txt index ce81460df1..72d1b25922 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"); } @@ -175,4 +175,10 @@ if( lo < j ) quicksort( lo, j ); if( i < hi ) quicksort( i, hi ); } + + function generateNewArray(newArray:Array):Void { + var i = newArray; + var array = new Array(); + } + } \ No newline at end of file diff --git a/test/markup/haxe/default.txt b/test/markup/haxe/default.txt index 6c4d8f69a6..4c11b45d2e 100644 --- a/test/markup/haxe/default.txt +++ b/test/markup/haxe/default.txt @@ -175,4 +175,10 @@ class Main extends BaseClass implements SomeFunctionality { if( lo < j ) quicksort( lo, j ); if( i < hi ) quicksort( i, hi ); } + + function generateNewArray(newArray:Array):Void { + var i = newArray; + var array = new Array(); + } + } \ No newline at end of file