@@ -886,24 +886,30 @@ let rec scan scanner =
886
886
| _ ->
887
887
next scanner;
888
888
Token. Plus )
889
- | '>' -> (
889
+ | '>' when not (in_diamond_mode scanner) -> (
890
890
match peek scanner with
891
- | '=' when not (in_diamond_mode scanner) ->
891
+ | '=' ->
892
892
next2 scanner;
893
893
Token. GreaterEqual
894
+ | '>' -> (
895
+ match peek2 scanner with
896
+ | '>' ->
897
+ next3 scanner;
898
+ Token. RightShiftUnsigned
899
+ | _ ->
900
+ next2 scanner;
901
+ Token. RightShift )
894
902
| _ ->
895
903
next scanner;
896
904
Token. GreaterThan )
897
- | '<' when not (in_diamond_mode scanner) -> (
898
- match peek scanner with
899
- | '=' ->
900
- next2 scanner;
901
- Token. LessEqual
902
- | _ ->
903
- next scanner;
904
- Token. LessThan )
905
+ | '>' ->
906
+ next scanner;
907
+ Token. GreaterThan
905
908
| '<' when not (in_jsx_mode scanner) -> (
906
909
match peek scanner with
910
+ | '<' when not (in_diamond_mode scanner) ->
911
+ next2 scanner;
912
+ Token. LeftShift
907
913
| '=' ->
908
914
next2 scanner;
909
915
Token. LessEqual
@@ -1054,26 +1060,3 @@ let is_binary_op src start_cnum end_cnum =
1054
1060
|| is_whitespace (String. unsafe_get src end_cnum)
1055
1061
in
1056
1062
left_ok && right_ok)
1057
-
1058
- let is_left_shift scanner _start_cnum =
1059
- (* print_endline ("@@@@@ is_left_shift ch: " ^ (Char.escaped scanner.ch)); *)
1060
- (* print_endline ("@@@@@ is_left_shift cnum: " ^ (string_of_int _start_cnum)); *)
1061
- (* print_endline ("@@@@@ is_left_shift peek: " ^ (Char.escaped (peek scanner))); *)
1062
- match scanner.ch with
1063
- | '<' -> true
1064
- | _ -> false
1065
-
1066
- let is_right_shift scanner _start_cnum =
1067
- (* print_endline ("@@@@@ is_right_shift ch: " ^ (Char.escaped scanner.ch)); *)
1068
- (* print_endline ("@@@@@ is_right_shift cnum: " ^ (string_of_int _start_cnum)); *)
1069
- (* print_endline ("@@@@@ is_right_shift peek: " ^ (Char.escaped (peek scanner))); *)
1070
- match scanner.ch with
1071
- | '>' -> true
1072
- | _ -> false
1073
-
1074
- let is_right_shift_unsigned scanner _start_cnum =
1075
- (* print_endline ("@@@@@ is_right_shift_unsigned ch: " ^ (Char.escaped scanner.ch)); *)
1076
- (* print_endline ("@@@@@ is_right_shift_unsigned peek: " ^ (Char.escaped (peek scanner))); *)
1077
- match (scanner.ch, peek scanner) with
1078
- | '>' , '>' -> true
1079
- | _ -> false
0 commit comments