ParseErrorNumberFractionThenLetterTest
Tags:elm19-compile-errorelm-spec
Checks, in A Standard Definition of Elm?:restriction core-constant-separated
Not translated into Lean for the mechanisation of the book: see why.
A float literal followed directly by a letter, `1.5a`, is rejected with a WEIRD NUMBER syntax error.
Results
elm-0.19.1
passOutput
Compiling ...-- WEIRD NUMBER ----------------- src/ParseErrorNumberFractionThenLetterTest.elm
I thought I was reading a number, but I ran into some weird stuff here:
12| 1.5a
^
I recognize numbers in the following formats:
42
3.14
6.022e23
0x002B
So is there a way to write it like one of those?
Detected problems in 1 module.
elm-0.19.2
passOutput
Compiling ...-- WEIRD NUMBER ----------------- src/ParseErrorNumberFractionThenLetterTest.elm
I thought I was reading a number, but I ran into some weird stuff here:
12| 1.5a
^
I recognize numbers in the following formats:
42
3.14
6.022e23
0x002B
So is there a way to write it like one of those?
Detected problems in 1 module.
elm-0.19.3
passOutput
Compiling ...-- WEIRD NUMBER ----------------- src/ParseErrorNumberFractionThenLetterTest.elm
I thought I was reading a number, but I ran into some weird stuff here:
12| 1.5a
^
I recognize numbers in the following formats:
42
3.14
6.022e23
0x002B
So is there a way to write it like one of those?
Detected problems in 1 module.
lamdera-1.5.0
passOutput
Detected problems in 1 module.
-- WEIRD NUMBER ----------------- src/ParseErrorNumberFractionThenLetterTest.elm
I thought I was reading a number, but I ran into some weird stuff here:
12| 1.5a
^
I recognize numbers in the following formats:
42
3.14
6.022e23
0x002B
So is there a way to write it like one of those?
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm/ParseErrorNumberFractionThenLetterTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ParseErrorNumberFractionThenLetterTest exposing (..)
{-| A float literal followed directly by a letter, `1.5a`, is rejected with a WEIRD NUMBER syntax error.
-}
-- TAGS: elm19-compile-error
-- TAGS: elm-spec, core-constant-separated
-- COMPILE-ERROR: WEIRD NUMBER
-- CHECK: -- WEIRD NUMBER -
x =
1.5a
Lean translation
No reduced program for Lean's evaluator: the test expects a compile error, so it has no meaning to evaluate. Static semantics: expected to be rejected, and eco's parser rejects it too. See the Lean mechanisation for which tests are in Lean, and why.