gtksourceview r2041 - in trunk: . gtksourceview/language-specs
- From: pborelli svn gnome org
- To: svn-commits-list gnome org
- Subject: gtksourceview r2041 - in trunk: . gtksourceview/language-specs
- Date: Sat, 30 Aug 2008 13:30:10 +0000 (UTC)
Author: pborelli
Date: Sat Aug 30 13:30:09 2008
New Revision: 2041
URL: http://svn.gnome.org/viewvc/gtksourceview?rev=2041&view=rev
Log:
2008-08-30 Paolo Borelli <paolo borelli katamail com>
* gtksourceview/language-specs/python.lang: handle raw string
separately since they do not contain escaped chars.
Modified:
trunk/ChangeLog
trunk/gtksourceview/language-specs/python.lang
Modified: trunk/gtksourceview/language-specs/python.lang
==============================================================================
--- trunk/gtksourceview/language-specs/python.lang (original)
+++ trunk/gtksourceview/language-specs/python.lang Sat Aug 30 13:30:09 2008
@@ -79,7 +79,8 @@
</match>
</context>
- <define-regex id="string-prefix">(r|u|ur|R|U|UR|Ur|uR)?</define-regex>
+ <define-regex id="string-prefix">(u|U)?</define-regex>
+ <define-regex id="raw-string-prefix">(r|ur|R|UR|Ur|uR)</define-regex>
<context id="multiline-double-quoted-string" style-ref="multiline-string">
<start>\%{string-prefix}"""</start>
@@ -119,6 +120,40 @@
</include>
</context>
+ <context id="multiline-double-quoted-raw-string" style-ref="multiline-string">
+ <start>\%{raw-string-prefix}"""</start>
+ <end>"""</end>
+ <include>
+ <context ref="format"/>
+ </include>
+ </context>
+
+ <context id="multiline-single-quoted-raw-string" style-ref="multiline-string">
+ <start>\%{raw-string-prefix}'''</start>
+ <end>'''</end>
+ <include>
+ <context ref="format"/>
+ </include>
+ </context>
+
+ <context id="double-quoted-raw-string" style-ref="string" end-at-line-end="true">
+ <start>\%{raw-string-prefix}"</start>
+ <end>"</end>
+ <include>
+ <context ref="format"/>
+ <context ref="def:line-continue"/>
+ </include>
+ </context>
+
+ <context id="single-quoted-raw-string" style-ref="string" end-at-line-end="true">
+ <start>\%{raw-string-prefix}'</start>
+ <end>'</end>
+ <include>
+ <context ref="format"/>
+ <context ref="def:line-continue"/>
+ </include>
+ </context>
+
<context id="python">
<include>
<context ref="def:shebang"/>
@@ -129,6 +164,11 @@
<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 id="string-conversion" style-ref="string-conversion" end-at-line-end="true">
<start>`</start>
<end>`</end>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]