[CFE] >>> in fasta
Parser support was enabled a long time ago (under a flag;
52892f7c4789f4df11b2cdce376dc41c7968574a).
Enabling it would crash fasta though. This CL stops that from happening
and instead creates code that seems to work.
Change-Id: Ibe9735bd428104371ab34a1be08838988079220c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97621
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
diff --git a/pkg/front_end/lib/src/fasta/operator.dart b/pkg/front_end/lib/src/fasta/operator.dart
index dad4440..1617a5a 100644
--- a/pkg/front_end/lib/src/fasta/operator.dart
+++ b/pkg/front_end/lib/src/fasta/operator.dart
@@ -25,6 +25,7 @@
modulo,
multiply,
rightShift,
+ tripleShift,
subtract,
truncatingDivide,
unaryMinus,
@@ -48,6 +49,7 @@
if (identical("%", string)) return Operator.modulo;
if (identical("*", string)) return Operator.multiply;
if (identical(">>", string)) return Operator.rightShift;
+ if (identical(">>>", string)) return Operator.tripleShift;
if (identical("-", string)) return Operator.subtract;
if (identical("~/", string)) return Operator.truncatingDivide;
if (identical("unary-", string)) return Operator.unaryMinus;
@@ -90,6 +92,8 @@
return "*";
case Operator.rightShift:
return ">>";
+ case Operator.tripleShift:
+ return ">>>";
case Operator.subtract:
return "-";
case Operator.truncatingDivide:
@@ -121,6 +125,7 @@
case Operator.modulo:
case Operator.multiply:
case Operator.rightShift:
+ case Operator.tripleShift:
case Operator.subtract:
case Operator.truncatingDivide:
return 1;
diff --git a/pkg/front_end/lib/src/fasta/scanner/token.dart b/pkg/front_end/lib/src/fasta/scanner/token.dart
index f10081d..26ab536 100644
--- a/pkg/front_end/lib/src/fasta/scanner/token.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/token.dart
@@ -299,6 +299,7 @@
identical(value, "+") ||
identical(value, "<<") ||
identical(value, ">>") ||
+ identical(value, ">>>") ||
identical(value, ">=") ||
identical(value, ">") ||
identical(value, "<=") ||