/usr/share/gtksourceview-3.0/language-specs/python3.lang is in libgtksourceview-3.0-common 3.10.2-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | <?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of GtkSourceView
Author: Stefano Palazzo <stefano-palazzo@ubuntu.com>
Copyright (C) 2012 Stefano Palazzo <stefano-palazzo@ubuntu.com>
GtkSourceView is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
GtkSourceView is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-->
<language id="python3" _name="Python 3" version="2.0" _section="Scripts">
<metadata>
<property name="globs">*.py3</property>
<property name="line-comment-start">#</property>
</metadata>
<styles>
<style id="module-handler" _name="Module Handler" map-to="python:module-handler"/>
<style id="keyword" _name="Keyword" map-to="python:keyword"/>
<style id="multiline-string" _name="Multiline string" map-to="python:multiline-string"/>
<style id="string" _name="String" map-to="python:string"/>
<style id="escaped-char" _name="Escaped Character" map-to="python:escaped-char"/>
<style id="format" _name="Format" map-to="python:format"/>
<style id="special-variable" _name="Special Variable" map-to="python:special-variable"/>
<style id="boolean" _name="Boolean" map-to="python:boolean"/>
<style id="floating-point" _name="Floating point number" map-to="python:floating-point"/>
<style id="decimal" _name="Decimal number" map-to="python:decimal"/>
<style id="base-n-integer" _name="Base-N number" map-to="python:base-n-integer"/>
<style id="complex" _name="Complex number" map-to="python:complex"/>
<style id="builtin-constant" _name="Builtin Constant" map-to="python:builtin-constant"/>
<style id="builtin-object" _name="Builtin Object" map-to="python:builtin-object"/>
<style id="builtin-function" _name="Builtin Function" map-to="python:builtin-function"/>
</styles>
<definitions>
<define-regex id="identifier">[_a-zA-Z][_a-zA-Z0-9]*</define-regex>
<define-regex id="number">[1-9][0-9]*</define-regex>
<define-regex id="string-prefix">(b|B)?</define-regex>
<define-regex id="raw-string-prefix">(r|R|rb|RB|rB|Rb|br|BR|bR|Br)</define-regex>
<context id="multiline-double-quoted-string" style-ref="multiline-string" class="string" class-disabled="no-spell-check">
<start>\%{string-prefix}"""</start>
<end>"""</end>
<include>
<context ref="python:format"/>
<context ref="python:escaped-char"/>
</include>
</context>
<context id="multiline-single-quoted-string" style-ref="multiline-string" class="string" class-disabled="no-spell-check">
<start>\%{string-prefix}'''</start>
<end>'''</end>
<include>
<context ref="python:format"/>
<context ref="python:escaped-char"/>
</include>
</context>
<context id="double-quoted-string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
<start>\%{string-prefix}"</start>
<end>"</end>
<include>
<context ref="python:format"/>
<context ref="python:escaped-char"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="single-quoted-string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
<start>\%{string-prefix}'</start>
<end>'</end>
<include>
<context ref="python:format"/>
<context ref="python:escaped-char"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="multiline-double-quoted-raw-string" style-ref="multiline-string" class="string" class-disabled="no-spell-check">
<start>\%{raw-string-prefix}"""</start>
<end>"""</end>
<include>
<context ref="python:format"/>
</include>
</context>
<context id="multiline-single-quoted-raw-string" style-ref="multiline-string" class="string" class-disabled="no-spell-check">
<start>\%{raw-string-prefix}'''</start>
<end>'''</end>
<include>
<context ref="python:format"/>
</include>
</context>
<context id="double-quoted-raw-string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
<start>\%{raw-string-prefix}"</start>
<end>"</end>
<include>
<context ref="python:format"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="single-quoted-raw-string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
<start>\%{raw-string-prefix}'</start>
<end>'</end>
<include>
<context ref="python:format"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="python3" class="no-spell-check">
<include>
<context ref="def:shebang"/>
<context ref="def:shell-like-comment"/>
<context ref="multiline-double-quoted-string"/>
<context ref="multiline-single-quoted-string"/>
<context ref="double-quoted-string"/>
<context ref="single-quoted-string"/>
<context ref="multiline-double-quoted-raw-string"/>
<context ref="multiline-single-quoted-raw-string"/>
<context ref="double-quoted-raw-string"/>
<context ref="single-quoted-raw-string"/>
<context ref="python:special-variables"/>
<context ref="python:boolean"/>
<context ref="python:complex"/>
<context ref="python:float"/>
<context ref="python:decimal"/>
<context id="binary" style-ref="base-n-integer">
<match>(?<![\w\.])0[bB][0-1]+[lL]?(?![\w\.])</match>
</context>
<context id="octal" style-ref="base-n-integer">
<match>(?<![\w\.])0[oO][0-7]+[lL]?(?![\w\.])</match>
</context>
<context ref="python:hex"/>
<context ref="python:module-handler"/>
<context ref="python:keywords"/>
<context id="3x-only-keywords" style-ref="keyword">
<keyword>nonlocal</keyword>
</context>
<context ref="python:builtin-constants"/>
<context ref="python:builtin-objects"/>
<context id="3x-only-builtin-objects" style-ref="builtin-object">
<prefix>(?<![\w\.])</prefix>
<keyword>ResourceWarning</keyword>
</context>
<context ref="python:builtin-functions"/>
<context id="3x-only-builtin-functions" style-ref="builtin-function">
<prefix>(?<![\w\.])</prefix>
<keyword>ascii</keyword>
<keyword>bin</keyword>
<keyword>bytearray</keyword>
<keyword>bytes</keyword>
<keyword>exec</keyword>
<keyword>format</keyword>
<keyword>memoryview</keyword>
<keyword>next</keyword>
<keyword>print</keyword>
</context>
</include>
</context>
</definitions>
</language>
|