Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the walrus operator to the Python3 lexer. #1382

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

bslatkin
Copy link
Contributor

@bslatkin bslatkin commented Feb 3, 2020

  • The walrus operator, also known as assignment expressions, was introduced in Python 3.8
  • Moves the Token.Operator matching root above Token.Punctuation so the walrus operator takes precedence
  • Includes a test to make sure this behavior doesn't regress since it's sensitive to the order of expressions
  • Fixes Python 3.8 assignment expressions not treated as an operator #1381

- The walrus operator, also known as assignment expressions, was introduced in Python 3.8
- Moves the Token.Operator matching root above Token.Punctuation so the walrus operator takes precedence
- Includes a test to make sure this behavior doesn't regress since it's sensitive to the order of expressions
- Fixes pygments#1381
@birkenfeld
Copy link
Member

Nice, thanks!

@birkenfeld birkenfeld merged commit 5519385 into pygments:master Feb 4, 2020
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.

Python 3.8 assignment expressions not treated as an operator
2 participants