Elm Exactly
Results / elm-parser /

ParserIssue2MultiCommentNotNestableTest

Tags:elm19-bug

elm-0.19.1 failelm-0.19.2 failelm-0.19.3 faillamdera-1.5.0 fail

Issue: elm/parser#2

`multiComment "/*" "*/" NotNestable` does not consume the closing `*/`.

<https://github.com/elm/parser/issues/2>

Elm 0.19.1 (elm/parser 1.1.0) fails `multiComment "/*" "*/" NotNestable |. end` on `"/*abc*/"`
with ExpectingEnd, because the parser's offset stops before `*/` (its row and column do move past
it). `Nestable` mode handles the same input. The whole comment must be consumed.

Results

elm-0.19.1

failran in 72 ms
Missing pattern: notNestable: Ok ()
--- output ---
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
notNestable: Err [{ col = 8, problem = ExpectingEnd, row = 1 }]
nestable: Ok ()

elm-0.19.2

failran in 53 ms
Missing pattern: notNestable: Ok ()
--- output ---
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
notNestable: Err [{ col = 8, problem = ExpectingEnd, row = 1 }]
nestable: Ok ()

elm-0.19.3

failran in 48 ms
Missing pattern: notNestable: Ok ()
--- output ---
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
notNestable: Err [{ col = 8, row = 1, problem = ExpectingEnd }]
nestable: Ok ()

lamdera-1.5.0

failran in 60 ms
Missing pattern: notNestable: Ok ()
--- output ---
notNestable: Err [{ col = 8, row = 1, problem = ExpectingEnd }]
nestable: Ok ()

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm-parser/ParserIssue2MultiCommentNotNestableTest] in its title.

Source

The -- CHECK: lines give the expected output.

module ParserIssue2MultiCommentNotNestableTest exposing (main)
{-| `multiComment "/*" "*/" NotNestable` does not consume the closing `*/`.
<https://github.com/elm/parser/issues/2>
Elm 0.19.1 (elm/parser 1.1.0) fails `multiComment "/*" "*/" NotNestable |. end` on `"/*abc*/"`
with ExpectingEnd, because the parser's offset stops before `*/` (its row and column do move past
it). `Nestable` mode handles the same input. The whole comment must be consumed.
-}
-- TAGS: elm19-bug
-- CHECK: notNestable: Ok ()
-- CHECK: nestable: Ok ()
import Html exposing (text)
import Parser exposing ((|.), Nestable(..))
main =
let
_ =
Debug.log "notNestable" (Parser.run (Parser.multiComment "/*" "*/" NotNestable |. Parser.end) "/*abc*/")
_ =
Debug.log "nestable" (Parser.run (Parser.multiComment "/*" "*/" Nestable |. Parser.end) "/*abc*/")
in
text "done"