You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
4.1 KiB
135 lines
4.1 KiB
<SyntaxDefinition name="Python" extensions=".py" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008"> |
|
|
|
<Color name="Digits" foreground="DarkBlue" exampleText="0123456789" /> |
|
<Color name="DocComment" foreground="Green" exampleText='""" comment' /> |
|
<Color name="SingleQuoteDocComment" foreground="Green" exampleText="''' comment" /> |
|
<Color name="LineComment" foreground="Green" exampleText="# comment" /> |
|
<Color name="String" foreground="Blue" exampleText='name = "Joe"' /> |
|
<Color name="Char" foreground="Magenta" exampleText="char linefeed = '\n'" /> |
|
<Color name="Punctuation" exampleText="a(b.c);" /> |
|
<Color name="MethodCall" fontWeight="bold" foreground="MidnightBlue" exampleText="method(" /> |
|
<Color name="BuiltInStatements" fontWeight="bold" foreground="MidnightBlue" exampleText="print 'hello'" /> |
|
<Color name="ClassStatement" foreground="Blue" fontWeight="bold" exampleText="class Foo: pass" /> |
|
<Color name="ExceptionHandlingStatements" fontWeight="bold" foreground="Teal" exampleText="raise 'error'" /> |
|
<Color name="FunctionDefinition" fontWeight="bold" foreground="Blue" exampleText="def MyFunction" /> |
|
<Color name="Imports" fontWeight="bold" foreground="Green" exampleText="import System.Xml" /> |
|
<Color name="IterationStatements" fontWeight="bold" foreground="Blue" exampleText="for num in range(10,20):" /> |
|
<Color name="JumpStatements" foreground="Navy" exampleText="return val" /> |
|
<Color name="OperatorStatements" fontWeight="bold" foreground="DarkCyan" exampleText="not(a && b)" /> |
|
<Color name="PassStatement" foreground="Gray" exampleText="pass" /> |
|
<Color name="NullStatement" foreground="Gray" exampleText="return None" /> |
|
<Color name="SelectionStatements" fontWeight="bold" foreground="Blue" exampleText="if (a):" /> |
|
<Color name="WithStatement" foreground="DarkViolet" exampleText='with open("a.txt") as file:' /> |
|
|
|
<Property name="LineComment" value="#"/> |
|
|
|
<RuleSet ignoreCase="false"> |
|
|
|
<Span color="DocComment" multiline="true"> |
|
<Begin>"""</Begin> |
|
<End>"""</End> |
|
</Span> |
|
|
|
<Span color="SingleQuoteDocComment" multiline="true"> |
|
<Begin>'''</Begin> |
|
<End>'''</End> |
|
</Span> |
|
|
|
<Span color="LineComment"> |
|
<Begin>\#</Begin> |
|
</Span> |
|
|
|
<Span color="String"> |
|
<Begin>"</Begin> |
|
<End>"</End> |
|
<RuleSet> |
|
<!-- span for escape sequences --> |
|
<Span begin="\\" end="."/> |
|
</RuleSet> |
|
</Span> |
|
|
|
<Span color="Char"> |
|
<Begin>'</Begin> |
|
<End>'</End> |
|
<RuleSet> |
|
<!-- span for escape sequences --> |
|
<Span begin="\\" end="."/> |
|
</RuleSet> |
|
</Span> |
|
|
|
<Keywords color="BuiltInStatements"> |
|
<Word>assert</Word> |
|
<Word>del</Word> |
|
<Word>exec</Word> |
|
<Word>global</Word> |
|
<Word>lambda</Word> |
|
<Word>print</Word> |
|
</Keywords> |
|
|
|
<Keywords color="ClassStatement"> |
|
<Word>class</Word> |
|
</Keywords> |
|
|
|
<Keywords color="ExceptionHandlingStatements"> |
|
<Word>except</Word> |
|
<Word>finally</Word> |
|
<Word>raise</Word> |
|
<Word>try</Word> |
|
</Keywords> |
|
|
|
<Keywords color="FunctionDefinition"> |
|
<Word>def</Word> |
|
</Keywords> |
|
|
|
<Keywords color="Imports"> |
|
<Word>import</Word> |
|
<Word>from</Word> |
|
</Keywords> |
|
|
|
<Keywords color="IterationStatements"> |
|
<Word>for</Word> |
|
<Word>in</Word> |
|
<Word>while</Word> |
|
</Keywords> |
|
|
|
<Keywords color="JumpStatements"> |
|
<Word>break</Word> |
|
<Word>continue</Word> |
|
<Word>yield</Word> |
|
<Word>return</Word> |
|
</Keywords> |
|
|
|
<Keywords color="OperatorStatements"> |
|
<Word>and</Word> |
|
<Word>as</Word> |
|
<Word>is</Word> |
|
<Word>not</Word> |
|
<Word>or</Word> |
|
</Keywords> |
|
|
|
<Keywords color="PassStatement"> |
|
<Word>pass</Word> |
|
</Keywords> |
|
|
|
<Keywords color="SelectionStatements"> |
|
<Word>elif</Word> |
|
<Word>else</Word> |
|
<Word>if</Word> |
|
</Keywords> |
|
|
|
<Keywords color="WithStatement"> |
|
<Word>with</Word> |
|
</Keywords> |
|
|
|
<Keywords color="NullStatement"> |
|
<Word>None</Word> |
|
</Keywords> |
|
|
|
<Rule color="MethodCall">\b[\d\w_]+(?=(\s*\())</Rule> |
|
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule> |
|
|
|
<Rule color="Punctuation"> |
|
[?,.;()\[\]{}+\-/%*<>^+~!|&]+ |
|
</Rule> |
|
</RuleSet> |
|
</SyntaxDefinition>
|
|
|