comment:"This is a special rule that should be used where no match is desired. It is not a good idea to match something like '1{0}' because in some cases that can result in infinite loops in token generation. So the rule instead matches and impossible expression to allow a match to fail and move to the next token."
match:"$.^"
statement:
patterns: [
{
include:"#import"
}
{
include:"#class-declaration"
}
{
include:"#function-declaration"
}
{
include:"#generator"
}
{
include:"#statement-keyword"
}
{
include:"#assignment-operator"
}
{
include:"#decorator"
}
{
include:"#docstring-statement"
}
{
include:"#semicolon"
}
]
semicolon:
patterns: [
{
name:"invalid.deprecated.semicolon.python"
match:"\\;$"
}
]
comments:
patterns: [
{
name:"comment.line.number-sign.python"
contentName:"meta.typehint.comment.python"
begin:'''
(?x)
(?:
\\# \\s* (type:)
\\s*+ (?# we want `\\s*+` which is possessive quantifier since
we do not actually want to backtrack when matching
comment:"the string either terminates correctly or by the beginning of a new line (this is for single line docstrings that aren't terminated) AND it's not followed by another docstring"