Commits

Chad Burrus committed ff8853e

updated to Scite 2.11

Comments (0)

Files changed (11)

CommandValues.html

 <tr><td>IDM_SAVEAS</td><td>Save As</td></tr>
 <tr><td>IDM_SAVEACOPY</td><td>Save a Copy</td></tr>
 <tr><td>IDM_ENCODING_DEFAULT</td><td>Code Page Property</td></tr>
-<tr><td>IDM_ENCODING_UCS2BE</td><td>UCS-2 Big Endian</td></tr>
-<tr><td>IDM_ENCODING_UCS2LE</td><td>UCS-2 Little Endian</td></tr>
+<tr><td>IDM_ENCODING_UCS2BE</td><td>UTF-16 Big Endian</td></tr>
+<tr><td>IDM_ENCODING_UCS2LE</td><td>UTF-16 Little Endian</td></tr>
 <tr><td>IDM_ENCODING_UTF8</td><td>UTF-8 with BOM</td></tr>
 <tr><td>IDM_ENCODING_UCOOKIE</td><td>UTF-8</td></tr>
 <tr><td>IDM_SAVEASHTML</td><td>As HTML</td></tr>

SciLexer.dll

Binary file modified.

SciTE.exe

Binary file modified.
     <meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
     <meta name="Description"
     content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
-    <meta name="Date.Modified" content="20100214" />
-    <script>
+    <meta name="Date.Modified" content="20100409" />
+    <script type="text/javascript">
    	function IsRemote() {
 		var loc = '' + window.location;
 		return loc.indexOf('http:') != -1;
    	}
    </script>
     <style type="text/css">
-        .versionlist {
-	color: #FFCC99;
+        #versionlist {
+            margin: 0;
+            padding: .5em;
+            list-style-type: none;
+            color: #FFCC99;
+            background: #000000;
+        }
+        #versionlist li {
+            margin-bottom: .5em;
+        }
+        #menu {
+            margin: 0;
+            padding: .5em 0;
+            list-style-type: none;
+            font-size: larger;
+            background: #CCCCCC;
+        }
+        #menu li {
+            margin: 0;
+            padding: 0 .5em;
+            display: inline;
         }
     </style>
     <title>
           X</font>
         </td>
         <td width="40%" align="right">
-          <span class="versionlist"> Release version 2.03<br />
-           Site last modified February 14 2010</span>
+          <font color="#FFCC99" size="3"> Release version 2.11<br />
+           Site last modified April 9 2010</font>
         </td>
         <td width="20%">
           &nbsp;
         </td>
       </tr>
     </table>
-    <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="6" border="0">
-      <tr>
-        <td width="100%">
-          <span class="versionlist">Version 2.03 fixed non-responsive UI while running tools on GTK+ and autocompletion
-		lists appearing as a single line.</span>
-        </td>
-      </tr>
-      <tr>
-        <td width="100%">
-          <span class="versionlist">Version 2.02 fixes some problems with rectangular selection.</span>
-        </td>
-      </tr>
-      <tr>
-        <td width="100%">
-          <span class="versionlist">Version 2.01 fixes some problems with multiple selection.</span>
-        </td>
-      </tr>
-      <tr>
-        <td width="100%">
-          <span class="versionlist">Version 2.0 supports multiple selection and virtual space.</span>
-        </td>
-      </tr>
-      <tr>
-        <td width="100%">
-          <span class="versionlist">Version 1.79 allows wrapped lines to be indented to match the
-	  initial line.<br />The tab bar is improved: on GTK+ it can be scrolled when there are many tabs and on Windows
-	  tabs can be reordered by drag and drop.</span>
-        </td>
-      </tr>
-    </table>
-    <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
-      <tr>
-        <td>
-          <font size="4"> <a href="http://www.scintilla.org/SciTEImage.html">Screenshot</a>&nbsp;&nbsp;
+    <ul id="versionlist">
+      <li>Version 2.11 is just to match a Scintilla compatibility fix release.</li>
+      <li>Version 2.10 can access files on Windows with names outsides the user's preferred character encoding.
+          Case insensitive search and the upper and lower case commands work on non-ASCII characters.
+          SciTE will no longer run on Windows 95, 98 or ME.</li>
+      <li>Version 2.03 fixed non-responsive UI while running tools on GTK+ and autocompletion
+          lists appearing as a single line.</li>
+      <li>Version 2.02 fixes some problems with rectangular selection.</li>
+      <li>Version 2.01 fixes some problems with multiple selection.</li>
+      <li>Version 2.0 supports multiple selection and virtual space.</li>
+    </ul>
+    <ul id="menu">
+      <li><a href="http://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
+      <li id="remote1"><a href="http://www.scintilla.org/SciTEDownload.html">Download</a></li>
+      <li><a href="http://www.scintilla.org/SciTEDoc.html">Documentation</a></li>
+      <li id="remote2"><a href="http://www.scintilla.org/index.html">Scintilla</a></li>
+      <li><a href="http://groups.google.com/group/scite-interest/web/extras">Extras</a></li>
+      <li><a href="http://groups.google.com/group/scite-interest/web/translations">Translations</a></li>
+      <li><a href="http://www.scintilla.org/SciTEFAQ.html">Frequently Asked Questions</a></li>
+    </ul>
 <script type="text/javascript" language="JavaScript"><!--
