Skip to content

Commit

Permalink
fixed dot handling for new Class() instances (#210)
Browse files Browse the repository at this point in the history
* fixed dot handling for new Class() instances
* updated dependencies
  • Loading branch information
AlexHaxe authored Apr 23, 2022
1 parent 34216bc commit ecade4d
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tokentree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
haxe-version: ['4.2.4', 'nightly']
haxe-version: ['4.2.5', 'nightly']
steps:
- uses: actions/checkout@v1
- name: Use Node.js 10
Expand Down Expand Up @@ -58,5 +58,5 @@ jobs:
if: matrix.haxe-version != 'nightly'
run: npx neko checkstyle/run.n -s src -s test
- name: Upload results to codecov
if: success() && (matrix.haxe-version == '4.2.4')
if: success() && (matrix.haxe-version == '4.2.5')
run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
2 changes: 1 addition & 1 deletion .haxerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.2.4",
"version": "4.2.5",
"resolveLibs": "scoped"
}
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

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

## version 1.1.2 (2022-04-23)

- Added support for default type parameter ([#207](https://github.com/HaxeCheckstyle/tokentree/issues/207))
- Added support for static locals ([#208](https://github.com/HaxeCheckstyle/tokentree/issues/208) + [#209](https://github.com/HaxeCheckstyle/tokentree/issues/209))
- Fixed Dot handling for new Class() instances ([#210](https://github.com/HaxeCheckstyle/tokentree/issues/210))

## version 1.1.1 (2021-01-22)

Expand Down
4 changes: 2 additions & 2 deletions haxe_libraries/haxeparser.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @install: lix --silent download "gh://github.com/HaxeCheckstyle/haxeparser#dace004f6aff39cf7cf3a9279da24f63b27de2af" into haxeparser/3.3.0/github/dace004f6aff39cf7cf3a9279da24f63b27de2af
# @install: lix --silent download "gh://github.com/HaxeCheckstyle/haxeparser#7230c32c5bed0a2eef4f05260d79d25627648abe" into haxeparser/3.3.0/github/7230c32c5bed0a2eef4f05260d79d25627648abe
-lib hxparse
-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/dace004f6aff39cf7cf3a9279da24f63b27de2af/src
-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/7230c32c5bed0a2eef4f05260d79d25627648abe/src
-D haxeparser=3.3.0
6 changes: 3 additions & 3 deletions haxe_libraries/hxjsonast.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "haxelib:/hxjsonast#1.0.1" into hxjsonast/1.0.1/haxelib
-cp ${HAXE_LIBCACHE}/hxjsonast/1.0.1/haxelib/src
-D hxjsonast=1.0.1
# @install: lix --silent download "haxelib:/hxjsonast#1.1.0" into hxjsonast/1.1.0/haxelib
-cp ${HAXE_LIBCACHE}/hxjsonast/1.1.0/haxelib/src
-D hxjsonast=1.1.0
6 changes: 3 additions & 3 deletions haxe_libraries/hxparse.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "gh://github.com/Simn/hxparse#93f67419852e96daa2b81901c43a77e878c8c2bc" into hxparse/4.0.1/github/93f67419852e96daa2b81901c43a77e878c8c2bc
-cp ${HAXE_LIBCACHE}/hxparse/4.0.1/github/93f67419852e96daa2b81901c43a77e878c8c2bc/src
-D hxparse=4.0.1
# @install: lix --silent download "gh://github.com/simn/hxparse#32e376f80c4b0e999e9f3229947d4dac2138382b" into hxparse/4.0.1/github/32e376f80c4b0e999e9f3229947d4dac2138382b
-cp ${HAXE_LIBCACHE}/hxparse/4.0.1/github/32e376f80c4b0e999e9f3229947d4dac2138382b/src
-D hxparse=4.0.1
6 changes: 3 additions & 3 deletions haxe_libraries/json2object.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @install: lix --silent download "gh://github.com/elnabo/json2object#a6845b4826151271dd34c69631ffda0886abd562" into json2object/3.8.1/github/a6845b4826151271dd34c69631ffda0886abd562
# @install: lix --silent download "haxelib:/json2object#3.10.0" into json2object/3.10.0/haxelib
-lib hxjsonast
-cp ${HAXE_LIBCACHE}/json2object/3.8.1/github/a6845b4826151271dd34c69631ffda0886abd562/src
-D json2object=3.8.1
-cp ${HAXE_LIBCACHE}/json2object/3.10.0/haxelib/src
-D json2object=3.10.0
6 changes: 3 additions & 3 deletions haxe_libraries/test-adapter.hxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @install: lix --silent download "haxelib:/test-adapter#1.2.9" into test-adapter/1.2.9/haxelib
# @install: lix --silent download "haxelib:/test-adapter#2.0.1" into test-adapter/2.0.1/haxelib
-lib json2object
-cp ${HAXE_LIBCACHE}/test-adapter/1.2.9/haxelib/
-D test-adapter=1.2.9
-cp ${HAXE_LIBCACHE}/test-adapter/2.0.1/haxelib/
-D test-adapter=2.0.1
--macro _testadapter.Macro.init()
4 changes: 2 additions & 2 deletions haxe_libraries/utest.hxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @install: lix --silent download "haxelib:/utest#1.13.2" into utest/1.13.2/haxelib
-cp ${HAXE_LIBCACHE}/utest/1.13.2/haxelib/src
# @install: lix --silent download "gh://github.com/haxe-utest/utest#5de48a964ca75c8e6321ac9706346a24958af2a4" into utest/1.13.2/github/5de48a964ca75c8e6321ac9706346a24958af2a4
-cp ${HAXE_LIBCACHE}/utest/1.13.2/github/5de48a964ca75c8e6321ac9706346a24958af2a4/src
-D utest=1.13.2
--macro utest.utils.Macro.checkHaxe()
--macro utest.utils.Macro.importEnvSettings()
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 parens after curlies - see CHANGELOG for details",
"version": "1.1.1",
"releasenote": "added support for static locals and default type parameter - see CHANGELOG for details",
"version": "1.1.2",
"url": "https://github.com/HaxeCheckstyle/tokentree",
"dependencies": {}
}
2 changes: 1 addition & 1 deletion makeReleaseZip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

npm install
npx lix download
npx lix use haxe 4.2.4
npx lix use haxe 4.2.5

haxe test.hxml

Expand Down
4 changes: 2 additions & 2 deletions 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.1.1",
"version": "1.1.2",
"description": "TokenTree library used by haxe-checkstyle, haxe-formatter and haxe-languageserver",
"repository": {
"type": "git",
Expand Down
10 changes: 8 additions & 2 deletions src/tokentree/walk/WalkNew.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ class WalkNew {
var newTok:TokenTree = stream.consumeTokenDef(Kwd(KwdNew));
parent.addChild(newTok);
var name:TokenTree = WalkTypeNameDef.walkTypeNameDef(stream, newTok);
var pOpen:Null<TokenTree> = null;

WalkComment.walkComment(stream, name);
switch (stream.token()) {
case POpen:
WalkPOpen.walkPOpen(stream, name);
pOpen = WalkPOpen.walkPOpen(stream, name);
case Sharp(_):
WalkSharp.walkSharp(stream, parent, WalkStatement.walkStatement);
default:
Expand All @@ -18,7 +19,12 @@ class WalkNew {

switch (stream.token()) {
case Dot | Binop(_) | Const(CIdent("is")) | BkOpen:
WalkStatement.walkStatement(stream, name);
if (pOpen != null) {
WalkStatement.walkStatement(stream, pOpen);
}
else {
WalkStatement.walkStatement(stream, name);
}
default:
}
}
Expand Down

0 comments on commit ecade4d

Please sign in to comment.