ocaml: phase 1/5/6 float arithmetic +./-./*./. (+5 tests, 372 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 27s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 27s
Tokenizer: +. -. *. /. (with -. avoiding clash with negative float literals). Parser table places dotted ops at int-precedence levels. Eval routes to host SX +/-/*//. HM types them Float->Float->Float; literal floats now infer as Float (was Int). OCaml-style 1.5 +. 2.5 : Float works end-to-end through tokenize + parse + eval + infer.
This commit is contained in:
@@ -294,6 +294,14 @@
|
||||
(cond
|
||||
((and (= c ";") (= c1 ";"))
|
||||
(begin (advance! 2) (push! "op" ";;" start) true))
|
||||
((and (= c "+") (= c1 "."))
|
||||
(begin (advance! 2) (push! "op" "+." start) true))
|
||||
((and (= c "-") (= c1 ".") (not (and (not (= c2 nil)) (ocaml-digit? c2))))
|
||||
(begin (advance! 2) (push! "op" "-." start) true))
|
||||
((and (= c "*") (= c1 "."))
|
||||
(begin (advance! 2) (push! "op" "*." start) true))
|
||||
((and (= c "/") (= c1 "."))
|
||||
(begin (advance! 2) (push! "op" "/." start) true))
|
||||
((and (= c "-") (= c1 ">"))
|
||||
(begin (advance! 2) (push! "op" "->" start) true))
|
||||
((and (= c "<") (= c1 "-"))
|
||||
|
||||
Reference in New Issue
Block a user