-if (IsRemote()) {
-    document.write('<a href="http://www.scintilla.org/SciTEDownload.html">Download</a>&nbsp;&nbsp;');
+if (!IsRemote()) { //if NOT remote...
+    document.getElementById('remote1').style.display='none';
+    document.getElementById('remote2').style.display='none';
 }
 //--></script>
-<noscript>
-<a href="http://www.scintilla.org/SciTEDownload.html">Download</a>&nbsp;&nbsp;
-</noscript>
-	  <a href="http://www.scintilla.org/SciTEDoc.html">
-          Documentation</a>&nbsp;&nbsp;
-<script type="text/javascript" language="JavaScript"><!--
-if (IsRemote()) {
-    document.write('<a href="http://www.scintilla.org/index.html">Scintilla</a>&nbsp;&nbsp; ');
-}
-//--></script>
-<noscript>
-<a href="http://www.scintilla.org/index.html">Scintilla</a>&nbsp;&nbsp;
-</noscript>
-	  <a href="http://groups.google.com/group/scite-interest/web/extras">
-          Extras</a>&nbsp;&nbsp;
-	  <a href="http://groups.google.com/group/scite-interest/web/translations">
-          Translations</a>&nbsp;&nbsp;
-	  <a href="http://www.scintilla.org/SciTEFAQ.html">
-          Frequently Asked Questions</a>&nbsp;&nbsp;
-	  </font>
-        </td>
-      </tr>
-    </table>
     <p>
        <a href="http://www.scintilla.org/SciTEDoc.html">SciTE</a> is a SCIntilla based Text Editor. Originally built to
       demonstrate <a href="http://www.scintilla.org">Scintilla</a>, it has grown to be a generally useful editor with facilities for
     </p>
     <p>
        SciTE is currently available for Intel Win32 and Linux compatible operating
-      systems with GTK+. It has been run on Windows XP and on Fedora 8 and Ubuntu 7.10
-      with GTK+ 2.12. <a href="http://www.scintilla.org/SciTEImage.html">Here is a screenshot of
+      systems with GTK+. It has been run on Windows XP and on Fedora 12 and Ubuntu 9.10
+      with GTK+ 2.18. <a href="http://www.scintilla.org/SciTEImage.html">Here is a screenshot of
       SciTE.</a><br />
     </p>
     <p>
         <td>Go to start of display line.</td><td>Alt+Home</td>
       </tr>
       <tr>
-        <td>Extend selection to start of display line.</td><td>Alt+Shift+Home</td>
-      </tr>
-      <tr>
         <td>Go to end of document.</td><td>Ctrl+End</td>
       </tr>
       <tr>
         <td>Go to end of display line.</td><td>Alt+End</td>
       </tr>
       <tr>
-        <td>Extend selection to end of display line.</td><td>Alt+Shift+End</td>
-      </tr>
-      <tr>
         <td>Expand or contract a fold point.</td><td>Ctrl+Keypad*</td>
       </tr>
       <tr>
       <tr>
         <td>Rectangular block selection.</td><td>Alt+Shift+Movement</td>
       </tr>
+      <tr>
+        <td>Extend rectangular selection to start of line.</td><td>Alt+Shift+Home</td>
+      </tr>
+      <tr>
+        <td>Extend rectangular selection to end of line.</td><td>Alt+Shift+End</td>
+      </tr>
     </table>
     <h3>
        Abbreviations
     Wildcard matching only works where the wildcard is at the start of a file specification, so "*.mak" will match "proj.mak" but
     "Makefile*" will not match "Makefile.in".
     </p>
+    <p>
+    Properties files are not treated as having a particular encoding, however individual property values
+    may be treated as having an encoding. For file names, commands, and user interface text, this is
+    UTF-8 so it may be easier to edit properties files as UTF-8 by inserting a coding cookie as explained later.
+    Other properties may be treated as byte sequences (like word.characters.<i>filepattern</i>) or in an implicit
+    encoding (such as keywords.<i>filepattern</i> matching the document encoding) so that it may be better to
+    edit these settings using a non-UTF-8 encoding. Where both UTF-8 and non-UTF-8 values are wanted,
+    two files can be used with different encodings and an import statement to include one in the other.
+    </p>
     <h3>
        Importing properties files and conditional logic
     </h3>
     <p>
       SciTE will automatically detect the encoding scheme used for Unicode files that
       start with a Byte Order Mark (BOM).
-      The UTF-8 and UCS-2 encodings are recognized including both Little Endian and
-      Big Endian variants of UCS-2.
+      The UTF-8 and UTF-16 encodings are recognized including both Little Endian and
+      Big Endian variants of UTF-16.
     </p>
     <p>
       UTF-8 files will also be recognised when they contain a coding cookie on one of the
         placed between the tags.
         </td>
       </tr>
-<!--++Autogenerated -- run ../../scintilla/src/LexGen.py to regenerate -->
+<!--++Autogenerated - run ../../scintilla/src/LexGen.py to regenerate -->
 <!--**\(\*\n\) -->
 	<tr>
 	<td>asp.default.language</td>
 	<td>For lines in the output pane that are matches from Find in Files or GCC-style diagnostics, style the path and line number separately from the rest of the line with style 21 used for the rest of the line. This allows matched text to be more easily distinguished from its location.</td>
 	</tr>
 	<tr>
+	<td>lexer.html.django</td>
+	<td>Set to 1 to enable the django template language.</td>
+	</tr>
+	<tr>
 	<td>lexer.html.mako</td>
 	<td>Set to 1 to enable the mako template language.</td>
 	</tr>
       <tr>
         <td>wrap.aware.home.end.keys</td>
         <td>
-          This property changes the behavior of the home and end keys when dynamic
+          This property changes the behaviour of the home and end keys when dynamic
           line wrapping is turned on.  When set to 0 (the default), the Home and End
           keys will move the caret to the very beginning / end of the 'logical'
           line, whether or not the line is wrapped over multiple lines in the display.
           On GTK+, this option only works for GTK+ 2.4 or later.
         </td>
       </tr>
+      <tr class="windowsonly">
+        <td>
+          save.filter
+        </td>
+        <td>
+          This is a complex expression used for determining the file types that will be available in
+          the save file dialog. The structure of the property is the same as open.filter.<br />
+          Does not work on GTK+.
+        </td>
+      </tr>
       <tr>
         <td>
           max.file.size
         find.replace.regexp.posix
         </td>
         <td>
-          Change behavior of Regular expression search.
+          Change behaviour of Regular expression search.
         If set to 0 (the default), characters '(' and ')' must be escaped by '\' to behave as regexp meta characters.
         If set to 1, these characters are meta characters itself.
         </td>
         </td>
         <td>
           A lexer splits a file up into syntactic pieces. SciTE can then display these pieces in
-          different visual styles. Several lexers are available in SciTE for some of the popular
+          different visual styles. Many lexers are included in SciTE for popular
           programming languages such as Python, Java, C/C++, JavaScript and VB. Often several file
           extensions (.cpp, .cc, .h) can map to one language (C++) and hence one lexer. These
-          settings associate a file name with a lexer.
+          settings associate a file name with a lexer.<br />
+          The lexers included in SciTE are written in C++ and compiled into the SciTE executable.
+          Lexers can also be written as a <a href="ScriptLexer.html">Lua script</a>.
         </td>
       </tr>
       <tr>
         Defines a command to be executed when print is invoked on GTK+.
         </td>
       </tr>
-      <tr class="windowsonly">
-        <td>
-          win95.death.delay
-        </td>
-        <td>
-          On Windows 95, there can be a delay between a process completing and all of its piped
-          output being available. By waiting this number of milliseconds, we can be sure to see all
-          the output. Defaults to 500 but may need to be higher for slower machines.
-        </td>
-      </tr>
       <tr>
         <td>
         time.commands

SciTEDownload.html

     <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
       <tr>
         <td>
-          <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scite203.zip?download">
+          <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scite211.zip?download">
 	Windows</a>&nbsp;&nbsp;
-	<a href="http://prdownloads.sourceforge.net/scintilla/scite203.tgz?download">
+	<a href="http://prdownloads.sourceforge.net/scintilla/scite211.tgz?download">
           GTK+/Linux</a>&nbsp;&nbsp;</font>
         </td>
       </tr>
       containing very few restrictions.
     </p>
     <h2>
-       Release 2.03
+       Release 2.11
     </h2>
     <h3>
        Source Code
        The source code package contains all of the source code for Scintilla and SciTE but no binary
 	executable code and is available in
        <ul>
-       <li><a href="http://prdownloads.sourceforge.net/scintilla/scite203.zip?download">zip format</a> (2000K) commonly used on Windows</li>
-       <li><a href="http://prdownloads.sourceforge.net/scintilla/scite203.tgz?download">tgz format</a> (1820K) commonly used on Linux and compatible operating systems</li>
+       <li><a href="http://prdownloads.sourceforge.net/scintilla/scite211.zip?download">zip format</a> (2000K) commonly used on Windows</li>
+       <li><a href="http://prdownloads.sourceforge.net/scintilla/scite211.tgz?download">tgz format</a> (1820K) commonly used on Linux and compatible operating systems</li>
        </ul>
        Instructions for building on both Windows and Linux are included in the readme file.
     <h3>
        Windows Executables
     </h4>
     <p>
-       A <a href="http://prdownloads.sourceforge.net/scintilla/wscite203.zip?download">full download</a> (890K) includes the SciTE executable, any required DLLs,
+       A <a href="http://prdownloads.sourceforge.net/scintilla/wscite211.zip?download">full download</a> (920K) includes the SciTE executable, any required DLLs,
       configuration files and documentation. After downloading the file, unzip it, and run
       SciTE.EXE. The files required to run SciTE are SciTE.EXE, SciLexer.DLL, and
-      SciTEGlobal.properties and these are best located in one directory on the path.
+      SciTEGlobal.properties.
     </p>
     <p>
-       A <a href="http://prdownloads.sourceforge.net/scintilla/Sc203.exe">single file executable called Sc1</a> (550K) does not need any DLL or
+       A <a href="http://prdownloads.sourceforge.net/scintilla/Sc211.exe">single file executable called Sc1</a> (580K) does not need any DLL or
       properties files as these are linked into the executable. You may still create properties
       files if you wish.
       Sc1.exe has been compressed with the
        Linux executable for Intel compatible processors
     </h4>
     <p>
-      This binary release requires GTK+ 2.8 or later and was tested on Fedora Core 5.
-      If you are using a Linux distribution more than a year old you probably
-      need to install GTK+ 2.8 or rebuild SciTE to use your existing version of GTK+.
+      This binary release requires GTK+ 2.8 or later and was tested on Fedora 12.
+      If you are using a Linux distribution more than a year old you may
+      need to rebuild SciTE to use your installed version of GTK+.
     </p>
     <p>
-       A <a href="http://prdownloads.sourceforge.net/scintilla/gscite203.tgz?download">full download</a> (790K) includes the SciTE executable,
+       A <a href="http://prdownloads.sourceforge.net/scintilla/gscite211.tgz?download">full download</a> (820K) includes the SciTE executable,
       configuration files and documentation.
       After downloading the file, gunzip and untar it, and run
       SciTE. The files required to run SciTE are SciTE which is best located on the path

SciTEGlobal.properties

 if PLAT_WINNT
 	selection.alpha=32
 	selection.back=#000000
-if PLAT_WIN95
-	selection.back=#DADADA
 if PLAT_GTK
 	selection.alpha=30
 	selection.back=#000000
 buffers=50
 #buffers.zorder.switching=1
 #api.*.cxx=d:\api\w.api
-#win95.death.delay=1000
 #locale.properties=locale.de.properties
 #translation.missing=***
 #read.only=1
 $(filter.verilog)\
 $(filter.vhdl)
 
+#save.filter=$(open.filter)
+
 # Give symbolic names to the set of fonts used in the standard styles.
 if PLAT_WIN
 	font.base=font:Verdana,size:10

SciTEUser.properties

 command.name.3.$(file.patterns.js)=Pretty JSON
 command.3.$(file.patterns.js)=cscript.exe /nologo "$(SciteDefaultHome)\prettyJson.js" "$(FilePath)"
 
+command.name.0.$(file.patterns.text)=Aspell
+command.0.$(file.patterns.text)="$(SciteDefaultHome)\Aspell\bin\aspell.exe" -c "$(FilePath)"
+
+file.patterns.tex=*.tex;*.sty;*.aux;*.toc;*.idx;*.tui;*.tuo
+command.name.4.$(file.patterns.tex)=Aspell
+command.4.$(file.patterns.tex)=cat "$(FilePath)" | "$(SciteDefaultHome)\Aspell\bin\aspell.exe" -l -t -c
+command.subsystem.4.$(file.patterns.tex)=2
+
+
 #~ file.patterns.js=*.js
 #~ command.name.2.$(file.patterns.js)=Pretty-Print JavaScript
 #~ command.2.$(file.patterns.js)=$(SciteDefaultHome)\indent.exe -js $(FileNameExt)
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>SciTE Script Lexer</title>
+<meta name="Generator" content="SciTE - www.Scintilla.org" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<style type="text/css">
+.S0 {
+	color: #FF0000;
+}
+.S2 {
+	font-family: 'Comic Sans MS';
+	color: #007F00;
+	font-size: 9pt;
+}
+.S4 {
+	color: #007F7F;
+}
+.S5 {
+	color: #00007F;
+	font-weight: bold;
+}
+.S6 {
+	color: #7F007F;
+}
+.S10 {
+	color: #000000;
+}
+.S14 {
+	color: #00007F;
+	background: #F5F5FF;
+	text-decoration: inherit;
+}
+.Z0 {
+	color: #7f007f;
+	font-weight: bold;
+}
+.Z1 {
+	color: #000000;
+}
+.Z2 {
+	color: #000080;
+	font-weight: bold;
+}
+.Z3 {
+	color: #008000;
+	font-family: 'Georgia';
+	font-size: 9pt;
+	font-style:italic;
+}
+span {
+	font-family: 'Verdana';
+	color: #000000;
+	font-size: 10pt;
+}
+.example {
+    color: #008000;
+    font-weight: bold;
+}
+DIV.example {
+	background: #F7FCF7;
+	border: 1px solid #C0D7C0;
+	margin: 0.3em 3em;
+	padding: 0.3em 0.6em;
+	font-size: 80%;
+}
+DIV.highlighted {
+	background: #F7FCF7;
+	border: 1px solid #C0D7C0;
+	margin: 0.3em 3em;
+	padding: 0.3em 0.6em;
+	font-size: 80%;
+}
+table {
+	border: 1px solid #1F1F1F;
+	border-collapse: collapse;
+}
+td {
+	border: 1px solid #1F1F1F;
+	padding: 1px 5px 1px 5px;
+}
+th {
+	border: 1px solid #1F1F1F;
+	padding: 1px 5px 1px 5px;
+}
+</style>
+</head>
+<body bgcolor="#FFFFFF">
+    <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+      <tr>
+        <td>
+          <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+        </td>
+        <td>
+          <a href="index.html" style="color:white;text-decoration:none"><font size="5">
+	  SciTE Script Lexer</font></a>
+        </td>
+      </tr>
+    </table>
+    <h3>
+       Warning
+    </h3>
+	<p>This feature is being developed and is not stable. The API may change in the future.</p>
+    <h3>
+       Writing lexers in Lua
+    </h3>
+	<p>A lexer may be written as a script in the Lua language instead of in C++.
+	This is a little simpler and allows lexers to be developed without using a C++ compiler.</p>
+	<p>A script lexer is attached by setting the file lexer to be a name that starts with "script_".
+	Styles and other properties can then be assigned using this name. For example,</p>
+	<div class="example">
+	lexer.*.zog=script_zog<br/>
+style.script_zog.0=fore:#7f007f,bold<br/>
+style.script_zog.1=fore:#000000<br/>
+style.script_zog.2=fore:#000080,bold<br/>
+style.script_zog.3=fore:#008000,font:Georgia,italics,size:9
+	</div>
+	<p>Then the lexer is implemented in Lua similar to this:</p>
+<div class="highlighted">
+<span><span class="S2">-- -*- coding: utf-8 -*-</span><br />
+<br />
+<span class="S5">function</span><span class="S0"> </span>OnStyle<span class="S10">(</span>styler<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>S_DEFAULT<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>S_IDENTIFIER<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">1</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>S_KEYWORD<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">2</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>S_UNICODECOMMENT<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">3</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>identifierCharacters<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S6">"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"</span><br />
+<br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>styler<span class="S10">:</span>StartStyling<span class="S10">(</span>styler.startPos<span class="S10">,</span><span class="S0"> </span>styler.lengthDoc<span class="S10">,</span><span class="S0"> </span>styler.initStyle<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">while</span><span class="S0"> </span>styler<span class="S10">:</span>More<span class="S10">()</span><span class="S0"> </span><span class="S5">do</span><br />
+<br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S2">-- Exit state if needed</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">if</span><span class="S0"> </span>styler<span class="S10">:</span>State<span class="S10">()</span><span class="S0"> </span><span class="S10">==</span><span class="S0"> </span>S_IDENTIFIER<span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">if</span><span class="S0"> </span><span class="S5">not</span><span class="S0"> </span>identifierCharacters<span class="S10">:</span>find<span class="S10">(</span>styler<span class="S10">:</span>Current<span class="S10">(),</span><span class="S0"> </span><span class="S4">1</span><span class="S10">,</span><span class="S0"> </span><span class="S5">true</span><span class="S10">)</span><span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>identifier<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>styler<span class="S10">:</span>Token<span class="S10">()</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">if</span><span class="S0"> </span>identifier<span class="S0"> </span><span class="S10">==</span><span class="S0"> </span><span class="S6">"if"</span><span class="S0"> </span><span class="S5">or</span><span class="S0"> </span>identifier<span class="S0"> </span><span class="S10">==</span><span class="S0"> </span><span class="S6">"end"</span><span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>styler<span class="S10">:</span>ChangeState<span class="S10">(</span>S_KEYWORD<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>styler<span class="S10">:</span>SetState<span class="S10">(</span>S_DEFAULT<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">elseif</span><span class="S0"> </span>styler<span class="S10">:</span>State<span class="S10">()</span><span class="S0"> </span><span class="S10">==</span><span class="S0"> </span>S_UNICODECOMMENT<span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">if</span><span class="S0"> </span>styler<span class="S10">:</span>Match<span class="S10">(</span><span class="S6">"»"</span><span class="S10">)</span><span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>styler<span class="S10">:</span>ForwardSetState<span class="S10">(</span>S_DEFAULT<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S2">-- Enter state if needed</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">if</span><span class="S0"> </span>styler<span class="S10">:</span>State<span class="S10">()</span><span class="S0"> </span><span class="S10">==</span><span class="S0"> </span>S_DEFAULT<span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">if</span><span class="S0"> </span>styler<span class="S10">:</span>Match<span class="S10">(</span><span class="S6">"«"</span><span class="S10">)</span><span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>styler<span class="S10">:</span>SetState<span class="S10">(</span>S_UNICODECOMMENT<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">elseif</span><span class="S0"> </span>identifierCharacters<span class="S10">:</span>find<span class="S10">(</span>styler<span class="S10">:</span>Current<span class="S10">(),</span><span class="S0"> </span><span class="S4">1</span><span class="S10">,</span><span class="S0"> </span><span class="S5">true</span><span class="S10">)</span><span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>styler<span class="S10">:</span>SetState<span class="S10">(</span>S_IDENTIFIER<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>styler<span class="S10">:</span>Forward<span class="S10">()</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>styler<span class="S10">:</span>EndStyling<span class="S10">()</span><br />
+<span class="S5">end</span><br />
+<span class="S0"></span></span>
+</div>
+
+<p>
+The result looks like
+</p>
+
+<div class="highlighted">
+<span><span class="Z1">proc</span><span class="Z0"> </span><span class="Z1">clip</span><span class="Z0">(</span><span class="Z1">int</span><span class="Z0"> </span><span class="Z1">a</span><span class="Z0">)</span><br />
+<span class="Z3">« Clip into the positive zone »</span><br />
+<span class="Z2">if</span><span class="Z0"> (</span><span class="Z1">a</span><span class="Z0"> &gt; 0) </span><span class="Z1">a</span><br />
+<span class="Z0">0</span><br />
+<span class="Z2">end</span></span>
+</div>
+<br />
+<h3>Code Structure</h3>
+<h4>Document Loop</h4>
+<p>The lexer loops through the part of the document indicated assigning a style to each character.</p>
+<div class="highlighted">
+<span>styler:StartStyling<span class="S10">(</span>styler.startPos<span class="S10">,</span><span class="S0"> </span>styler.lengthDoc<span class="S10">,</span><span class="S0"> </span>styler.initStyle<span class="S10"><span class="S10">)</span><br />
+<span class="S5">while</span><span class="S0"> </span>styler:More<span class="S10">()</span><span class="S0"> </span><span class="S5">do</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S2">-- Code that examines the text and sets lexical states</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>styler:Forward<span class="S10">()</span><br />
+<span class="S5">end</span><br />
+styler:EndStyling<span class="S10">()</span><br />
+</span></div>
+<p>There are many different ways to structure the code that examines the text and sets lexical states.
+A structure that has proven useful in C++ lexers is to write two blocks of code as shown in the example.
+The first block checks if the current state should end and if so sets the state to the default 0.
+The second block is responsible for detecting whether a new state should be entered from the default state.
+This structure means everything is dealt with as switching from or to the default state and avoids having to consider many
+combinations of states.</p>
+<h4>Encodings</h4>
+<p>The styler iterates over whole characters rather than bytes. Thus if the document is encoded in UTF-8, styler:Current() may be a multibyte string. If the script is also encoded in UTF-8,
+then it is easy to check against Unicode characters with code like</p>
+<div class="highlighted">
+<span><span class="S5">if</span><span class="S0"> </span>styler:Current<span class="S10">()</span><span class="S0"> </span><span class="S10">==</span><span class="S0"> </span><span class="S6">"«"</span><span class="S5"> then</span><br />
+</span></div>
+<p>If using an encoding like Latin-1 and the script is also encoded in the same encoding then literals can be used as above.</p>
+<p>If the language can be encoded in different ways then more complex code may be needed along with encoding-specific code.</p>
+<h4>Checking Before</h4>
+<p>Sometimes a lexer needs to see some information earlier in the file, perhaps a declaration changes the syntax or the particular form of quote
+at the start of a string must be matched at its end. Since the standard loop only goes forward from the starting position, different calls must be used like CharAt and StyleAt.
+These use byte positions and do not treat multi-byte characters as single entities.</p>
+<h4>Performance</h4>
+<p>The lexer above can lex approximately 90K per second on a 2.4 GHz Athlon 64. For most situations, this will
+feel completely fluid.</p>
+<p>More complex lexers will be slower. If a lexer is so slow that the application becomes unresponsive then
+the lexer can choose to split up each request. It can do so by deciding upon a range of whole lines and using this range as the
+arguments to StartStyling. This allows the user's keystrokes and mouse moves to be processed.
+The lexer will automatically be called again to lex more of the document.</p>
+<br />
+<h3>API</h3>
+<p>The API of the styler object passed to OnStyle:</p>
+<table cellpadding="0" cellspacing="0" border="1"  summary="Command line escape sequences">
+<thead>
+	<tr><th>Name</th><th>Explanation</th></tr>
+</thead>
+	<tr><td>StartStyling(startPos, length, initStyle)</td>
+	<td>Start setting styles from startPos for length with initial style initStyle</td></tr>
+	<tr><td>EndStyling()</td>
+	<td>Styling has been completed so tidy up</td></tr>
+	<tr><td>More() → boolean</td>
+	<td>Are there any more characters to process</td></tr>
+	<tr><td>Forward()</td>
+	<td>Move forward one character</td></tr>
+	<tr><td>Position() → integer</td>
+	<td>What is the position in the document of the current character</td></tr>
+	<tr><td>AtLineStart() → boolean</td>
+	<td>Is the current character the first on a line</td></tr>
+	<tr><td>AtLineEnd() → boolean</td>
+	<td>Is the current character the last on a line</td></tr>
+	<tr><td>State() → integer</td>
+	<td>The current lexical state value</td></tr>
+	<tr><td>SetState(state)</td>
+	<td>Set the style of the current token to the current state and then change the state to the argument</td></tr>
+	<tr><td>ForwardSetState(state)</td>
+	<td>Combination of moving forward and setting the state. Useful when the current character is a token terminator like " for a string.</td></tr>
+	<tr><td>ChangeState(state)</td>
+	<td>Change the current state so that the state of the current token will be set to the argument</td></tr>
+	<tr><td>Current() → string</td>
+	<td>The current character</td></tr>
+	<tr><td>Next() → string</td>
+	<td>The next character</td></tr>
+	<tr><td>Previous() → string</td>
+	<td>The previous character</td></tr>
+	<tr><td>Token() → string</td>
+	<td>The current token</td></tr>
+	<tr><td>Match(string) → boolean</td>
+	<td>Is the text from the current position the same as the argument?</td></tr>
+
+	<tr><td>Line(position) → integer</td>
+	<td>Convert a byte position into a line number</td></tr>
+	<tr><td>CharAt(position) → integer</td>
+	<td>Unsigned byte value at argument</td></tr>
+	<tr><td>StyleAt(position) → integer</td>
+	<td>Style value at argument</td></tr>
+	<tr><td>LevelAt(line) → integer</td>
+	<td>Fold level for a line</td></tr>
+	<tr><td>SetLevelAt(line)</td>
+	<td>Set the fold level for a line</td></tr>
+	<tr><td>LineState(line) → integer</td>
+	<td>State value for a line</td></tr>
+	<tr><td>SetLineState(line)</td>
+	<td>Set state value for a line. This can be used to store extra information from lexing,
+	such as a current language mode, so that there is no need to look back in the document.</td></tr>
+
+	<tr><td>startPos : integer</td>
+	<td>Start of the range to be lexed</td></tr>
+	<tr><td>lengthDoc : integer</td>
+	<td>Length of the range to be lexed</td></tr>
+	<tr><td>initStyle : integer</td>
+	<td>Starting style</td></tr>
+	<tr><td>language : string</td>
+	<td>Name of the language. Allows implementation of multiple languages with one OnStyle function.</td></tr>
+</table>
+<br />
+    <h3>
+       A line-oriented example.
+    </h3>
+    <p>This example is for a line-oriented language as is sometimes used for configuration files.
+    It uses low level direct calls instead of the StartStyling/More/Forward/EndStyling calls.</p>
+<div class="highlighted">
+<span><span class="S2">-- A line oriented lexer - style the line according to the first character</span><br />
+<span class="S5">function</span><span class="S0"> </span>OnStyle<span class="S10">(</span>styler<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>lineStart<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>editor<span class="S10">:</span>LineFromPosition<span class="S10">(</span>styler.startPos<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>lineEnd<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>editor<span class="S10">:</span>LineFromPosition<span class="S10">(</span>styler.startPos<span class="S0"> </span><span class="S10">+</span><span class="S0"> </span>styler.lengthDoc<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span>editor<span class="S10">:</span>StartStyling<span class="S10">(</span>styler.startPos<span class="S10">,</span><span class="S0"> </span><span class="S4">31</span><span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">for</span><span class="S0"> </span>line<span class="S10">=</span>lineStart<span class="S10">,</span>lineEnd<span class="S10">,</span><span class="S4">1</span><span class="S0"> </span><span class="S5">do</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>lengthLine<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>editor<span class="S10">:</span>PositionFromLine<span class="S10">(</span>line<span class="S10">+</span><span class="S4">1</span><span class="S10">)</span><span class="S0"> </span><span class="S10">-</span><span class="S0"> </span>editor<span class="S10">:</span>PositionFromLine<span class="S10">(</span>line<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>lineText<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>editor<span class="S10">:</span>GetLine<span class="S10">(</span>line<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>first<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S14">string.sub</span><span class="S10">(</span>lineText<span class="S10">,</span><span class="S4">1</span><span class="S10">,</span><span class="S4">1</span><span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>style<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">if</span><span class="S0"> </span>first<span class="S0"> </span><span class="S10">==</span><span class="S0"> </span><span class="S6">"+"</span><span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>style<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">1</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">elseif</span><span class="S0"> </span>first<span class="S0"> </span><span class="S10">==</span><span class="S0"> </span><span class="S6">" "</span><span class="S0"> </span><span class="S5">or</span><span class="S0"> </span>first<span class="S0"> </span><span class="S10">==</span><span class="S0"> </span><span class="S6">"\t"</span><span class="S0"> </span><span class="S5">then</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>style<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">2</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>editor<span class="S10">:</span>SetStyling<span class="S10">(</span>lengthLine<span class="S10">,</span><span class="S0"> </span>style<span class="S10">)</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">end</span><br />
+<span class="S5">end</span><br />
+<span class="S0"></span></span>
+</div>
+
+</body>
+</html>
 override public protected private extern throws requires ensures yields out ref lock \
 using true false null delete generic new this typeof sizeof as owned int string char bool
 
-keywords.$(file.patterns.vala))=$(keywordclass.vala)
+keywords.$(file.patterns.vala)=$(keywordclass.vala)
 keywords2.$(file.patterns.vala)=$(keywordclass2.vala)
 
 # C++ styles
 # SGML / DTD keywords
 keywords6.$(file.patterns.mako)=ELEMENT DOCTYPE ATTLIST ENTITY NOTATION
 
+# For Django's template language. Since Django seems to use the same .html extension
+# as plain HTML, it is up to the user to integrate these keywords if desired.
+keywordclass.django= not in autoescape with \
+csrf_token cycle empty block endblock filter endfilter for endfor firstof \
+if endif ifchanged endifchanged ifequal endifequal include load now regroup spaceless \
+endspaceless ssi url widthratio add addslashes capfirst center cut date \
+default default_if_none dictsort dictsortreversed divisibleby escape escapejs \
+filesizeformat first fix_ampersands float_format force_escape get_digit \
+iriencode join last length length_is linebreaks linebreaksbr linenumbers ljust \
+lower make_list phone2numeric pluralize pprint random removetags rjust safe \
+safeseq slice slugify stringformat striptags time timesince timeuntil title \
+truncatewords truncatewords_html unordered_list upper urlencode urlize \
+urlizetrunc wordcount wordwrap yesno apnumber intcomma intword ordinal \
+naturalday lorem
 keywords.$(file.patterns.docbook)=$(keywordclass.docbook)
 keywords6.$(file.patterns.docbook)=ELEMENT DOCTYPE ATTLIST ENTITY NOTATION
 # END DocBook