Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 93f5906

Browse files
committed
add missing exp operators; fixes #91
Signed-off-by: Denys Smirnov <[email protected]>
1 parent 22a9f00 commit 93f5906

11 files changed

+774
-400
lines changed

driver/normalizer/annotation.go

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ var (
6060
"*": {role.Arithmetic, role.Multiply},
6161
"/": {role.Arithmetic, role.Divide},
6262
"%": {role.Arithmetic, role.Modulo},
63+
"**": {role.Arithmetic, role.Incomplete},
6364
"|": {role.Bitwise, role.Or},
6465
"^": {role.Bitwise, role.Xor},
6566
"&": {role.Bitwise, role.And},
@@ -73,6 +74,7 @@ var (
7374
"*=": {role.Arithmetic, role.Multiply},
7475
"/=": {role.Arithmetic, role.Divide},
7576
"%=": {role.Arithmetic, role.Modulo},
77+
"**=": {role.Arithmetic, role.Incomplete},
7678
"<<=": {role.Bitwise, role.LeftShift},
7779
">>=": {role.Bitwise, role.RightShift},
7880
">>>=": {role.Bitwise, role.RightShift, role.Unsigned},

fixtures/assignment-expression.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ a -= 0;
33
a *= 0;
44
a /= 0;
55
a %= 0;
6+
a **= 0;
67
a <<= 0;
78
a >>= 0;
89
a >>>= 0;

fixtures/assignment-expression.js.native

+114-46
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
comments: [],
3-
end: 92,
3+
end: 101,
44
loc: {
55
end: {
66
column: 0,
7-
line: 12,
7+
line: 13,
88
},
99
start: {
1010
column: 0,
@@ -384,7 +384,7 @@
384384
line: 6,
385385
},
386386
},
387-
operator: "<<=",
387+
operator: "**=",
388388
right: {
389389
end: 47,
390390
extra: {
@@ -452,7 +452,7 @@
452452
line: 7,
453453
},
454454
},
455-
operator: ">>=",
455+
operator: "<<=",
456456
right: {
457457
end: 56,
458458
extra: {
@@ -490,9 +490,9 @@
490490
type: "ExpressionStatement",
491491
},
492492
{
493-
end: 67,
493+
end: 66,
494494
expression: {
495-
end: 66,
495+
end: 65,
496496
left: {
497497
end: 59,
498498
loc: {
@@ -512,32 +512,32 @@
512512
},
513513
loc: {
514514
end: {
515-
column: 8,
515+
column: 7,
516516
line: 8,
517517
},
518518
start: {
519519
column: 0,
520520
line: 8,
521521
},
522522
},
523-
operator: ">>>=",
523+
operator: ">>=",
524524
right: {
525-
end: 66,
525+
end: 65,
526526
extra: {
527527
raw: "0",
528528
rawValue: 0,
529529
},
530530
loc: {
531531
end: {
532-
column: 8,
532+
column: 7,
533533
line: 8,
534534
},
535535
start: {
536-
column: 7,
536+
column: 6,
537537
line: 8,
538538
},
539539
},
540-
start: 65,
540+
start: 64,
541541
type: "NumericLiteral",
542542
value: 0,
543543
},
@@ -546,7 +546,7 @@
546546
},
547547
loc: {
548548
end: {
549-
column: 9,
549+
column: 8,
550550
line: 8,
551551
},
552552
start: {
@@ -558,11 +558,11 @@
558558
type: "ExpressionStatement",
559559
},
560560
{
561-
end: 75,
561+
end: 76,
562562
expression: {
563-
end: 74,
563+
end: 75,
564564
left: {
565-
end: 69,
565+
end: 68,
566566
loc: {
567567
end: {
568568
column: 1,
@@ -575,62 +575,62 @@
575575
},
576576
},
577577
name: "a",
578-
start: 68,
578+
start: 67,
579579
type: "Identifier",
580580
},
581581
loc: {
582582
end: {
583-
column: 6,
583+
column: 8,
584584
line: 9,
585585
},
586586
start: {
587587
column: 0,
588588
line: 9,
589589
},
590590
},
591-
operator: "|=",
591+
operator: ">>>=",
592592
right: {
593-
end: 74,
593+
end: 75,
594594
extra: {
595595
raw: "0",
596596
rawValue: 0,
597597
},
598598
loc: {
599599
end: {
600-
column: 6,
600+
column: 8,
601601
line: 9,
602602
},
603603
start: {
604-
column: 5,
604+
column: 7,
605605
line: 9,
606606
},
607607
},
608-
start: 73,
608+
start: 74,
609609
type: "NumericLiteral",
610610
value: 0,
611611
},
612-
start: 68,
612+
start: 67,
613613
type: "AssignmentExpression",
614614
},
615615
loc: {
616616
end: {
617-
column: 7,
617+
column: 9,
618618
line: 9,
619619
},
620620
start: {
621621
column: 0,
622622
line: 9,
623623
},
624624
},
625-
start: 68,
625+
start: 67,
626626
type: "ExpressionStatement",
627627
},
628628
{
629-
end: 83,
629+
end: 84,
630630
expression: {
631-
end: 82,
631+
end: 83,
632632
left: {
633-
end: 77,
633+
end: 78,
634634
loc: {
635635
end: {
636636
column: 1,
@@ -643,7 +643,7 @@
643643
},
644644
},
645645
name: "a",
646-
start: 76,
646+
start: 77,
647647
type: "Identifier",
648648
},
649649
loc: {
@@ -656,9 +656,9 @@
656656
line: 10,
657657
},
658658
},
659-
operator: "^=",
659+
operator: "|=",
660660
right: {
661-
end: 82,
661+
end: 83,
662662
extra: {
663663
raw: "0",
664664
rawValue: 0,
@@ -673,11 +673,11 @@
673673
line: 10,
674674
},
675675
},
676-
start: 81,
676+
start: 82,
677677
type: "NumericLiteral",
678678
value: 0,
679679
},
680-
start: 76,
680+
start: 77,
681681
type: "AssignmentExpression",
682682
},
683683
loc: {
@@ -690,15 +690,15 @@
690690
line: 10,
691691
},
692692
},
693-
start: 76,
693+
start: 77,
694694
type: "ExpressionStatement",
695695
},
696696
{
697-
end: 91,
697+
end: 92,
698698
expression: {
699-
end: 90,
699+
end: 91,
700700
left: {
701-
end: 85,
701+
end: 86,
702702
loc: {
703703
end: {
704704
column: 1,
@@ -711,7 +711,7 @@
711711
},
712712
},
713713
name: "a",
714-
start: 84,
714+
start: 85,
715715
type: "Identifier",
716716
},
717717
loc: {
@@ -724,9 +724,9 @@
724724
line: 11,
725725
},
726726
},
727-
operator: "&=",
727+
operator: "^=",
728728
right: {
729-
end: 90,
729+
end: 91,
730730
extra: {
731731
raw: "0",
732732
rawValue: 0,
@@ -741,11 +741,11 @@
741741
line: 11,
742742
},
743743
},
744-
start: 89,
744+
start: 90,
745745
type: "NumericLiteral",
746746
value: 0,
747747
},
748-
start: 84,
748+
start: 85,
749749
type: "AssignmentExpression",
750750
},
751751
loc: {
@@ -758,17 +758,85 @@
758758
line: 11,
759759
},
760760
},
761-
start: 84,
761+
start: 85,
762+
type: "ExpressionStatement",
763+
},
764+
{
765+
end: 100,
766+
expression: {
767+
end: 99,
768+
left: {
769+
end: 94,
770+
loc: {
771+
end: {
772+
column: 1,
773+
line: 12,
774+
},
775+
identifierName: "a",
776+
start: {
777+
column: 0,
778+
line: 12,
779+
},
780+
},
781+
name: "a",
782+
start: 93,
783+
type: "Identifier",
784+
},
785+
loc: {
786+
end: {
787+
column: 6,
788+
line: 12,
789+
},
790+
start: {
791+
column: 0,
792+
line: 12,
793+
},
794+
},
795+
operator: "&=",
796+
right: {
797+
end: 99,
798+
extra: {
799+
raw: "0",
800+
rawValue: 0,
801+
},
802+
loc: {
803+
end: {
804+
column: 6,
805+
line: 12,
806+
},
807+
start: {
808+
column: 5,
809+
line: 12,
810+
},
811+
},
812+
start: 98,
813+
type: "NumericLiteral",
814+
value: 0,
815+
},
816+
start: 93,
817+
type: "AssignmentExpression",
818+
},
819+
loc: {
820+
end: {
821+
column: 7,
822+
line: 12,
823+
},
824+
start: {
825+
column: 0,
826+
line: 12,
827+
},
828+
},
829+
start: 93,
762830
type: "ExpressionStatement",
763831
},
764832
],
765833
directives: [],
766-
end: 92,
834+
end: 101,
767835
interpreter: ~,
768836
loc: {
769837
end: {
770838
column: 0,
771-
line: 12,
839+
line: 13,
772840
},
773841
start: {
774842
column: 0,

0 commit comments

Comments
 (0)