This repository has been archived by the owner on Sep 8, 2023. It is now read-only.
forked from rouge-ruby/rouge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve support for single quotes in Haskell lexer (rouge-ruby#1524)
Haskell uses matching single quotes to express character literals (e.g. `'A'`). However, the unmatched single quote character, `'`, is also used for various purposes (e.g. as part of a variable name like `x'` or in the name of a promoted type like `'Bar`). Currently, Rouge's Haskell lexer permits the use of an unmatched single quote by having separate rules for naming and then a general rule of lower precedence for when the lexer encounters `'`. A better approach would be to only treat `'` as being part of a character literal if the lexer detects that there is a matching `'` within an appropriate number of characters. This commit does that and then creates a more general rule for matching names.
- Loading branch information
Showing
2 changed files
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters