summaryrefslogtreecommitdiff
path: root/tests/examplefiles/nesc
Commit message (Collapse)AuthorAgeFilesLines
* CFamily: Lex identifiers after `case` as constants (#2084)amitkummer2022-03-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix #1237 cpp whitespace token usage expanded (#1904)Sebastian Engel2021-10-022-37/+37
| | | | | * Fix #1237 cpp whitespace token usage expanded * Adapt tests change to 3eff56f5
* Use the correct whitespace token for the C family.Matthäus G. Chajdas2021-06-202-1859/+1859
| | | | The CFamilyLexer was matching whitespace as Text instead of Whitespace.
* Fix CFamilyLexer preprocessor tokenization errors (#1830)Henrik Lievonen2021-06-202-18/+74
| | | | | | | | | | | | CFamilyLexer failed to tokenize preprocessor macros when they were preceded by line break surrounded by spaces. This was the case because prerpocessor regex rule expected to start at the beginning of the line, but the space regex rule matched also the whitespace after the line break. Now the space rule has been refined not to match the line break. Because of this, the preprocessor regex rule correctly matches prerpocessor tokens even when they are preceded by white spaces, at the cost of adding some more tokens in the token stream in some cases. This change preserves the behavior of invalid preprocessor usage failing to tokenize.
* Also add auto-updatable output-based tests to examplefiles (#1689)Oleh Prypin2021-01-204-0/+6373
Co-authored-by: Georg Brandl <georg@python.org>