leostera / caramel

:candy: a functional language for building type-safe, scalable, and maintainable applications
https://caramel.run
Apache License 2.0
1.05k stars 25 forks source link

Support OCaml style floating point syntax without trailing numbers after dot #55

Closed michallepicki closed 3 years ago

michallepicki commented 3 years ago

Currently this Caramel code compiles:

let main _ =
  42.

to this Erlang:

% Source code generated with Caramel.
-module(main).

-export([main/1]).

-spec main(_) -> float().
main(_) -> 42..

Erlang compilation fails with:

main.erl:6: syntax error before: '..'

This should either: a) compile to 42.0 in Erlang b) or print a helpful error when compiling Caramel

Caramel 0.1, Erlang 23.2.2