@@ -413,22 +413,10 @@ module.exports = {
413
413
switch ( this . token ) {
414
414
case "=" : {
415
415
if ( isConst ) this . error ( "VARIABLE" ) ;
416
- let right ;
417
416
if ( this . next ( ) . token == "&" ) {
418
- this . next ( ) ;
419
- if ( this . token === this . tok . T_NEW ) {
420
- if ( this . version >= 700 ) {
421
- this . error ( ) ;
422
- }
423
- right = this . read_new_expr ( ) ;
424
- } else {
425
- right = this . read_variable ( false , false ) ;
426
- }
427
-
428
- return result ( "assignref" , expr , right ) ;
417
+ return this . read_assignref ( result , expr ) ;
429
418
}
430
- right = this . read_expr ( ) ;
431
- return result ( "assign" , expr , right , "=" ) ;
419
+ return result ( "assign" , expr , this . read_expr ( ) , "=" ) ;
432
420
}
433
421
434
422
// operations :
@@ -520,6 +508,25 @@ module.exports = {
520
508
return expr ;
521
509
} ,
522
510
511
+ /**
512
+ * Reads assignment
513
+ * @param {* } left
514
+ */
515
+ read_assignref : function ( result , left ) {
516
+ this . next ( ) ;
517
+ let right ;
518
+ if ( this . token === this . tok . T_NEW ) {
519
+ if ( this . version >= 700 ) {
520
+ this . error ( ) ;
521
+ }
522
+ right = this . read_new_expr ( ) ;
523
+ } else {
524
+ right = this . read_variable ( false , false ) ;
525
+ }
526
+
527
+ return result ( "assignref" , left , right ) ;
528
+ } ,
529
+
523
530
/**
524
531
*
525
532
* inline_function:
0 commit comments