Bogdanp / elm-ast

A parser for Elm in Elm.
http://bogdanp.github.io/elm-ast/example/
BSD 3-Clause "New" or "Revised" License
143 stars 21 forks source link

Comments may cause parsing failure #92

Closed muelli closed 6 years ago

muelli commented 6 years ago

I'm coming from https://github.com/dillonkearns/elm-typescript-interop/issues/3 and it seems that the elm-ast package fails to parse

port module Main exposing (..)

init location =
    let
        currentRoute =
            Routing.parseLocation location
    in
        --( initialModel currentRoute, fetchUser )
        ( initialModel currentRoute, Cmd.batch
                                            [ check "yo"
                                            , fetchUser
                                            ]  )

with

Err ((),{ data = "port module Main exposing (..)\n\n\ninit location =\n let\n currentRoute =\n Routing.parseLocation location\n in\n --( initialModel currentRoute, fetchUser )\n ( initialModel currentRoute, Cmd.batch\n [ check \"yo\"\n , fetchUser\n ] )\n\n", input = "init location =\n let\n currentRoute =\n Routing.parseLocation location\n in\n --( initialModel currentRoute, fetchUser )\n ( initialModel currentRoute, Cmd.batch\n [ check \"yo\"\n , fetchUser\n ] )\n\n", position = 33 },["expected end of input"])
wende commented 6 years ago

Duplicate of #41