Give better errors for code corrupted by Unicode smart quotes (#21843)
Previously, we emitted a generic and potentially confusing error during lexical analysis on programs containing smart quotes (“/”/‘/’). This commit adds smart quote-aware lexer errors.
Showing
- compiler/GHC/Parser/Errors/Ppr.hs 12 additions, 0 deletionscompiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs 5 additions, 0 deletionscompiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x 81 additions, 16 deletionscompiler/GHC/Parser/Lexer.x
- compiler/GHC/Types/Error/Codes.hs 1 addition, 0 deletionscompiler/GHC/Types/Error/Codes.hs
- testsuite/tests/parser/should_fail/T21843a.hs 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843a.hs
- testsuite/tests/parser/should_fail/T21843a.stderr 4 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843a.stderr
- testsuite/tests/parser/should_fail/T21843b.hs 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843b.hs
- testsuite/tests/parser/should_fail/T21843b.stderr 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843b.stderr
- testsuite/tests/parser/should_fail/T21843c.hs 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843c.hs
- testsuite/tests/parser/should_fail/T21843c.stderr 6 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843c.stderr
- testsuite/tests/parser/should_fail/T21843d.hs 4 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843d.hs
- testsuite/tests/parser/should_fail/T21843d.stderr 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843d.stderr
- testsuite/tests/parser/should_fail/T21843e.hs 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843e.hs
- testsuite/tests/parser/should_fail/T21843e.stderr 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843e.stderr
- testsuite/tests/parser/should_fail/T21843f.hs 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843f.hs
- testsuite/tests/parser/should_fail/T21843f.stderr 3 additions, 0 deletionstestsuite/tests/parser/should_fail/T21843f.stderr
- testsuite/tests/parser/should_fail/all.T 6 additions, 0 deletionstestsuite/tests/parser/should_fail/all.T
Loading
Please register or sign in to comment