Skip to content

Commit

Permalink
fixed metadata for parens
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Aug 2, 2024
1 parent 3738d89 commit 24b6657
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## version 1.2.13 (2024-08-02)

- Fixed metadata for parens

## version 1.2.12 (2024-07-30)

- Fixed parsing a single `false`, `true` or `null`
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": "fixed parsing a single false, true or null - see CHANGELOG for details",
"version": "1.2.12",
"releasenote": "fixed metadata for parens - see CHANGELOG for details",
"version": "1.2.13",
"url": "https://github.com/HaxeCheckstyle/tokentree",
"dependencies": {}
}
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.2.12",
"version": "1.2.13",
"description": "TokenTree library used by haxe-checkstyle, haxe-formatter and haxe-languageserver",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions src/tokentree/walk/WalkPOpen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class WalkPOpen {
public static function walkPOpen(stream:TokenStream, parent:TokenTree, walkTrailingComments:Bool = true):TokenTree {
var pOpen:TokenTree = stream.consumeTokenDef(POpen);
parent.addChild(pOpen);
stream.applyTempStore(pOpen);
WalkPOpen.walkPOpenParts(stream, pOpen);
pOpen.addChild(stream.consumeTokenDef(PClose));
if (walkTrailingComments) {
Expand Down
10 changes: 10 additions & 0 deletions test/tokentree/TokenTreeBuilderParsingTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class TokenTreeBuilderParsingTest implements ITest {
assertCodeParses(MACRO_COLON_TYPE);
assertCodeParses(TYPE_PARAMETER_WITH_GT);
assertCodeParses(INLINE_CALL);
assertCodeParses(METADATA_ON_PARENS);
}

@Test
Expand Down Expand Up @@ -1905,4 +1906,13 @@ import #if haxe4 js.lib.Promise #else js.Promise #end as JsPromise;
var FALSE = "false";

var NULL = "null";

var METADATA_ON_PARENS = "class TestCrashMacro {
static function combine(structure:Expr):Expr {
if (structure.expr.match(EDisplay(_, DKMarked))) {
return macro @:pos(Context.currentPos()) ($structure : {});
}
return Expr();
}
}";
}

0 comments on commit 24b6657

Please sign in to comment.