Skip to content

Commit 9c356d8

Browse files
committed
naive: Fix formatting new static
1 parent ed80977 commit 9c356d8

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

naive/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (p *parser) parseStmt(separators ...token.Type) (s *stmt) {
235235
switch tok, _ := v.(token.Token); tok.Type {
236236
case token.Whitespace:
237237
continue
238-
case token.Echo, token.Print:
238+
case token.Echo, token.Print, token.Static:
239239
scope = token.Ident
240240
case token.Ident, token.Var:
241241
if nextScope != token.Function {

testdata/class.golden

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ var_dump(AAAClass::{$searchableConstant});
7373
$a = new class() {
7474
}
7575
->doesNotExist();
76+
77+
return new static(
78+
'foo',
79+
'bar',
80+
);
81+
82+
return new self(
83+
'foo',
84+
'bar',
85+
);

testdata/class.input

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,14 @@ var_dump(AAAClass :: {$searchableConstant});
6767
$a = new class(){
6868
}
6969
->doesNotExist();
70+
71+
72+
return new static (
73+
'foo',
74+
'bar'
75+
) ;
76+
77+
return new self (
78+
'foo',
79+
'bar'
80+
) ;

0 commit comments

Comments
 (0)