Lexer: report indentation warnings at column 1
We use a Latin1 generated parser with Alex, but we also parses Unicode BOM, unbreakable spaces, etc. In recent Alex, the reported column isn't expressed in Unicode chars anymore but in bytes/ASCII chars (probably due to https://github.com/haskell/alex/commit/ae525e34edf017544e8ef4457d7e57cf2081dcf9 but I haven't checked), which broke our tests (see https://github.com/haskell/cabal/pull/8896). To work around this we report indentation warnings at token start position, instead of token end position (i.e. always 1). Otherwise position makes no sense anymore for the user.
Showing
- Cabal-syntax/src/Distribution/Fields/Lexer.hs 13 additions, 13 deletionsCabal-syntax/src/Distribution/Fields/Lexer.hs
- Cabal-syntax/src/Distribution/Fields/LexerMonad.hs 6 additions, 0 deletionsCabal-syntax/src/Distribution/Fields/LexerMonad.hs
- Cabal-tests/tests/ParserTests/regressions/Octree-0.5.format 1 addition, 1 deletionCabal-tests/tests/ParserTests/regressions/Octree-0.5.format
- Cabal-tests/tests/ParserTests/regressions/monad-param.format 1 addition, 1 deletionCabal-tests/tests/ParserTests/regressions/monad-param.format
- Cabal-tests/tests/ParserTests/regressions/th-lift-instances.format 1 addition, 1 deletion...ts/tests/ParserTests/regressions/th-lift-instances.format
- cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out 1 addition, 1 deletion...l-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out
- templates/Lexer.x 13 additions, 13 deletionstemplates/Lexer.x
Loading