diff options
author | amitkummer <49096391+amitkummer@users.noreply.github.com> | 2022-03-12 16:00:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-12 15:00:31 +0100 |
commit | 62dd19e9d3e0400fff0aeddabae490797425c87e (patch) | |
tree | e3883dafbe0fcdce2a9932282ddc07860b55c346 /pygments/lexers/haskell.py | |
parent | 6e07d3f31654c67881e39f0342d024e12e91a667 (diff) | |
download | pygments-git-62dd19e9d3e0400fff0aeddabae490797425c87e.tar.gz |
CFamily: Lex identifiers after `case` as constants (#2084)
* Lex identifiers after `case` as constants
Add a state for marking identifiers preceded by a `case` keyword as
constants.
Additionally, refactor the `label` rule to no longer permit a `case`
keyword before a label.
Consequentially, identifiers after a `case` keyword (like `foo` in
`case foo:`) are no longer wrongly lexed as `Name.Label`, but as
`Name.Constant`.
In addition, this fixes #2076, as multiple `case` keywords in one
line are lexed the same.
* Add test for multiple `case` keywords in one line
* Fix existing tests
* Lex `::` as Operator and not Name.Constant
After a `case`, when lexing a namespaced name, like `foo::bar`, lex the
namespace operator `::` as Operator, and not Name.Constant.
* Regenerate tokens
Diffstat (limited to 'pygments/lexers/haskell.py')
0 files changed, 0 insertions, 0 deletions