Skip to content

Commit b645cc7

Browse files
committed
tests: Add a test for illegal decorating syntax
1 parent d3f7a83 commit b645cc7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Diff for: test/functions/decorators8.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@deco().abc # SyntaxError: invalid syntax
2+
def foo(): pass
3+
4+
5+
6+
@ : entity.name.function.decorator.python, meta.function.decorator.python, source.python
7+
deco : entity.name.function.decorator.python, meta.function.decorator.python, source.python
8+
( : meta.function.decorator.python, punctuation.definition.arguments.begin.python, source.python
9+
) : meta.function.decorator.python, punctuation.definition.arguments.end.python, source.python
10+
.abc : invalid.illegal.decorator.python, meta.function.decorator.python, source.python
11+
: source.python
12+
# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python
13+
SyntaxError: invalid syntax : comment.line.number-sign.python, source.python
14+
def : meta.function.python, source.python, storage.type.function.python
15+
: meta.function.python, source.python
16+
foo : entity.name.function.python, meta.function.python, source.python
17+
( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python
18+
) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python
19+
: : meta.function.python, punctuation.section.function.begin.python, source.python
20+
: source.python
21+
pass : keyword.control.flow.python, source.python

0 commit comments

Comments
 (0)