Skip to content

Commit

Permalink
prepare release 1.0.11 (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe authored Sep 3, 2018
1 parent d1cf599 commit fb57da8
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 24 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## dev branch / next version (1.x.x)

## version 1.0.11 (2018-09-03)

- Fixed position of semicolon [#113](https://github.com/HaxeCheckstyle/tokentree/issues/113)
- Fixed handling of unary expressions [#113](https://github.com/HaxeCheckstyle/tokentree/issues/113)
- Fixed detection of type check on numbers [#114](https://github.com/HaxeCheckstyle/tokentree/issues/114)
Expand Down
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": "added Colon type detection, fixed arrow and bropen detection - see CHANGELOG for details",
"version": "1.0.10",
"releasenote": "bugfixes - see CHANGELOG for details",
"version": "1.0.11",
"url": "https://github.com/HaxeCheckstyle/tokentree",
"dependencies": {}
}
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.10",
"version": "1.0.11",
"description": "TokenTree library used by haxe-checkstyle",
"repository": {
"type": "git",
Expand Down
11 changes: 10 additions & 1 deletion src/tokentree/utils/TokenTreeCheckUtils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ class TokenTreeCheckUtils {

public static function isOpGtTypedefExtension(token:TokenTree):Bool {
return switch (token.tok) {
case Binop(OpGt): (token.access().parent().is(BrOpen).parent().is(Binop(OpAssign)).parent().isCIdent().parent().is(Kwd(KwdTypedef)).token != null);
case Binop(OpGt): (token.access()
.parent()
.is(BrOpen)
.parent()
.is(Binop(OpAssign))
.parent()
.isCIdent()
.parent()
.is(Kwd(KwdTypedef))
.token != null);
default: false;
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/tokentree/walk/WalkClass.hx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ class WalkClass {
}

static function walkClassContinueAfterSharp(stream:TokenStream, parent:TokenTree) {
var brOpen:TokenTreeAccessHelper = TokenTreeAccessHelper.access(parent).lastChild().is(Sharp("if")).lastOf(Kwd(KwdFunction)).firstChild().lastChild().is(
BrOpen);
var brOpen:TokenTreeAccessHelper = TokenTreeAccessHelper.access(parent)
.lastChild()
.is(Sharp("if"))
.lastOf(Kwd(KwdFunction))
.firstChild()
.lastChild()
.is(BrOpen);
if (brOpen.token == null) return;
if (brOpen.lastChild().is(BrClose).token != null) return;
WalkBlock.walkBlockContinue(stream, parent);
Expand Down
36 changes: 18 additions & 18 deletions src/tokentree/walk/WalkSwitch.hx
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,24 @@ class WalkSwitch {

static function relocateSharpTree(parent:TokenTree, dblDot:TokenTree) {
/*
* relocate sharp subtree from:
* |- BrOpen
* |- Kwd(KwdCase)
* | |- expression
* | |- DblDot
* | |- statement
* |- Sharp(If)
* | |- condition
* | |- statement (if not a new case)
* to:
* |- Kwd(KwdCase)
* | |- expression
* | |- DblDot
* | |- statement
* | |- Sharp(If)
* | |- condition
* | |- statement
*/
* relocate sharp subtree from:
* |- BrOpen
* |- Kwd(KwdCase)
* | |- expression
* | |- DblDot
* | |- statement
* |- Sharp(If)
* | |- condition
* | |- statement (if not a new case)
* to:
* |- Kwd(KwdCase)
* | |- expression
* | |- DblDot
* | |- statement
* | |- Sharp(If)
* | |- condition
* | |- statement
*/
var sharp:TokenTree = parent.getLastChild();
if (sharp.children.length < 2) return;
var body:TokenTree = sharp.children[1];
Expand Down

0 comments on commit fb57da8

Please sign in to comment.