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

Python - add decorator detection #1635

Closed
spectras opened this issue Nov 28, 2018 · 0 comments · Fixed by #1639
Closed

Python - add decorator detection #1635

spectras opened this issue Nov 28, 2018 · 0 comments · Fixed by #1639

Comments

@spectras
Copy link

It would be nice to recognize decorator invocation, eg:

@some.decorator
def foo(bar):
    pass

Decorator invocation can only appear as first token on a line.

This definition should work:

    'decorator': {
        pattern: /(^\s*)@\w+(\.\w+)?/i,
        lookbehind: true
    },
mAAdhaTTah pushed a commit that referenced this issue Dec 1, 2018
Add support for Python decorators, implementing #1635
using the solution proposed by @spectras.

Also add 2 aliases: `annotation` to be like Java and `punctuation`
to change the actual color (like Java).

This resolves #1635.
ggrossetie pushed a commit to ggrossetie/prism that referenced this issue Mar 11, 2019
Add support for Python decorators, implementing PrismJS#1635
using the solution proposed by @spectras.

Also add 2 aliases: `annotation` to be like Java and `punctuation`
to change the actual color (like Java).

This resolves PrismJS#1635.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants