Skip to content

Recognize regular expression literals in the Vala lexer - #3497

Open
Arham-Begani wants to merge 2 commits into
pygments:masterfrom
Arham-Begani:fix/vala-regex-literals
Open

Arham-Begani wants to merge 2 commits into
pygments:masterfrom
Arham-Begani:fix/vala-regex-literals

Conversation

@Arham-Begani

Copy link
Copy Markdown

Fixes #2860.

The Vala lexer splits /^a@b$/i into operators and identifiers. This change recognizes a slash-delimited regex where Vala allows one, including escaped slashes and trailing flags. It preserves the division operators in expressions such as total / count / scale and keeps intervening comments separate from the literal.

The regression snippet covers the reported example, a return expression, and division after a postfix increment. Local verification with tox -e py,check passed (5,332 tests passed, 15 skipped).

OpenAI Codex assisted with implementation and testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vala: error on @ symbol in regular expressions

1 participant