Skip to content

Commit 0603ae6

Browse files
authored
Merge pull request glayzzle#140 from mgrip/usegroup-loc-bug
WIP usegroup loc bug
2 parents 6075cc8 + 446852d commit 0603ae6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/namespaceTest.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,35 @@ describe("Test namespace statements", function() {
9191
);
9292
// @todo : make assertions
9393
});
94+
95+
it.only("should read usegroup location correctly", function() {
96+
const testCase = [
97+
"namespace Test\\test\\test;",
98+
"",
99+
"use Some\\other\\test;",
100+
"",
101+
"/**",
102+
" * @property \\Test\\test $test",
103+
" */",
104+
"class Foo extends Bar implements Baz, Buzz {",
105+
" public $test;",
106+
"",
107+
" function test() {",
108+
" return true;",
109+
" }",
110+
"",
111+
" public function &passByReferenceTest() {",
112+
" $a = 1;",
113+
" return $a;",
114+
" }",
115+
"}"
116+
].join("\n");
117+
const ast = parser.parseEval(testCase, { ast: { withPositions: true } });
118+
const astWithDocs = parser.parseEval(testCase, {
119+
ast: { withPositions: true },
120+
parser: { extractDoc: true }
121+
});
122+
ast.children[0].children[0].loc.end.line.should.be.exactly(3);
123+
astWithDocs.children[0].children[0].loc.end.line.should.be.exactly(3);
124+
});
94125
});

0 commit comments

Comments
 (0)