Skip to content

Commit d2b44d8

Browse files
authored
flambda-backend: A + sign usually means Positive (#1536)
A + sign usually means Positive.
1 parent d1644f9 commit d2b44d8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

parsing/parser.mly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4031,7 +4031,7 @@ signed_constant:
40314031
| PLUS FLOAT { let (f, m) = $2 in
40324032
Constant.value (Pconst_float(f, m)) }
40334033
| PLUS HASH_INT { unboxed_int $sloc $loc($2) Positive $2 }
4034-
| PLUS HASH_FLOAT { unboxed_float $sloc Negative $2 }
4034+
| PLUS HASH_FLOAT { unboxed_float $sloc Positive $2 }
40354035
;
40364036

40374037
/* Identifiers and long identifiers */

testsuite/tests/typing-layouts/unboxed_floats.ml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,19 @@ Line 4, characters 6-9:
4444
^^^
4545
Error: Unbound value add
4646
|}];;
47+
48+
let x = #3.0
49+
let x = +#3.0
50+
let x = -#3.0
51+
52+
let x = #3L
53+
let x = +#3L
54+
let x = -#3L
55+
56+
[%%expect{|
57+
Line 1, characters 8-12:
58+
1 | let x = #3.0
59+
^^^^
60+
Error: Unboxed float literals aren't supported yet.
61+
|}]
62+

0 commit comments

Comments
 (0)