[gtksourceview] lang-tutorial: 2-spaces indentation
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] lang-tutorial: 2-spaces indentation
- Date: Fri, 13 Sep 2013 11:50:40 +0000 (UTC)
commit a7ae52c4ede21ef530301ca01b7e74e5dc8c20e8
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Sep 13 13:41:45 2013 +0200
lang-tutorial: 2-spaces indentation
docs/reference/lang-tutorial.xml | 394 +++++++++++++++++++-------------------
1 files changed, 195 insertions(+), 199 deletions(-)
---
diff --git a/docs/reference/lang-tutorial.xml b/docs/reference/lang-tutorial.xml
index 371e184..63379dd 100644
--- a/docs/reference/lang-tutorial.xml
+++ b/docs/reference/lang-tutorial.xml
@@ -139,7 +139,7 @@ Following the <code><styles></code> element there is the
<code><definitions></code> element, which contains the
description proper of the syntax:
</para>
-
+
<programlisting>
<definitions>
</programlisting>
@@ -172,8 +172,8 @@ start with a double slash <code>//</code> and end at the end of the line:
<programlisting>
<context id="comment" style-ref="comment">
- <start>\/\/</start>
- <end>$</end>
+ <start>\/\/</start>
+ <end>$</end>
</context>
</programlisting>
@@ -253,8 +253,7 @@ we don't end the string prematurely:
</para>
<programlisting>
-<context id="string" end-at-line-end="true"
- style-ref="string">
+<context id="string" end-at-line-end="true" style-ref="string">
</programlisting>
<para>
@@ -274,9 +273,9 @@ To implement the escape handling we include a <code>escape</code> context:
</para>
<programlisting>
- <context id="escape" style-ref="escaped-character">
- <match>\\.</match>
- </context>
+ <context id="escape" style-ref="escaped-character">
+ <match>\\.</match>
+ </context>
</programlisting>
<para>
@@ -299,11 +298,10 @@ internet address contained:
<programlisting>
<context id="comment-multiline" style-ref="comment">
- <start>\/\*</start>
- <end>\*\/</end>
- <include>
- <context id="net-address" style-ref="net-address"
- extend-parent="false">
+ <start>\/\*</start>
+ <end>\*\/</end>
+ <include>
+ <context id="net-address" style-ref="net-address" extend-parent="false">
</programlisting>
<para>
@@ -312,9 +310,9 @@ found, so we use <code>false</code> in the <code>extend-parent</code> attribute.
</para>
<programlisting>
- <match>http:\/\/[^\s]*</match>
- </context>
- </include>
+ <match>http:\/\/[^\s]*</match>
+ </context>
+ </include>
</context>
</programlisting>
@@ -338,10 +336,10 @@ contain escaped characters:
<programlisting>
<context id="char" end-at-line-end="true" style-ref="string">
- <start>'</start>
- <end>'</end>
- <include>
- <context ref="escape"/>
+ <start>'</start>
+ <end>'</end>
+ <include>
+ <context ref="escape"/>
</programlisting>
<para>
@@ -351,7 +349,7 @@ context, without repeating its definition.
</para>
<programlisting>
- </include>
+ </include>
</context>
</programlisting>
@@ -380,14 +378,14 @@ our <code>comment-multiline</code> context that uses the definitions from <code>
<programlisting>
<context id="comment-multiline" style-ref="comment">
- <start>\/\*</start>
- <end>\*\/</end>
- <include>
- <context ref="def:in-comment"/>
+ <start>\/\*</start>
+ <end>\*\/</end>
+ <include>
+ <context ref="def:in-comment"/>
</programlisting>
<programlisting>
- </include>
+ </include>
</context>
</programlisting>
@@ -398,19 +396,19 @@ elements:
<programlisting>
<context id="keywords" style-ref="keyword">
- <keyword>if</keyword>
- <keyword>else</keyword>
- <keyword>for</keyword>
- <keyword>while</keyword>
- <keyword>return</keyword>
- <keyword>break</keyword>
- <keyword>switch</keyword>
- <keyword>case</keyword>
- <keyword>default</keyword>
- <keyword>do</keyword>
- <keyword>continue</keyword>
- <keyword>goto</keyword>
- <keyword>sizeof</keyword>
+ <keyword>if</keyword>
+ <keyword>else</keyword>
+ <keyword>for</keyword>
+ <keyword>while</keyword>
+ <keyword>return</keyword>
+ <keyword>break</keyword>
+ <keyword>switch</keyword>
+ <keyword>case</keyword>
+ <keyword>default</keyword>
+ <keyword>do</keyword>
+ <keyword>continue</keyword>
+ <keyword>goto</keyword>
+ <keyword>sizeof</keyword>
</context>
</programlisting>
@@ -421,21 +419,21 @@ possible to highlight them differently:
<programlisting>
<context id="types" style-ref="type">
- <keyword>char</keyword>
- <keyword>const</keyword>
- <keyword>double</keyword>
- <keyword>enum</keyword>
- <keyword>float</keyword>
- <keyword>int</keyword>
- <keyword>long</keyword>
- <keyword>short</keyword>
- <keyword>signed</keyword>
- <keyword>static</keyword>
- <keyword>struct</keyword>
- <keyword>typedef</keyword>
- <keyword>union</keyword>
- <keyword>unsigned</keyword>
- <keyword>void</keyword>
+ <keyword>char</keyword>
+ <keyword>const</keyword>
+ <keyword>double</keyword>
+ <keyword>enum</keyword>
+ <keyword>float</keyword>
+ <keyword>int</keyword>
+ <keyword>long</keyword>
+ <keyword>short</keyword>
+ <keyword>signed</keyword>
+ <keyword>static</keyword>
+ <keyword>struct</keyword>
+ <keyword>typedef</keyword>
+ <keyword>union</keyword>
+ <keyword>unsigned</keyword>
+ <keyword>void</keyword>
</context>
</programlisting>
@@ -446,7 +444,7 @@ You can also set a prefix (or a suffix) common to every keyword using the
<programlisting>
<context id="preprocessor" style-ref="preprocessor">
- <prefix>^#</prefix>
+ <prefix>^#</prefix>
</programlisting>
<para>
@@ -456,8 +454,8 @@ are set to, respectively, <code>\%[</code> and
</para>
<programlisting>
- <keyword>define</keyword>
- <keyword>undef</keyword>
+ <keyword>define</keyword>
+ <keyword>undef</keyword>
</programlisting>
<para>
@@ -465,10 +463,10 @@ Keep in mind that every keyword is a regular expression:
</para>
<programlisting>
- <keyword>if(n?def)?</keyword>
- <keyword>else</keyword>
- <keyword>elif</keyword>
- <keyword>endif</keyword>
+ <keyword>if(n?def)?</keyword>
+ <keyword>else</keyword>
+ <keyword>elif</keyword>
+ <keyword>endif</keyword>
</context>
</programlisting>
@@ -480,9 +478,9 @@ these pseudo-comments as comments:
<programlisting>
<context id="if0-comment" style-ref="comment">
- <start>^#if 0\b</start>
- <end>^#(endif|else|elif)\b</end>
- <include>
+ <start>^#if 0\b</start>
+ <end>^#(endif|else|elif)\b</end>
+ <include>
</programlisting>
<para>
@@ -494,10 +492,10 @@ nested context, that will extend the parent on every nested
</para>
<programlisting>
- <context id="if-in-if0">
- <start>^#if(n?def)?\b</start>
- <end>^#endif\b</end>
- <include>
+ <context id="if-in-if0">
+ <start>^#if(n?def)?\b</start>
+ <end>^#endif\b</end>
+ <include>
</programlisting>
<para>
@@ -505,10 +503,10 @@ Nested contexts can be recursive:
</para>
<programlisting>
- <context ref="if-in-if0"/>
- </include>
- </context>
+ <context ref="if-in-if0"/>
</include>
+ </context>
+ </include>
</context>
</programlisting>
@@ -525,8 +523,8 @@ differently the included file:
<programlisting>
<context id="include" style-ref="preprocessor">
- <match>^#include (".*"|&lt;.*&gt;)</match>
- <include>
+ <match>^#include (".*"|&lt;.*&gt;)</match>
+ <include>
</programlisting>
<para>
@@ -535,8 +533,8 @@ associating them with a context with the <code>sub-pattern</code> attribute:
</para>
<programlisting>
- <context id="included-file" sub-pattern="1"
- style-ref="included-file"/>
+ <context id="included-file" sub-pattern="1"
+ style-ref="included-file"/>
</programlisting>
<para>
@@ -575,7 +573,7 @@ the <code><start></code> and <code><end></code> element.
</para>
<programlisting>
- </include>
+ </include>
</context>
</programlisting>
@@ -602,130 +600,128 @@ for this tutorial:
<programlisting>
<?xml version="1.0" encoding="UTF-8"?>
<language id="c" _name="C" version="2.0" _section="Sources">
- <metadata>
- <property name="mimetypes">text/x-c;text/x-csrc</property>
- <property name="globs">*.c</property>
- </metadata>
- <styles>
- <style id="comment" _name="Comment" map-to="def:comment"/>
- <style id="string" _name="String" map-to="def:string"/>
- <style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
- <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
- <style id="included-file" _name="Included File" map-to="def:string"/>
- <style id="char" _name="Character" map-to="def:character"/>
- <style id="keyword" _name="Keyword" map-to="def:keyword"/>
- <style id="type" _name="Data Type" map-to="def:type"/>
- </styles>
- <definitions>
- <context id="c">
- <include>
-
- <context id="comment" style-ref="comment">
- <start>\/\/</start>
- <end>$</end>
- </context>
-
- <context id="string" end-at-line-end="true"
- style-ref="string">
- <start>"</start>
- <end>"</end>
- <include>
- <context id="escape" style-ref="escaped-character">
- <match>\\.</match>
- </context>
- </include>
- </context>
-
- <context id="comment-multiline"
- style-ref="comment">
- <start>\/\*</start>
- <end>\*\/</end>
- <include>
- <context ref="def:in-comment"/>
- </include>
- </context>
-
- <context id="char" end-at-line-end="true" style-ref="string">
- <start>'</start>
- <end>'</end>
- <include>
- <context ref="escape"/>
- </include>
- </context>
-
- <context ref="def:decimal"/>
- <context ref="def:float"/>
-
- <context id="keywords" style-ref="keyword">
- <keyword>if</keyword>
- <keyword>else</keyword>
- <keyword>for</keyword>
- <keyword>while</keyword>
- <keyword>return</keyword>
- <keyword>break</keyword>
- <keyword>switch</keyword>
- <keyword>case</keyword>
- <keyword>default</keyword>
- <keyword>do</keyword>
- <keyword>continue</keyword>
- <keyword>goto</keyword>
- <keyword>sizeof</keyword>
- </context>
-
- <context id="types" style-ref="type">
- <keyword>char</keyword>
- <keyword>const</keyword>
- <keyword>double</keyword>
- <keyword>enum</keyword>
- <keyword>float</keyword>
- <keyword>int</keyword>
- <keyword>long</keyword>
- <keyword>short</keyword>
- <keyword>signed</keyword>
- <keyword>static</keyword>
- <keyword>struct</keyword>
- <keyword>typedef</keyword>
- <keyword>union</keyword>
- <keyword>unsigned</keyword>
- <keyword>void</keyword>
- </context>
-
- <context id="if0-comment" style-ref="comment">
- <start>^#if 0\b</start>
- <end>^#(endif|else|elif)\b</end>
- <include>
- <context id="if-in-if0">
- <start>^#if(n?def)?\b</start>
- <end>^#endif\b</end>
- <include>
- <context ref="if-in-if0"/>
- </include>
- </context>
- </include>
- </context>
-
- <context id="preprocessor" style-ref="preprocessor">
- <prefix>^#</prefix>
- <keyword>define</keyword>
- <keyword>undef</keyword>
- <keyword>if(n?def)?</keyword>
- <keyword>else</keyword>
- <keyword>elif</keyword>
- <keyword>endif</keyword>
- </context>
-
- <context id="include" style-ref="preprocessor">
- <match>^#include (".*"|&lt;.*&gt;)</match>
- <include>
- <context id="included-file"
- sub-pattern="1"
- style-ref="included-file"/>
- </include>
- </context>
-
- </include>
+ <metadata>
+ <property name="mimetypes">text/x-c;text/x-csrc</property>
+ <property name="globs">*.c</property>
+ </metadata>
+ <styles>
+ <style id="comment" _name="Comment" map-to="def:comment"/>
+ <style id="string" _name="String" map-to="def:string"/>
+ <style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
+ <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
+ <style id="included-file" _name="Included File" map-to="def:string"/>
+ <style id="char" _name="Character" map-to="def:character"/>
+ <style id="keyword" _name="Keyword" map-to="def:keyword"/>
+ <style id="type" _name="Data Type" map-to="def:type"/>
+ </styles>
+ <definitions>
+ <context id="c">
+ <include>
+
+ <context id="comment" style-ref="comment">
+ <start>\/\/</start>
+ <end>$</end>
+ </context>
+
+ <context id="string" end-at-line-end="true" style-ref="string">
+ <start>"</start>
+ <end>"</end>
+ <include>
+ <context id="escape" style-ref="escaped-character">
+ <match>\\.</match>
+ </context>
+ </include>
</context>
- </definitions>
+
+ <context id="comment-multiline" style-ref="comment">
+ <start>\/\*</start>
+ <end>\*\/</end>
+ <include>
+ <context ref="def:in-comment"/>
+ </include>
+ </context>
+
+ <context id="char" end-at-line-end="true" style-ref="string">
+ <start>'</start>
+ <end>'</end>
+ <include>
+ <context ref="escape"/>
+ </include>
+ </context>
+
+ <context ref="def:decimal"/>
+ <context ref="def:float"/>
+
+ <context id="keywords" style-ref="keyword">
+ <keyword>if</keyword>
+ <keyword>else</keyword>
+ <keyword>for</keyword>
+ <keyword>while</keyword>
+ <keyword>return</keyword>
+ <keyword>break</keyword>
+ <keyword>switch</keyword>
+ <keyword>case</keyword>
+ <keyword>default</keyword>
+ <keyword>do</keyword>
+ <keyword>continue</keyword>
+ <keyword>goto</keyword>
+ <keyword>sizeof</keyword>
+ </context>
+
+ <context id="types" style-ref="type">
+ <keyword>char</keyword>
+ <keyword>const</keyword>
+ <keyword>double</keyword>
+ <keyword>enum</keyword>
+ <keyword>float</keyword>
+ <keyword>int</keyword>
+ <keyword>long</keyword>
+ <keyword>short</keyword>
+ <keyword>signed</keyword>
+ <keyword>static</keyword>
+ <keyword>struct</keyword>
+ <keyword>typedef</keyword>
+ <keyword>union</keyword>
+ <keyword>unsigned</keyword>
+ <keyword>void</keyword>
+ </context>
+
+ <context id="if0-comment" style-ref="comment">
+ <start>^#if 0\b</start>
+ <end>^#(endif|else|elif)\b</end>
+ <include>
+ <context id="if-in-if0">
+ <start>^#if(n?def)?\b</start>
+ <end>^#endif\b</end>
+ <include>
+ <context ref="if-in-if0"/>
+ </include>
+ </context>
+ </include>
+ </context>
+
+ <context id="preprocessor" style-ref="preprocessor">
+ <prefix>^#</prefix>
+ <keyword>define</keyword>
+ <keyword>undef</keyword>
+ <keyword>if(n?def)?</keyword>
+ <keyword>else</keyword>
+ <keyword>elif</keyword>
+ <keyword>endif</keyword>
+ </context>
+
+ <context id="include" style-ref="preprocessor">
+ <match>^#include (".*"|&lt;.*&gt;)</match>
+ <include>
+ <context id="included-file"
+ sub-pattern="1"
+ style-ref="included-file"/>
+ </include>
+ </context>
+
+ </include>
+ </context>
+ </definitions>
</language>
</programlisting>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]