InfixNoSectionRightTest
Tags:elm-spec
Checks, in A Standard Definition of Elm?:figure core-grammar-expressions
Not translated into Lean for the mechanisation of the book: see why.
`(+ 1)` is not an expression: Elm has no operator sections. A Standard Definition of Elm?, Section 2.7: an operator value `(op)` is the only way to use an operator other than in a chain; there are no sections. The grammar of expressions has no phrase for one. <https://elm-test-suite.netlify.app/standard/figures/core-grammar-expressions>
Results
elm-0.19.1
passOutput
Compiling ...-- UNFINISHED OPERATOR FUNCTION ---------------- src/InfixNoSectionRightTest.elm
I was expecting a closing parenthesis here:
22| Debug.log "section" ((+ 1) 2)
^
Try adding a ) to see if that helps!
Note: I think I am parsing an operator function right now, so I am expecting to
see something like (+) or (&&) where an operator is surrounded by parentheses
with no extra spaces.
Detected problems in 1 module.
elm-0.19.2
passOutput
Compiling ...-- UNFINISHED OPERATOR FUNCTION ---------------- src/InfixNoSectionRightTest.elm
I was expecting a closing parenthesis here:
22| Debug.log "section" ((+ 1) 2)
^
Try adding a ) to see if that helps!
Note: I think I am parsing an operator function right now, so I am expecting to
see something like (+) or (&&) where an operator is surrounded by parentheses
with no extra spaces.
Detected problems in 1 module.
elm-0.19.3
passOutput
Compiling ...-- UNFINISHED OPERATOR FUNCTION ---------------- src/InfixNoSectionRightTest.elm
I was expecting a closing parenthesis here:
22| Debug.log "section" ((+ 1) 2)
^
Try adding a ) to see if that helps!
Note: I think I am parsing an operator function right now, so I am expecting to
see something like (+) or (&&) where an operator is surrounded by parentheses
with no extra spaces.
Detected problems in 1 module.
lamdera-1.5.0
passOutput
Detected problems in 1 module.
-- UNFINISHED OPERATOR FUNCTION ---------------- src/InfixNoSectionRightTest.elm
I was expecting a closing parenthesis here:
22| Debug.log "section" ((+ 1) 2)
^
Try adding a ) to see if that helps!
Note: I think I am parsing an operator function right now, so I am expecting to
see something like (+) or (&&) where an operator is surrounded by parentheses
with no extra spaces.
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm/InfixNoSectionRightTest] in its title.
Source
The -- CHECK: lines give the expected output.
module InfixNoSectionRightTest exposing (main)
{-| `(+ 1)` is not an expression: Elm has no operator sections.
A Standard Definition of Elm?, Section 2.7: an operator value `(op)` is the only way to use an
operator other than in a chain; there are no sections. The grammar of expressions has no
phrase for one. <https://elm-test-suite.netlify.app/standard/figures/core-grammar-expressions>
-}
-- TAGS: elm-spec, fig:core-grammar-expressions
-- COMPILE-ERROR: an operator section with its right operand
-- CHECK: {{-- [A-Z ]+ -}}
-- CHECK-NOT: TYPE MISMATCH
import Html
main =
let
_ =
Debug.log "section" ((+ 1) 2)
in
Html.text "done"
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.