@@ -886,24 +886,30 @@ let rec scan scanner =
886886 | _ ->
887887 next scanner;
888888 Token. Plus )
889- | '>' -> (
889+ | '>' when not (in_diamond_mode scanner) -> (
890890 match peek scanner with
891- | '=' when not (in_diamond_mode scanner) ->
891+ | '=' ->
892892 next2 scanner;
893893 Token. GreaterEqual
894+ | '>' -> (
895+ match peek2 scanner with
896+ | '>' ->
897+ next3 scanner;
898+ Token. RightShiftUnsigned
899+ | _ ->
900+ next2 scanner;
901+ Token. RightShift )
894902 | _ ->
895903 next scanner;
896904 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
905908 | '<' when not (in_jsx_mode scanner) -> (
906909 match peek scanner with
910+ | '<' when not (in_diamond_mode scanner) ->
911+ next2 scanner;
912+ Token. LeftShift
907913 | '=' ->
908914 next2 scanner;
909915 Token. LessEqual
@@ -1054,26 +1060,3 @@ let is_binary_op src start_cnum end_cnum =
10541060 || is_whitespace (String. unsafe_get src end_cnum)
10551061 in
10561062 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