Stabel

Check-in [8e6b3144ac]
Login
Overview
Comment:Work around known bug in elm/parser which caused line numbers to be inaccurate in the presense of line comments. Fixes [19d3c0453f].
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8e6b3144ace17fcf3c0cb8932a89cbee6f69068f39025db92a366bbef35870c5
User & Date: robin.hansen on 2021-08-05 17:56:46
Other Links: manifest | tags
Context
2021-08-05
18:02
Remove dead function in Data/SourceLocation. Use explicit exports in Parser/SourceLocation. check-in: d64aee902c user: robin.hansen tags: trunk
17:56
Work around known bug in elm/parser which caused line numbers to be inaccurate in the presense of li... check-in: 8e6b3144ac user: robin.hansen tags: trunk
15:11
Report _first_ qualifier errors. The last ones have dodgy quality as they fail because of missing fu... check-in: d493a51f84 user: robin.hansen tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified src/CLI.elm from [6f69b63ea9] to [790a55203e].

240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
        ]


encodeCompilationFailure : String -> Json.Value
encodeCompilationFailure errorMsg =
    Encode.object
        [ ( "type", Encode.string "compilationFailure" )
        , ( "error", Encode.string (errorMsg ++ "\n\n") )
        ]


encodeReadFilesToReportError : List String -> Json.Value
encodeReadFilesToReportError files =
    Encode.object
        [ ( "type", Encode.string "readFilesToReportError" )







|







240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
        ]


encodeCompilationFailure : String -> Json.Value
encodeCompilationFailure errorMsg =
    Encode.object
        [ ( "type", Encode.string "compilationFailure" )
        , ( "error", Encode.string ("\n" ++ errorMsg ++ "\n") )
        ]


encodeReadFilesToReportError : List String -> Json.Value
encodeReadFilesToReportError files =
    Encode.object
        [ ( "type", Encode.string "readFilesToReportError" )

Modified src/Stabel/Parser.elm from [95f8e31db8] to [3686af24e9].

410
411
412
413
414
415
416
417

418
419
420
421
422
423
424
    Parser.loop () noiseParserLoop


noiseParserLoop : () -> Parser (Parser.Step () ())
noiseParserLoop _ =
    Parser.oneOf
        [ Parser.succeed (Parser.Loop ())
            |. Parser.lineComment (Token "#" UnknownError)

        , Parser.succeed (Parser.Loop ())
            |. Parser.chompIf (\c -> Set.member c whitespaceChars) ExpectedWhitespace
            |. Parser.chompWhile (\c -> Set.member c whitespaceChars)
        , Parser.succeed (Parser.Done ())
        ]









|
>







410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
    Parser.loop () noiseParserLoop


noiseParserLoop : () -> Parser (Parser.Step () ())
noiseParserLoop _ =
    Parser.oneOf
        [ Parser.succeed (Parser.Loop ())
            |. Parser.symbol (Token "#" UnknownError)
            |. Parser.chompWhile (\c -> c /= '\n')
        , Parser.succeed (Parser.Loop ())
            |. Parser.chompIf (\c -> Set.member c whitespaceChars) ExpectedWhitespace
            |. Parser.chompWhile (\c -> Set.member c whitespaceChars)
        , Parser.succeed (Parser.Done ())
        ]