We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build and run the following:
module Main exposing (..) import Browser import Html exposing (Html) import Html.Attributes import Parser exposing ((|.), (|=), Parser) commentByItself : String commentByItself = "/*abc*/" commentWithTrailingText : String commentWithTrailingText = "/*abc*/def" nestable : Parser () nestable = Parser.multiComment "/*" "*/" Parser.Nestable |. Parser.end notNestable : Parser () notNestable = Parser.multiComment "/*" "*/" Parser.NotNestable |. Parser.end notNestableWorkaround : Parser () notNestableWorkaround = Parser.multiComment "/*" "*/" Parser.NotNestable |. Parser.token "*/" |. Parser.end chompUntil : Parser () chompUntil = Parser.token "/*" |. Parser.chompUntil "*/" |. Parser.end chompUntilWorkaround : Parser () chompUntilWorkaround = Parser.token "/*" |. Parser.chompUntil "*/" |. Parser.token "*/" |. Parser.end main : Program () () () main = Browser.staticPage <| Html.table [ Html.Attributes.style "border-collapse" "collapse" ] [ Html.tr [] [ Html.th borderAttributes [ Html.text "Parser" ] , Html.th borderAttributes [ Html.text commentByItself ] , Html.th borderAttributes [ Html.text commentWithTrailingText ] ] , exampleRow "nestable" nestable , exampleRow "notNestable" notNestable , exampleRow "notNestableWorkaround" notNestableWorkaround , exampleRow "chompUntil" chompUntil , exampleRow "chompUntilWorkaround" chompUntilWorkaround ] exampleRow : String -> Parser () -> Html msg exampleRow name parser = Html.tr [] [ Html.td borderAttributes [ Html.text name ] , Html.td borderAttributes [ Html.text <| Debug.toString (Parser.run parser commentByItself) ] , Html.td borderAttributes [ Html.text <| Debug.toString (Parser.run parser commentWithTrailingText) ] ] borderAttributes : List (Html.Attribute msg) borderAttributes = [ Html.Attributes.style "border" "1px solid black" ]
You should see
which has a couple issues:
nestable
notNestable
chompUntil
|. Parser.token "*/"
"/*abc*/def"
I think the expected results should be:
I'm on Windows 10.
The text was updated successfully, but these errors were encountered:
Parser.multiComment
NotNestable
Successfully merging a pull request may close this issue.
Build and run the following:
You should see
which has a couple issues:
nestable
works as expected,notNestable
andchompUntil
do not|. Parser.token "*/"
tonotNestable
'fixes' the issue, but produces an incorrect error column number for the"/*abc*/def"
caseI think the expected results should be:
I'm on Windows 10.
The text was updated successfully, but these errors were encountered: