diff --git a/src/cold/lex_fan.ml b/src/cold/lex_fan.ml index a3684338..c7943a2b 100644 --- a/src/cold/lex_fan.ml +++ b/src/cold/lex_fan.ml @@ -288,12 +288,12 @@ let make_token low_keys = ((lexbuf.lex_mem).(24) <- lexbuf.lex_curr_pos; (lexbuf.lex_mem).(23) <- lexbuf.lex_curr_pos; (lexbuf.lex_mem).(22) <- lexbuf.lex_curr_pos; - __ocaml_lex_state132 ()) - | 123 -> __ocaml_lex_state131 () + __ocaml_lex_state133 ()) + | 123 -> __ocaml_lex_state132 () | 256 -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - | _ -> __ocaml_lex_state130 ()) + | _ -> __ocaml_lex_state131 ()) and __ocaml_lex_state4 () = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 23; @@ -316,10 +316,6 @@ let make_token low_keys = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 21; (match __ocaml_lex_next_char () with - | 64 -> - ((lexbuf.lex_mem).(20) <- lexbuf.lex_curr_pos; - __ocaml_lex_state108 ()) - | 123 -> __ocaml_lex_state105 () | 65 |66 |67 @@ -374,10 +370,7 @@ let make_token low_keys = |218 |219 |220|221|222 - -> __ocaml_lex_state107 () - | 33|38|42|43|45|47|58|60|61|62|63|92|94|124|126 -> - __ocaml_lex_state5 () - | 46 -> __ocaml_lex_state109 () + -> __ocaml_lex_state108 () | 95 |97 |98 @@ -438,10 +431,17 @@ let make_token low_keys = |254|255 -> ((lexbuf.lex_mem).(19) <- lexbuf.lex_curr_pos; - __ocaml_lex_state106 ()) + __ocaml_lex_state107 ()) + | 33|38|42|43|45|47|58|60|61|62|63|92|94|124|126 -> + __ocaml_lex_state5 () | 37 -> ((lexbuf.lex_mem).(7) <- lexbuf.lex_curr_pos; - __ocaml_lex_state110 ()) + __ocaml_lex_state111 ()) + | 64 -> + ((lexbuf.lex_mem).(20) <- lexbuf.lex_curr_pos; + __ocaml_lex_state109 ()) + | 123 -> __ocaml_lex_state106 () + | 46 -> __ocaml_lex_state110 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) @@ -450,7 +450,7 @@ let make_token low_keys = lexbuf.lex_last_action <- 17; (match __ocaml_lex_next_char () with | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> - __ocaml_lex_state104 () + __ocaml_lex_state105 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) @@ -524,7 +524,7 @@ let make_token low_keys = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 17; (match __ocaml_lex_next_char () with - | 46|62 -> __ocaml_lex_state17 () + | 46|62 -> __ocaml_lex_state104 () | 33|37|38|42|43|45|47|58|60|61|63|64|92|94|124|126 -> __ocaml_lex_state103 () | _ -> @@ -534,7 +534,8 @@ let make_token low_keys = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 17; (match __ocaml_lex_next_char () with - | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> + | 46 -> __ocaml_lex_state104 () + | 33|37|38|42|43|45|47|58|60|61|62|63|64|92|94|124|126 -> __ocaml_lex_state103 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; @@ -2357,24 +2358,30 @@ let make_token low_keys = lexbuf.lex_last_action)) and __ocaml_lex_state104 () = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; - lexbuf.lex_last_action <- 18; + lexbuf.lex_last_action <- 17; (match __ocaml_lex_next_char () with | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> - __ocaml_lex_state104 () + __ocaml_lex_state103 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) and __ocaml_lex_state105 () = + lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; + lexbuf.lex_last_action <- 18; + (match __ocaml_lex_next_char () with + | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> + __ocaml_lex_state105 () + | _ -> + (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; + lexbuf.lex_last_action)) + and __ocaml_lex_state106 () = (lexbuf.lex_mem).(4) <- (-1); (lexbuf.lex_mem).(3) <- (-1); (lexbuf.lex_mem).(1) <- (-1); 26 - and __ocaml_lex_state106 () = + and __ocaml_lex_state107 () = match __ocaml_lex_next_char () with - | 64 -> - ((lexbuf.lex_mem).(20) <- lexbuf.lex_curr_pos; - __ocaml_lex_state127 ()) - | 123 -> __ocaml_lex_state126 () + | 123 -> __ocaml_lex_state127 () | 39 |45 |48 @@ -2570,13 +2577,15 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(19) <- lexbuf.lex_curr_pos; - __ocaml_lex_state106 ()) + __ocaml_lex_state107 ()) + | 64 -> + ((lexbuf.lex_mem).(20) <- lexbuf.lex_curr_pos; + __ocaml_lex_state128 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state107 () = + and __ocaml_lex_state108 () = match __ocaml_lex_next_char () with - | 46 -> __ocaml_lex_state125 () | 39 |48 |49 @@ -2768,14 +2777,17 @@ let make_token low_keys = 253 | 254|255 - -> __ocaml_lex_state107 () + -> __ocaml_lex_state108 () + | 46 -> __ocaml_lex_state126 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state108 () = + and __ocaml_lex_state109 () = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 21; (match __ocaml_lex_next_char () with + | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> + __ocaml_lex_state5 () | 65 |66 |67 @@ -2948,13 +2960,11 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(21) <- lexbuf.lex_curr_pos; - __ocaml_lex_state123 ()) - | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> - __ocaml_lex_state5 () + __ocaml_lex_state124 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) - and __ocaml_lex_state109 () = + and __ocaml_lex_state110 () = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 21; (match __ocaml_lex_next_char () with @@ -3012,9 +3022,7 @@ let make_token low_keys = |218 |219 |220|221|222 - -> __ocaml_lex_state107 () - | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> - __ocaml_lex_state5 () + -> __ocaml_lex_state108 () | 95 |97 |98 @@ -3075,14 +3083,20 @@ let make_token low_keys = |254|255 -> ((lexbuf.lex_mem).(19) <- lexbuf.lex_curr_pos; - __ocaml_lex_state106 ()) + __ocaml_lex_state107 ()) + | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> + __ocaml_lex_state5 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) - and __ocaml_lex_state110 () = + and __ocaml_lex_state111 () = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 21; (match __ocaml_lex_next_char () with + | 123 -> __ocaml_lex_state112 () + | 46 -> __ocaml_lex_state116 () + | 33|37|38|42|43|45|47|58|60|61|62|63|92|94|124|126 -> + __ocaml_lex_state5 () | 95 |97 |98 @@ -3143,10 +3157,7 @@ let make_token low_keys = |254|255 -> ((lexbuf.lex_mem).(19) <- lexbuf.lex_curr_pos; - __ocaml_lex_state112 ()) - | 33|37|38|42|43|45|47|58|60|61|62|63|92|94|124|126 -> - __ocaml_lex_state5 () - | 123 -> __ocaml_lex_state111 () + __ocaml_lex_state113 ()) | 65 |66 |67 @@ -3201,20 +3212,19 @@ let make_token low_keys = |218 |219 |220|221|222 - -> __ocaml_lex_state113 () + -> __ocaml_lex_state114 () | 64 -> ((lexbuf.lex_mem).(20) <- lexbuf.lex_curr_pos; - __ocaml_lex_state114 ()) - | 46 -> __ocaml_lex_state115 () + __ocaml_lex_state115 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) - and __ocaml_lex_state111 () = + and __ocaml_lex_state112 () = (lexbuf.lex_mem).(3) <- (-1); (lexbuf.lex_mem).(1) <- (-1); (lexbuf.lex_mem).(4) <- (lexbuf.lex_mem).(5); 26 - and __ocaml_lex_state112 () = + and __ocaml_lex_state113 () = match __ocaml_lex_next_char () with | 39 |45 @@ -3411,17 +3421,17 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(19) <- lexbuf.lex_curr_pos; - __ocaml_lex_state112 ()) - | 123 -> __ocaml_lex_state119 () + __ocaml_lex_state113 ()) | 64 -> ((lexbuf.lex_mem).(20) <- lexbuf.lex_curr_pos; - __ocaml_lex_state120 ()) + __ocaml_lex_state121 ()) + | 123 -> __ocaml_lex_state120 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state113 () = + and __ocaml_lex_state114 () = match __ocaml_lex_next_char () with - | 46 -> __ocaml_lex_state118 () + | 46 -> __ocaml_lex_state119 () | 39 |48 |49 @@ -3613,14 +3623,16 @@ let make_token low_keys = 253 | 254|255 - -> __ocaml_lex_state113 () + -> __ocaml_lex_state114 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state114 () = + and __ocaml_lex_state115 () = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 21; (match __ocaml_lex_next_char () with + | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> + __ocaml_lex_state5 () | 65 |66 |67 @@ -3793,16 +3805,16 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(21) <- lexbuf.lex_curr_pos; - __ocaml_lex_state116 ()) - | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> - __ocaml_lex_state5 () + __ocaml_lex_state117 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) - and __ocaml_lex_state115 () = + and __ocaml_lex_state116 () = lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 21; (match __ocaml_lex_next_char () with + | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> + __ocaml_lex_state5 () | 95 |97 |98 @@ -3863,9 +3875,7 @@ let make_token low_keys = |254|255 -> ((lexbuf.lex_mem).(19) <- lexbuf.lex_curr_pos; - __ocaml_lex_state112 ()) - | 33|37|38|42|43|45|46|47|58|60|61|62|63|64|92|94|124|126 -> - __ocaml_lex_state5 () + __ocaml_lex_state113 ()) | 65 |66 |67 @@ -3920,12 +3930,13 @@ let make_token low_keys = |218 |219 |220|221|222 - -> __ocaml_lex_state113 () + -> __ocaml_lex_state114 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) - and __ocaml_lex_state116 () = + and __ocaml_lex_state117 () = match __ocaml_lex_next_char () with + | 123 -> __ocaml_lex_state118 () | 39 |48 |49 @@ -4119,18 +4130,17 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(21) <- lexbuf.lex_curr_pos; - __ocaml_lex_state116 ()) - | 123 -> __ocaml_lex_state117 () + __ocaml_lex_state117 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state117 () = + and __ocaml_lex_state118 () = (lexbuf.lex_mem).(3) <- (-1); (lexbuf.lex_mem).(4) <- (lexbuf.lex_mem).(5); (lexbuf.lex_mem).(1) <- (lexbuf.lex_mem).(20); (lexbuf.lex_mem).(0) <- (lexbuf.lex_mem).(21); 26 - and __ocaml_lex_state118 () = + and __ocaml_lex_state119 () = match __ocaml_lex_next_char () with | 95 |97 @@ -4191,7 +4201,7 @@ let make_token low_keys = |253|254|255 -> ((lexbuf.lex_mem).(19) <- lexbuf.lex_curr_pos; - __ocaml_lex_state112 ()) + __ocaml_lex_state113 ()) | 65 |66 |67 @@ -4245,17 +4255,17 @@ let make_token low_keys = |217 |218 |219|220|221|222 - -> __ocaml_lex_state113 () + -> __ocaml_lex_state114 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state119 () = + and __ocaml_lex_state120 () = (lexbuf.lex_mem).(1) <- (-1); (lexbuf.lex_mem).(4) <- (lexbuf.lex_mem).(5); (lexbuf.lex_mem).(3) <- (lexbuf.lex_mem).(7); (lexbuf.lex_mem).(2) <- (lexbuf.lex_mem).(19); 26 - and __ocaml_lex_state120 () = + and __ocaml_lex_state121 () = match __ocaml_lex_next_char () with | 65 |66 @@ -4428,13 +4438,13 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(21) <- lexbuf.lex_curr_pos; - __ocaml_lex_state121 ()) + __ocaml_lex_state122 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state121 () = + and __ocaml_lex_state122 () = match __ocaml_lex_next_char () with - | 123 -> __ocaml_lex_state122 () + | 123 -> __ocaml_lex_state123 () | 39 |48 |49 @@ -4628,19 +4638,20 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(21) <- lexbuf.lex_curr_pos; - __ocaml_lex_state121 ()) + __ocaml_lex_state122 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state122 () = + and __ocaml_lex_state123 () = (lexbuf.lex_mem).(4) <- (lexbuf.lex_mem).(5); (lexbuf.lex_mem).(3) <- (lexbuf.lex_mem).(7); (lexbuf.lex_mem).(2) <- (lexbuf.lex_mem).(19); (lexbuf.lex_mem).(1) <- (lexbuf.lex_mem).(20); (lexbuf.lex_mem).(0) <- (lexbuf.lex_mem).(21); 26 - and __ocaml_lex_state123 () = + and __ocaml_lex_state124 () = match __ocaml_lex_next_char () with + | 123 -> __ocaml_lex_state125 () | 39 |48 |49 @@ -4834,18 +4845,17 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(21) <- lexbuf.lex_curr_pos; - __ocaml_lex_state123 ()) - | 123 -> __ocaml_lex_state124 () + __ocaml_lex_state124 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state124 () = + and __ocaml_lex_state125 () = (lexbuf.lex_mem).(4) <- (-1); (lexbuf.lex_mem).(3) <- (-1); (lexbuf.lex_mem).(1) <- (lexbuf.lex_mem).(20); (lexbuf.lex_mem).(0) <- (lexbuf.lex_mem).(21); 26 - and __ocaml_lex_state125 () = + and __ocaml_lex_state126 () = match __ocaml_lex_next_char () with | 65 |66 @@ -4900,7 +4910,7 @@ let make_token low_keys = |217 |218 |219|220|221|222 - -> __ocaml_lex_state107 () + -> __ocaml_lex_state108 () | 95 |97 |98 @@ -4960,17 +4970,17 @@ let make_token low_keys = |253|254|255 -> ((lexbuf.lex_mem).(19) <- lexbuf.lex_curr_pos; - __ocaml_lex_state106 ()) + __ocaml_lex_state107 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state126 () = + and __ocaml_lex_state127 () = (lexbuf.lex_mem).(4) <- (-1); (lexbuf.lex_mem).(1) <- (-1); (lexbuf.lex_mem).(3) <- (lexbuf.lex_mem).(7); (lexbuf.lex_mem).(2) <- (lexbuf.lex_mem).(19); 26 - and __ocaml_lex_state127 () = + and __ocaml_lex_state128 () = match __ocaml_lex_next_char () with | 65 |66 @@ -5143,13 +5153,12 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(21) <- lexbuf.lex_curr_pos; - __ocaml_lex_state128 ()) + __ocaml_lex_state129 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state128 () = + and __ocaml_lex_state129 () = match __ocaml_lex_next_char () with - | 123 -> __ocaml_lex_state129 () | 39 |48 |49 @@ -5343,27 +5352,27 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(21) <- lexbuf.lex_curr_pos; - __ocaml_lex_state128 ()) + __ocaml_lex_state129 ()) + | 123 -> __ocaml_lex_state130 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state129 () = + and __ocaml_lex_state130 () = (lexbuf.lex_mem).(4) <- (-1); (lexbuf.lex_mem).(3) <- (lexbuf.lex_mem).(7); (lexbuf.lex_mem).(2) <- (lexbuf.lex_mem).(19); (lexbuf.lex_mem).(1) <- (lexbuf.lex_mem).(20); (lexbuf.lex_mem).(0) <- (lexbuf.lex_mem).(21); 26 - and __ocaml_lex_state130 () = 30 - and __ocaml_lex_state131 () = (lexbuf.lex_mem).(1) <- (-1); 29 - and __ocaml_lex_state132 () = + and __ocaml_lex_state131 () = 30 + and __ocaml_lex_state132 () = (lexbuf.lex_mem).(1) <- (-1); 29 + and __ocaml_lex_state133 () = (lexbuf.lex_mem).(2) <- (-1); (lexbuf.lex_mem).(0) <- (lexbuf.lex_mem).(22); lexbuf.lex_last_pos <- lexbuf.lex_curr_pos; lexbuf.lex_last_action <- 28; (match __ocaml_lex_next_char () with - | 58 -> __ocaml_lex_state134 () - | 123 -> __ocaml_lex_state133 () + | 123 -> __ocaml_lex_state134 () | 39 |48 |49 @@ -5560,15 +5569,16 @@ let make_token low_keys = ((lexbuf.lex_mem).(24) <- lexbuf.lex_curr_pos; (lexbuf.lex_mem).(22) <- lexbuf.lex_curr_pos; (lexbuf.lex_mem).(23) <- lexbuf.lex_curr_pos; - __ocaml_lex_state132 ()) + __ocaml_lex_state133 ()) + | 58 -> __ocaml_lex_state135 () | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) - and __ocaml_lex_state133 () = + and __ocaml_lex_state134 () = (lexbuf.lex_mem).(1) <- (lexbuf.lex_mem).(6); (lexbuf.lex_mem).(0) <- (lexbuf.lex_mem).(24); 29 - and __ocaml_lex_state134 () = + and __ocaml_lex_state135 () = match __ocaml_lex_next_char () with | 39 |48 @@ -5763,11 +5773,11 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(25) <- lexbuf.lex_curr_pos; - __ocaml_lex_state135 ()) + __ocaml_lex_state136 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action) - and __ocaml_lex_state135 () = + and __ocaml_lex_state136 () = (lexbuf.lex_mem).(0) <- (lexbuf.lex_mem).(22); (lexbuf.lex_mem).(2) <- (lexbuf.lex_mem).(23); (lexbuf.lex_mem).(1) <- (lexbuf.lex_mem).(25); @@ -5968,7 +5978,7 @@ let make_token low_keys = 254|255 -> ((lexbuf.lex_mem).(25) <- lexbuf.lex_curr_pos; - __ocaml_lex_state135 ()) + __ocaml_lex_state136 ()) | _ -> (lexbuf.lex_curr_pos <- lexbuf.lex_last_pos; lexbuf.lex_last_action)) in diff --git a/src/cold/parse_fan.ml b/src/cold/parse_fan.ml index 9fc317aa..350d9366 100644 --- a/src/cold/parse_fan.ml +++ b/src/cold/parse_fan.ml @@ -125,12 +125,14 @@ let _ = List.iter (make_key exp 30 ~left:false) ["or"; "||"]; List.iter (make_key exp 40 ~left:false) ["&"; "&&"]; List.iter (make_key exp 50 ~left:true) ["=="; "="; "<"; ">"]; - List.iter (make_key exp 80 ~left:true) ["+"; "-"; "-."]; + List.iter (make_key exp 80 ~left:true) ["+"; "-"; "-."; "+."]; + List.iter (make_key exp 90 ~left:true) ["*"; "/"; "%"]; + List.iter (make_key exp 100 ~left:false) ["**"]; make_infix exp transform 0; make_infix ~left:false exp transform 1; make_infix exp transform 2; make_infix exp transform 3; - make_infix exp transform 4 + make_infix ~left:false exp transform 4 let make_case exp pat = let pat_as_pat_opt: 'pat_as_pat_opt Gramf.t = Gramf.mk "pat_as_pat_opt" in Gramf.extend_single @@ -7350,6 +7352,34 @@ let apply () = Tokenf.txt -> Locf.t -> 'exp )) + }; + { + symbols = + [Token + ({ + descr = + { tag = `Key; word = (A "+"); tag_name = "Key" } + } : Tokenf.pattern ); + Self]; + annot = "e\n"; + fn = + (Gramf.mk_action + (fun (e : 'exp) _ (_loc : Locf.t) -> (e : 'exp ) : + 'exp -> Tokenf.txt -> Locf.t -> 'exp )) + }; + { + symbols = + [Token + ({ + descr = + { tag = `Key; word = (A "+."); tag_name = "Key" } + } : Tokenf.pattern ); + Self]; + annot = "e\n"; + fn = + (Gramf.mk_action + (fun (e : 'exp) _ (_loc : Locf.t) -> (e : 'exp ) : + 'exp -> Tokenf.txt -> Locf.t -> 'exp )) }] } : Gramf.olevel ) } : _ Gramf.single_extend_statement ); diff --git a/src/main/lex_fan.ml b/src/main/lex_fan.ml index fb12ef9e..1146347a 100644 --- a/src/main/lex_fan.ml +++ b/src/main/lex_fan.ml @@ -73,7 +73,7 @@ let make_token low_keys = |"lsl"|"lsr"|"asr" as txt) ocaml_blank* ')' %{ `Lid {loc = !! lexbuf;txt}} | @kwd_symbol( "&&" | "#" | "`" | "'" | "," | "." | ".." | ":" | "::"|"+"|"-" - | ":=" | ":>" | ";" | ";;" | "{"|"}" |"-." + | ":=" | ":>" | ";" | ";;" | "{"|"}" |"-."|"+." | "{<" |">}" | "(" | "[|" | "[" | "[<" | "[=" | "[>" | ")" | "|]" | "]" | ">]" diff --git a/src/main/parse_fan.ml b/src/main/parse_fan.ml index 9ccf05e9..feedb298 100644 --- a/src/main/parse_fan.ml +++ b/src/main/parse_fan.ml @@ -64,12 +64,14 @@ let _ = List.iter (make_key exp 30 ~left:false) ["or"; "||"]; List.iter (make_key exp 40 ~left:false) ["&";"&&"]; List.iter (make_key exp 50 ~left:true) ["==";"=";"<";">"]; - List.iter (make_key exp 80 ~left:true) ["+";"-";"-."]; + List.iter (make_key exp 80 ~left:true) ["+";"-";"-.";"+."]; + List.iter (make_key exp 90 ~left:true) ["*";"/";"%"]; + List.iter (make_key exp 100 ~left:false) ["**"]; make_infix exp transform 0; make_infix ~left:false exp transform 1; make_infix exp transform 2; make_infix exp transform 3; - make_infix exp transform 4; + make_infix ~left:false exp transform 4; end let make_case exp pat = @@ -627,6 +629,7 @@ let apply () = begin ] exp : 120 [ ("-"|"-." as x); S as e %{ Fan_ops.mkumin _loc x e} (* Delayed into Dump *) + | ("+"|"+."); S as e %{ e} ] exp : 130 [ S as e1; S as e2 %{ `App(_loc,e1,e2)}