File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -561,6 +561,41 @@ Program {
561
561
}
562
562
` ;
563
563
564
+ exports [` bin ?? right-associative 1` ] = `
565
+ Program {
566
+ " children" : Array [
567
+ ExpressionStatement {
568
+ " expression" : Bin {
569
+ " kind" : " bin" ,
570
+ " left" : Bin {
571
+ " kind" : " bin" ,
572
+ " left" : Variable {
573
+ " curly" : false ,
574
+ " kind" : " variable" ,
575
+ " name" : " foo" ,
576
+ },
577
+ " right" : Variable {
578
+ " curly" : false ,
579
+ " kind" : " variable" ,
580
+ " name" : " bar" ,
581
+ },
582
+ " type" : " ??" ,
583
+ },
584
+ " right" : Variable {
585
+ " curly" : false ,
586
+ " kind" : " variable" ,
587
+ " name" : " bazz" ,
588
+ },
589
+ " type" : " ??" ,
590
+ },
591
+ " kind" : " expressionstatement" ,
592
+ },
593
+ ],
594
+ " errors" : Array [],
595
+ " kind" : " program" ,
596
+ }
597
+ ` ;
598
+
564
599
exports [` bin ^ 1` ] = `
565
600
Program {
566
601
" children" : Array [
Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ describe("bin", () => {
103
103
it ( "??" , ( ) => {
104
104
expect ( parser . parseEval ( "$foo ?? $bar;" ) ) . toMatchSnapshot ( ) ;
105
105
} ) ;
106
+ it ( "?? right-associative" , ( ) => {
107
+ expect ( parser . parseEval ( "$foo ?? $bar ?? $bazz;" ) ) . toMatchSnapshot ( ) ;
108
+ } ) ;
106
109
it ( "?? (php < 7)" , function ( ) {
107
110
const astErr = parser . parseEval ( `$var ?? $var;` , {
108
111
parser : {
You can’t perform that action at this time.
0 commit comments