Skip to content

Commit

Permalink
fixed NPE with private final class, fixes #183 (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe authored Apr 17, 2020
1 parent 131ef6f commit 970fee7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

## dev branch / next version (1.x.x)

## version 1.0.27 (2020-04-18)

- Fixed null pointer exception when pasrsing `private final class`, fixes [#183](https://github.com/HaxeCheckstyle/tokentree/issues/183) ([#184](https://github.com/HaxeCheckstyle/tokentree/issues/184))

## version 1.0.26 (2020-04-12)

- Fixed `Binop(OpOr)` position for non `case` places
- Fixed doc comments and metadata
- Fixed `Binop(OpOr)` position for non `case` places ([#182](https://github.com/HaxeCheckstyle/tokentree/issues/182))
- Fixed doc comments and metadata ([#182](https://github.com/HaxeCheckstyle/tokentree/issues/182))

## version 1.0.25 (2020-04-11)

Expand Down Expand Up @@ -253,4 +257,4 @@

## version 1.0.0 (2018-06-09)

- initial move to separate repository
- initial move to separate repository
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"contributors": [
"AlexHaxe"
],
"releasenote": "fixed position Binop(OpOr) tokens and metadata with doc comments - see CHANGELOG for details",
"version": "1.0.26",
"releasenote": "fixed null pointer for `private final class` - see CHANGELOG for details",
"version": "1.0.27",
"url": "https://github.com/HaxeCheckstyle/tokentree",
"dependencies": {}
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tokentree",
"version": "1.0.26",
"version": "1.0.27",
"description": "TokenTree library used by haxe-checkstyle, haxe-formatter and haxe-languageserver",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions src/tokentree/walk/WalkFinal.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class WalkFinal {
stream.consumeToTempStore();
case Kwd(KwdFunction):
return;
case Kwd(KwdClass):
return;
default:
}
}
Expand Down
7 changes: 7 additions & 0 deletions test/tokentree/TokenTreeBuilderParsingTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class TokenTreeBuilderParsingTest {
assertCodeParses(MODULE_LEVEL_STATIC);
assertCodeParses(SWITCH_INDENTATION);
assertCodeParses(METADATA_DOC_COMMENT);
assertCodeParses(PRIVATE_FINAL_CLASS);
}

public function assertCodeParses(code:String, ?pos:PosInfos) {
Expand Down Expand Up @@ -1555,4 +1556,10 @@ import #if haxe4 js.lib.Promise #else js.Promise #end as JsPromise;
*/
extern class Bitmap extends DisplayObject {}
";

var PRIVATE_FINAL_CLASS = "
private final class Test {
public function new() {}
}
";
}

0 comments on commit 970fee7

Please sign in to comment.