[gtksourceview/gnome-3-24] language-specs: sync all *.lang files from GtkSourceView 4



commit 4678ec163d2f3d38b36b435abee0ed651befadf5
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Mar 14 11:28:43 2018 +0100

    language-specs: sync all *.lang files from GtkSourceView 4

 data/language-specs/Makefile.am       |    2 +
 data/language-specs/fortran.lang      |  126 ++++++++++++++-
 data/language-specs/groovy.lang       |   13 +--
 data/language-specs/tera.lang         |  142 +++++++++++++++++
 data/language-specs/toml.lang         |  282 +++++++++++++++++++++++++++++++++
 po/POTFILES.skip                      |    2 +
 tests/syntax-highlighting/file.cmake  |   39 +++++
 tests/syntax-highlighting/file.groovy |   55 +++++++
 tests/syntax-highlighting/file.tera   |   15 ++
 tests/syntax-highlighting/file.toml   |   47 ++++++
 10 files changed, 710 insertions(+), 13 deletions(-)
---
diff --git a/data/language-specs/Makefile.am b/data/language-specs/Makefile.am
index 98c8371..aea1b60 100644
--- a/data/language-specs/Makefile.am
+++ b/data/language-specs/Makefile.am
@@ -119,8 +119,10 @@ LANGUAGES =                        \
        systemverilog.lang      \
        t2t.lang                \
        tcl.lang                \
+       tera.lang               \
        texinfo.lang            \
        thrift.lang             \
+       toml.lang               \
        vala.lang               \
        vbnet.lang              \
        verilog.lang            \
diff --git a/data/language-specs/fortran.lang b/data/language-specs/fortran.lang
index 0b540c6..9aecbf4 100644
--- a/data/language-specs/fortran.lang
+++ b/data/language-specs/fortran.lang
@@ -143,41 +143,63 @@
     </context>
 
     <context id="keywords" style-ref="keyword">
-      <keyword>abstract interface</keyword>
+      <keyword>abstract</keyword>
       <keyword>allocate</keyword>
       <keyword>assign</keyword>
       <keyword>assignment</keyword>
-      <keyword>block data</keyword>
+      <keyword>associate</keyword>
+      <keyword>bind</keyword>
+      <keyword>block</keyword>
       <keyword>call</keyword>
       <keyword>case</keyword>
       <keyword>class</keyword>
       <keyword>common</keyword>
       <keyword>contains</keyword>
       <keyword>continue</keyword>
+      <keyword>critical</keyword>
       <keyword>cycle</keyword>
       <keyword>data</keyword>
       <keyword>deallocate</keyword>
       <keyword>default</keyword>
-      <keyword>do</keyword>
       <keyword>do concurrent</keyword>
+      <keyword>do</keyword>
       <keyword>elemental</keyword>
       <keyword>elseif</keyword>
       <keyword>else</keyword>
       <keyword>elsewhere</keyword>
+      <keyword>endassociate</keyword>
+      <keyword>endblock</keyword>
+      <keyword>endcritical</keyword>
       <keyword>enddo</keyword>
+      <keyword>endenum</keyword>
+      <keyword>endfunction</keyword>
       <keyword>endif</keyword>
+      <keyword>endinterface</keyword>
+      <keyword>endmodule</keyword>
+      <keyword>endprocedure</keyword>
+      <keyword>endprogram</keyword>
       <keyword>endselect</keyword>
+      <keyword>endsubmodule</keyword>
+      <keyword>endsubroutine</keyword>
       <keyword>end</keyword>
+      <keyword>enum</keyword>
       <keyword>entry</keyword>
       <keyword>equivalence</keyword>
+      <keyword>error stop</keyword>
       <keyword>exit</keyword>
+      <keyword>extends</keyword>
       <keyword>external</keyword>
+      <keyword>final</keyword>
       <keyword>forall</keyword>
       <keyword>function</keyword>
+      <keyword>generic</keyword>
       <keyword>go to</keyword>
       <keyword>goto</keyword>
       <keyword>if</keyword>
       <keyword>implicit none</keyword>
+      <keyword>implicit</keyword>
+      <keyword>import</keyword>
+      <keyword>impure</keyword>
       <keyword>in</keyword>
       <keyword>[^#]include</keyword>
       <keyword>inout</keyword>
@@ -185,6 +207,7 @@
       <keyword>intrinsic</keyword>
       <keyword>kind</keyword>
       <keyword>len</keyword>
+      <keyword>lock</keyword>
       <keyword>module</keyword>
       <keyword>namelist</keyword>
       <keyword>nullify</keyword>
@@ -202,9 +225,14 @@
       <keyword>save</keyword>
       <keyword>select</keyword>
       <keyword>stop</keyword>
+      <keyword>submodule</keyword>
       <keyword>subroutine</keyword>
+      <keyword>sync all</keyword>
+      <keyword>sync images</keyword>
+      <keyword>sync memory</keyword>
       <keyword>then</keyword>
       <keyword>type</keyword>
+      <keyword>unlock</keyword>
       <keyword>use</keyword>
       <keyword>where</keyword>
       <keyword>while</keyword>
@@ -220,6 +248,7 @@
       <keyword>print</keyword>
       <keyword>read</keyword>
       <keyword>rewind</keyword>
+      <keyword>wait</keyword>
       <keyword>write</keyword>
     </context>
 
@@ -242,6 +271,7 @@
       <keyword>iostat</keyword>
       <keyword>name</keyword>
       <keyword>named</keyword>
+      <keyword>newunit</keyword>
       <keyword>nextrec</keyword>
       <keyword>nml</keyword>
       <keyword>number</keyword>
@@ -261,6 +291,7 @@
     <context id="intrinsics" style-ref="intrinsic">
       <keyword>abs</keyword>
       <keyword>achar</keyword>
+      <keyword>acosh</keyword>
       <keyword>acos</keyword>
       <keyword>adjustl</keyword>
       <keyword>adjustr</keyword>
@@ -278,10 +309,24 @@
       <keyword>amod</keyword>
       <keyword>anint</keyword>
       <keyword>any</keyword>
+      <keyword>asinh</keyword>
       <keyword>asin</keyword>
       <keyword>associated</keyword>
       <keyword>atan2</keyword>
+      <keyword>atanh</keyword>
       <keyword>atan</keyword>
+      <keyword>atomic_define</keyword>
+      <keyword>atomic_ref</keyword>
+      <keyword>bessel_j0</keyword>
+      <keyword>bessel_j1</keyword>
+      <keyword>bessel_jn</keyword>
+      <keyword>bessel_y0</keyword>
+      <keyword>bessel_y1</keyword>
+      <keyword>bessel_yn</keyword>
+      <keyword>bge</keyword>
+      <keyword>bgt</keyword>
+      <keyword>ble</keyword>
+      <keyword>blt</keyword>
       <keyword>bit_size</keyword>
       <keyword>btest</keyword>
       <keyword>c_associated</keyword>
@@ -303,6 +348,8 @@
       <keyword>clog</keyword>
       <keyword>cmplx</keyword>
       <keyword>command_argument_count</keyword>
+      <keyword>compiler_options</keyword>
+      <keyword>compiler_version</keyword>
       <keyword>conjg</keyword>
       <keyword>cosh</keyword>
       <keyword>cos</keyword>
@@ -347,6 +394,8 @@
       <keyword>dnint</keyword>
       <keyword>dot_product</keyword>
       <keyword>dprod</keyword>
+      <keyword>dshiftl</keyword>
+      <keyword>dshiftr</keyword>
       <keyword>dsign</keyword>
       <keyword>dsinh</keyword>
       <keyword>dsin</keyword>
@@ -355,12 +404,16 @@
       <keyword>dtan</keyword>
       <keyword>eoshift</keyword>
       <keyword>epsilon</keyword>
+      <keyword>erfc_scaled</keyword>
       <keyword>erfc</keyword>
       <keyword>erf</keyword>
+      <keyword>execute_command_line</keyword>
       <keyword>exp</keyword>
       <keyword>exponent</keyword>
+      <keyword>findloc</keyword>
       <keyword>float</keyword>
       <keyword>floor</keyword>
+      <keyword>flush</keyword>
       <keyword>fraction</keyword>
       <keyword>gamma</keyword>
       <keyword>getarg</keyword>
@@ -368,9 +421,12 @@
       <keyword>get_command_argument</keyword>
       <keyword>get_environment_variable</keyword>
       <keyword>huge</keyword>
+      <keyword>hypot</keyword>
       <keyword>iabs</keyword>
       <keyword>iachar</keyword>
+      <keyword>iall</keyword>
       <keyword>iand</keyword>
+      <keyword>iany</keyword>
       <keyword>iargc</keyword>
       <keyword>ibclr</keyword>
       <keyword>ibits</keyword>
@@ -379,12 +435,47 @@
       <keyword>idim</keyword>
       <keyword>idint</keyword>
       <keyword>idnint</keyword>
+      <keyword>ieee_class</keyword>
+      <keyword>ieee_copy_sign</keyword>
+      <keyword>ieee_get_flag</keyword>
+      <keyword>ieee_get_halting_mode</keyword>
+      <keyword>ieee_get_rounding_mode</keyword>
+      <keyword>ieee_get_status</keyword>
+      <keyword>ieee_is_finite</keyword>
+      <keyword>ieee_is_nan</keyword>
+      <keyword>ieee_is_negative</keyword>
+      <keyword>ieee_is_normal</keyword>
+      <keyword>ieee_logb</keyword>
+      <keyword>ieee_next_after</keyword>
+      <keyword>ieee_rem</keyword>
+      <keyword>ieee_rint</keyword>
+      <keyword>ieee_scalb</keyword>
+      <keyword>ieee_selected_real_kind</keyword>
+      <keyword>ieee_set_flag</keyword>
+      <keyword>ieee_set_halting_mode</keyword>
+      <keyword>ieee_set_rounding_mode</keyword>
+      <keyword>ieee_set_status</keyword>
+      <keyword>ieee_support_datatype</keyword>
+      <keyword>ieee_support_denormal</keyword>
+      <keyword>ieee_support_divide</keyword>
+      <keyword>ieee_support_flag</keyword>
+      <keyword>ieee_support_halting</keyword>
+      <keyword>ieee_support_inf</keyword>
+      <keyword>ieee_support_nan</keyword>
+      <keyword>ieee_support_rounding</keyword>
+      <keyword>ieee_support_sqrt</keyword>
+      <keyword>ieee_support_standard</keyword>
+      <keyword>ieee_unordered</keyword>
+      <keyword>ieee_value</keyword>
       <keyword>ieor</keyword>
       <keyword>ifix</keyword>
+      <keyword>image_index</keyword>
       <keyword>index</keyword>
       <keyword>int</keyword>
       <keyword>ior</keyword>
+      <keyword>iparity</keyword>
       <keyword>iqint</keyword>
+      <keyword>is_contiguous</keyword>
       <keyword>is_iostat_end</keyword>
       <keyword>is_iostat_eor</keyword>
       <keyword>ishftc</keyword>
@@ -392,6 +483,8 @@
       <keyword>isign</keyword>
       <keyword>kind</keyword>
       <keyword>lbound</keyword>
+      <keyword>lcobound</keyword>
+      <keyword>leadz</keyword>
       <keyword>len_trim</keyword>
       <keyword>len</keyword>
       <keyword>lge</keyword>
@@ -399,9 +492,12 @@
       <keyword>lle</keyword>
       <keyword>llt</keyword>
       <keyword>loc</keyword>
+      <keyword>log_gamma</keyword>
       <keyword>log10</keyword>
       <keyword>log</keyword>
       <keyword>logical</keyword>
+      <keyword>maskl</keyword>
+      <keyword>maskr</keyword>
       <keyword>matmul</keyword>
       <keyword>max0</keyword>
       <keyword>max1</keyword>
@@ -409,6 +505,7 @@
       <keyword>maxloc</keyword>
       <keyword>maxval</keyword>
       <keyword>max</keyword>
+      <keyword>merge_bits</keyword>
       <keyword>merge</keyword>
       <keyword>min0</keyword>
       <keyword>min1</keyword>
@@ -426,8 +523,12 @@
       <keyword>norm2</keyword>
       <keyword>not</keyword>
       <keyword>null</keyword>
+      <keyword>num_images</keyword>
       <keyword>or</keyword>
       <keyword>pack</keyword>
+      <keyword>parity</keyword>
+      <keyword>popcnt</keyword>
+      <keyword>poppar</keyword>
       <keyword>precision</keyword>
       <keyword>present</keyword>
       <keyword>product</keyword>
@@ -474,6 +575,9 @@
       <keyword>selected_real_kind</keyword>
       <keyword>set_exponent</keyword>
       <keyword>shape</keyword>
+      <keyword>shifta</keyword>
+      <keyword>shiftl</keyword>
+      <keyword>shiftr</keyword>
       <keyword>sign</keyword>
       <keyword>sinh</keyword>
       <keyword>sin</keyword>
@@ -482,15 +586,19 @@
       <keyword>spacing</keyword>
       <keyword>spread</keyword>
       <keyword>sqrt</keyword>
+      <keyword>storage_size</keyword>
       <keyword>sum</keyword>
       <keyword>system_clock</keyword>
       <keyword>tanh</keyword>
       <keyword>tan</keyword>
+      <keyword>this_image</keyword>
       <keyword>tiny</keyword>
+      <keyword>trailz</keyword>
       <keyword>transfer</keyword>
       <keyword>transpose</keyword>
       <keyword>trim</keyword>
       <keyword>ubound</keyword>
+      <keyword>ucobound</keyword>
       <keyword>unpack</keyword>
       <keyword>verify</keyword>
       <keyword>zabs</keyword>
@@ -507,6 +615,7 @@
       <keyword>complex</keyword>
       <keyword>double complex</keyword>
       <keyword>double precision</keyword>
+      <keyword>enumerator</keyword>
       <keyword>integer</keyword>
       <keyword>logical</keyword>
       <keyword>procedure</keyword>
@@ -515,17 +624,28 @@
 
     <context id="type-attributes" style-ref="type">
       <keyword>allocatable</keyword>
+      <keyword>asynchronous</keyword>
+      <keyword>codimension</keyword>
+      <keyword>contiguous</keyword>
+      <keyword>deferred</keyword>
       <keyword>dimension</keyword>
       <keyword>external</keyword>
       <keyword>intent</keyword>
       <keyword>intrinsic</keyword>
+      <keyword>non_overridable</keyword>
+      <keyword>nopass</keyword>
       <keyword>optional</keyword>
       <keyword>parameter</keyword>
+      <keyword>pass</keyword>
       <keyword>pointer</keyword>
       <keyword>private</keyword>
+      <keyword>protected</keyword>
       <keyword>public</keyword>
       <keyword>save</keyword>
+      <keyword>synchronous</keyword>
       <keyword>target</keyword>
+      <keyword>value</keyword>
+      <keyword>volatile</keyword>
     </context>
 
     <context id="attributes">
diff --git a/data/language-specs/groovy.lang b/data/language-specs/groovy.lang
index a91ae7a..a991433 100644
--- a/data/language-specs/groovy.lang
+++ b/data/language-specs/groovy.lang
@@ -172,18 +172,11 @@
 
     <context id="dollar-slashy-string" style-ref="string" class="string">
       <start extended="true">
-        # Strictly speaking, a dollar slashy string has the same requirements on the
-        # preceding token as a plain slashy string, but if those requirements aren't
-        # met, it's parsed as a dollar followed by a division operator, which isn't
-        # legal. So we don't bother with accounting for that case.
-
         \$/
 
-        # We will, however, account for the case when there's a slash right after
-        # the initial $/. In that case, the construct is actually parsed as a dollar
-        # followed by a single-line comment. Which is still illegal... but as least
-        # this check is easy to implement.
-        (?=[^/])
+        # Dollar slashy strings can't be empty (a would-be empty one is parsed
+        # as a dollar followed by a single-line comment instead).
+        (?! /\$)
       </start>
       <end>/\$</end>
       <include>
diff --git a/data/language-specs/tera.lang b/data/language-specs/tera.lang
new file mode 100644
index 0000000..31af1ae
--- /dev/null
+++ b/data/language-specs/tera.lang
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ This file is part of GtkSourceView
+
+ Copyright (C) 2018 Tobias Schönberg <tobias47n9e gmail 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="tera" _name="Tera Template" version="2.0" _section="Markup">
+  <metadata>
+    <property name="globs">*.tera</property>
+    <property name="line-comment-start">**</property>
+    <property name="block-comment-start">**</property>
+    <property name="block-comment-end">**</property>
+  </metadata>
+
+  <styles>
+    <style id="comment"         name="Comment" map-to="def:comment"/>
+    <style id="error"           name="Error" map-to="def:error"/>
+    <style id="escape"          name="Escaped Character" map-to="def:special-char"/>
+    <style id="string"          name="String" map-to="def:string"/>
+    <style id="keyword"         name="Keyword" map-to="def:keyword"/>
+    <style id="filters"         name="Null Value" map-to="def:function"/>
+    <style id="boolean"         name="Boolean value" map-to="def:boolean"/>
+    <style id="floating-point"  name="Floating point number" map-to="def:floating-point"/>
+    <style id="decimal"         name="Decimal number" map-to="def:decimal"/>
+    <style id="octal"           name="Octal number" map-to="def:base-n-integer"/>
+    <style id="hexadecimal"     name="Hexadecimal number" map-to="def:base-n-integer"/>
+  </styles>
+
+  <definitions>
+    <context id="keywords" style-ref="keyword">
+      <prefix>\s</prefix>
+      <suffix>\b</suffix>
+        <keyword>and</keyword>
+        <keyword>as</keyword>
+        <keyword>block</keyword>
+        <keyword>elif</keyword>
+        <keyword>else</keyword>
+        <keyword>endblock</keyword>
+        <keyword>endfor</keyword>
+        <keyword>endif</keyword>
+        <keyword>endmacro</keyword>
+        <keyword>endraw</keyword>
+        <keyword>extends</keyword>
+        <keyword>for</keyword>
+        <keyword>if</keyword>
+        <keyword>import</keyword>
+        <keyword>include</keyword>
+        <keyword>in</keyword>
+        <keyword>is</keyword>
+        <keyword>macro</keyword>
+        <keyword>not</keyword>
+        <keyword>or</keyword>
+        <keyword>raw</keyword>
+        <keyword>set_global</keyword>
+        <keyword>set</keyword>
+    </context>
+
+    <context id="filters" style-ref="filters">
+      <prefix>\|</prefix>
+        <keyword>addslashes</keyword>
+        <keyword>capitalize</keyword>
+        <keyword>date</keyword>
+        <keyword>default</keyword>
+        <keyword>escape</keyword>
+        <keyword>filesizeformat</keyword>
+        <keyword>first</keyword>
+        <keyword>get</keyword>
+        <keyword>join</keyword>
+        <keyword>json_encode</keyword>
+        <keyword>last</keyword>
+        <keyword>length</keyword>
+        <keyword>lower</keyword>
+        <keyword>pluralize</keyword>
+        <keyword>replace</keyword>
+        <keyword>reverse</keyword>
+        <keyword>round</keyword>
+        <keyword>safe</keyword>
+        <keyword>slice</keyword>
+        <keyword>slugify</keyword>
+        <keyword>sort</keyword>
+        <keyword>split</keyword>
+        <keyword>striptags</keyword>
+        <keyword>title</keyword>
+        <keyword>trim</keyword>
+        <keyword>truncate</keyword>
+        <keyword>urlencode</keyword>
+        <keyword>wordcount</keyword>
+    </context>
+
+    <context id="tera-block" end-at-line-end="true">
+      <start>&#123;(&#123;|&#37;)(/?)</start>
+      <end>(&#125;|&#37;)&#125;</end>
+      <include>
+        <context sub-pattern="0" where="start" style-ref="boolean"/>
+        <context sub-pattern="0" where="end" style-ref="boolean"/>
+        <context ref="dtl:double-quoted-string"/>
+        <context ref="dtl:single-quoted-string"/>
+        <context ref="keywords"/>
+        <context ref="filters"/>
+        <context ref="dtl:boolean"/>
+        <context ref="dtl:float"/>
+        <context ref="dtl:decimal-number"/>
+        <context ref="rust:scope"/>
+      </include>
+    </context>
+
+    <context id="tera-comment-block" style-ref="comment" end-at-line-end="true">
+      <start>&#123;(&#35;)(/?)</start>
+      <end>(&#35;)&#125;</end>
+      <include>
+        <context sub-pattern="0" where="start" style-ref="comment"/>
+        <context sub-pattern="0" where="end" style-ref="comment"/>
+      </include>
+    </context>
+
+    <replace id="html:embedded-lang-hook" ref="tera-block"/>
+
+    <context id="tera">
+      <include>
+        <context ref="tera-comment-block"/>
+        <context ref="tera-block"/>
+        <context ref="html:html"/>
+      </include>
+    </context>
+  </definitions>
+</language>
diff --git a/data/language-specs/toml.lang b/data/language-specs/toml.lang
new file mode 100644
index 0000000..eedf21f
--- /dev/null
+++ b/data/language-specs/toml.lang
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ This file is part of GtkSourceView
+
+ Author: Liviu Dumea <liviu dumea ro gmail com>
+ Copyright (C) 2015, 2018 by Liviu Dumea <liviu dumea ro gmail 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, see <http://www.gnu.org/licenses/>.
+-->
+
+<language id="toml" name="TOML" version="2.0" _section="Other">
+  <metadata>
+    <property name="globs">*.toml;*.tml;*.lock</property>
+    <property name="line-comment-start">#</property>
+  </metadata>
+
+  <styles>
+    <style id="comment" name="Comment" map-to="def:comment"/>
+    <style id="floating-point" name="Floating Point" map-to="def:floating-point"/>
+    <style id="string" name="String" map-to="def:string"/>
+    <style id="keyword" name="Keyword" map-to="def:keyword"/>
+    <style id="decimal" name="Decimal" map-to="def:decimal"/>
+    <style id="variable" name="Variable" map-to="def:type"/>
+    <style id="non-standard-key" name="Data Type" map-to="def:type"/>
+    <style id="boolean-value" name="Boolean value" map-to="def:boolean"/>
+    <style id="datetime-value" name="Datetime value" map-to="def:constant"/>
+    <style id="error" name="Error" map-to="def:error"/>
+  </styles>
+
+  <definitions>
+    <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" 
class-disabled="no-spell-check">
+      <start>#</start>
+      <end>$</end>
+    </context>
+
+    <context id="table-entry">
+      <include>
+        <context ref="array-table"/>
+        <context ref="table"/>
+        <context ref="line-comment" />
+      </include>
+    </context>
+
+    <context id="table" style-ref="keyword">
+      <start>^\s*\[</start>
+      <end>\]</end>
+    </context>
+
+    <context id="array-table" style-ref="keyword">
+      <start>^\s*\[\[</start>
+      <end>\]\]</end>
+    </context>
+
+    <context id="variable" style-ref="variable">
+      <match>[a-zA-Z0-9_.-]*</match>
+    </context>
+
+    <context id="datetime-value" style-ref="datetime-value">
+      
<match>(\d{4})(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))</match>
+    </context>
+
+    <context id="datetime-not-strict-value" style-ref="datetime-value">
+      
<match>((\d{4})(-)?(\d\d)(-)?(\d\d)(T|\s)?)?(\d\d)(:)?(\d\d)(:)?(\d\d)(.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))?</match>
+    </context>
+
+    <context id="boolean-value" style-ref="boolean-value">
+      <keyword>true</keyword>
+      <keyword>false</keyword>
+    </context>
+
+    <context id="integer" style-ref="decimal">
+      <match>[+\-]?(?:[1-9][0-9_]*|0)(?![.eE])</match>
+    </context>
+
+    <context id="float" style-ref="floating-point">
+      <match>[+\-]?(?:[1-9][0-9_]*|0)(?:\.[0-9_]+)?(?:[eE][+\-]?[0-9_]+)?</match>
+    </context>
+
+    <context id="catch-all" style-ref="error" extend-parent="false">
+      <match>\S</match>
+    </context>
+
+    <define-regex id="hex_digit" extended="true">
+      [0-9a-fA-F]
+    </define-regex>
+
+    <define-regex id="common_escape" extended="true">
+      '|"|
+      \\|n|r|t|0|
+      x\%{hex_digit}{2}
+    </define-regex>
+
+    <define-regex id="unicode_escape" extended="true">
+      u{\%{hex_digit}{1,6}}
+    </define-regex>
+
+    <context id="hex-number" style-ref="decimal">
+        <match>0[xX][0-9a-fA-F][_0-9a-fA-F]*</match>
+    </context>
+
+    <context id="octal-number" style-ref="decimal">
+        <match>0o[0-7][_0-7]*</match>
+    </context>
+
+    <context id="binary-number" style-ref="decimal">
+        <match>0[bB][01][_01]*</match>
+    </context>
+
+    <context id="infinity-number" style-ref="floating-point">
+        <match>[+-]?inf</match>
+    </context>
+
+    <context id="not-a-number" style-ref="floating-point">
+        <match>[+-]?nan</match>
+    </context>
+
+    <context id="string_escape" style-ref="def:special-char">
+      <match>\\\%{common_escape}|\\\%{unicode_escape}</match>
+    </context>
+
+    <context id="basic-string" style-ref="string" class="string" end-at-line-end="true" 
class-disabled="no-spell-check">
+      <start>"</start>
+      <end>"</end>
+      <include>
+        <context ref="string_escape"/>
+      </include>
+    </context>
+
+    <context id="multiline-basic-string" style-ref="string"  class="string" class-disabled="no-spell-check">
+      <start>"""</start>
+      <end>"""</end>
+      <include>
+        <context ref="string_escape"/>
+        <context ref="def:line-continue"/>
+      </include>
+    </context>
+
+    <context id="literal-string" style-ref="string">
+      <start>'</start>
+      <end>'</end>
+    </context>
+
+    <context id="multiline-literal-string" style-ref="string" class="string" class-disabled="no-spell-check">
+      <start>'''</start>
+      <end>'''</end>
+      <include>
+        <context ref="def:line-continue"/>
+      </include>
+    </context>
+
+    <context id="array">
+      <start>\[</start>
+      <end>\]</end>
+      <include>
+        <context>
+          <start></start>
+          <end>,|\s*(?=\&#93;)</end>
+            <include>
+            <context ref="value"/>
+          </include>
+        </context>
+      </include>
+    </context>
+
+   <context id="name" style-ref="variable">
+      <match>("[a-zA-Z0-9_.-]*")|[a-zA-Z0-9_.-]*</match>
+    </context>
+
+    <context id="inline-table">
+      <start>\s*\{|\{</start>
+      <end>\}</end>
+      <include>
+        <context ref="name" style-ref="variable"/>
+        <context>
+          <start>=</start>
+          <end>,|\s*(?=})</end>
+          <include>
+            <context ref="value"/>
+          </include>
+        </context>
+        <context ref="catch-all"/>
+      </include>
+    </context>
+
+    <context id="pair-value">
+      <start>=</start>
+      <end>$</end>
+      <include>
+        <context ref="value"/>
+      </include>
+    </context>
+
+    <context id="key">
+      <include>
+        <context ref="variable"/>
+        <context ref="basic-string" style-ref="variable"/>
+      </include>
+    </context>
+
+    <context id="assign-error-line" style-ref="error">
+      <match>^\s*=([^#]*(?=#)|.*$)</match>
+    </context>
+
+    <context id="empty-key-error" style-ref="error">
+      <match>^[^=]*=\s*#.*$</match>
+    </context>
+
+    <context id="text-after-table-error" style-ref="error">
+      <match>^\s*\[[^\]\[]*\]s*[^#]+$</match>
+    </context>
+
+    <context id="text-after-array-error" style-ref="error">
+      <match>^\s*\[\[[^\]]*\]\]s*[^#]+$</match>
+    </context>
+
+    <!--
+    []     # INVALID
+    [a.]   # INVALID
+    [a..b] # INVALID
+    [.b]   # INVALID
+    [.]    # INVALID
+    -->
+    <context id="invalid-table-error" style-ref="error">
+      <match>^\s*\[(\.?|[^.]+\.{2,}[^.]+|\.+[^.]+|[^.]+\.+|\.+[^.]+\.+)\]\s*(#.*)?$</match>
+    </context>
+
+    <context id="invalid-array-error" style-ref="error">
+      <match>^\s*\[\[(\.*|[^.]+\.{2,}[^.]+|\.+[^.]+|[^.]+\.+|\.+[^.]+\.+)\]\]s*(#.*)?$</match>
+    </context>
+
+    <context id="value">
+      <include>
+        <context ref="array"/>
+        <context ref="inline-table"/>
+        <context ref="boolean-value"/>
+        <context ref="datetime-value"/>
+        <context ref="datetime-not-strict-value"/>
+        <context ref="multiline-basic-string"/>
+        <context ref="basic-string"/>
+        <context ref="multiline-literal-string"/>
+        <context ref="literal-string"/>
+        <context ref="hex-number"/>
+        <context ref="octal-number"/>
+        <context ref="binary-number"/>
+        <context ref="infinity-number"/>
+        <context ref="not-a-number"/>
+        <context ref="integer"/>
+        <context ref="float"/>
+        <context ref="line-comment"/>
+        <context ref="catch-all"/>
+     </include>
+    </context>
+
+    <context id="toml" class="no-spell-check">
+      <include>
+        <context ref="line-comment"/>
+        <context ref="assign-error-line" />
+        <context ref="empty-key-error" />
+        <context ref="invalid-table-error" />
+        <context ref="invalid-array-error" />
+        <context ref="text-after-table-error" />
+        <context ref="text-after-array-error" />
+        <context ref="key"/>
+        <context ref="pair-value"/>
+        <context ref="table-entry"/>
+        <context ref="catch-all"/>
+      </include>
+    </context>
+  </definitions>
+</language>
\ No newline at end of file
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 3927763..57e4531 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -122,8 +122,10 @@ data/language-specs/swift.lang
 data/language-specs/systemverilog.lang
 data/language-specs/t2t.lang
 data/language-specs/tcl.lang
+data/language-specs/tera.lang
 data/language-specs/texinfo.lang
 data/language-specs/thrift.lang
+data/language-specs/toml.lang
 data/language-specs/vala.lang
 data/language-specs/vbnet.lang
 data/language-specs/verilog.lang
diff --git a/tests/syntax-highlighting/file.cmake b/tests/syntax-highlighting/file.cmake
new file mode 100644
index 0000000..0ecbacc
--- /dev/null
+++ b/tests/syntax-highlighting/file.cmake
@@ -0,0 +1,39 @@
+#[=[
+    This is a bracket comment.
+    TODO markers are recognized here.
+]=]
+
+# This is a line comment.
+# TODO markers are recognized here, too.
+
+set(words
+    These are unquoted arguments.
+    They can include variable references: ${var}, $ENV{var},
+    and escape sequences: \n\".)
+
+message("This is an unquoted argument.
+    It can also include variable references: ${APPLE}, $ENV{CC},
+    and escape sequences: \t\ \\.
+    In addition, line continuations: \
+    are allowed.")
+
+message("Variable references can nest: ${x$ENV{y${z}w}v}")
+
+message([==[
+    This is a bracket argument.
+    Variable references (${x}) or escape sequences (\n)
+    are not processed here.
+]==])
+
+# These are examples of legacy unquoted argument syntax
+# from the cmake-language manual page.
+set(arg_examples
+    -Da="b c" -Da=$(v) a" "b"c"d # legacy
+    "-Da=\"b c\"" "-Da=$(v)" "a\" \"b\"c\"d" # quoted equivalents
+)
+unset(arg_examples)
+
+# Control construct example.
+if(a EQUAL 5 AND (s STREQUAL "${x}" OR s MATCHES [[\*]]))
+endif()
+
diff --git a/tests/syntax-highlighting/file.groovy b/tests/syntax-highlighting/file.groovy
new file mode 100644
index 0000000..82f01a0
--- /dev/null
+++ b/tests/syntax-highlighting/file.groovy
@@ -0,0 +1,55 @@
+#!/usr/bin/env groovy
+
+// Single-line comment. TODO markers work.
+/* Multi-line comment.
+   TODO markers work. */
+
+'line' \
+    + 'continuation'
+
+def tsq = '''Triple single-quoted string.
+
+    Escapes work: \' \n \123 \u12ab \
+    Interpolation doesn't work: $x ${x}
+'''
+
+def sq = 'Single-quoted string. Escapes work: \' \r \45 \u45CD \
+    Interpolation does not: $x ${x}'
+
+def tdq = """Triple double-quoted string.
+
+    Escapes work: \" \f \6 \uABCD \
+    Interpolation works: $x._y.z0 ${x + 5}
+"""
+
+def dq = "Double-quoted string. Escapes work: \" \b \7 \u5678 \
+    So does interpolation: $_abc1 ${x + "abc"}"
+
+def slashy = /Slashy string.
+
+    There are only two escape sequences: \/ \
+    Interpolation works: $X ${-> X}
+    Dollars $ and backslashes \ on their own are interpreted literally./
+
+def notSlashy = 1 /2/ 3 // not a slashy string; just two division operators
+
+def dollarSlashy = $/Dollar slashy string.
+
+    There are three escape sequences: $$ $/ \
+    Interpolation works: $_ ${true}
+    Dollars $ and backslashes \ on their own are interpreted literally./$
+
+0b10i + 0b0110_1011 // binary numbers
+0 + 123L + 456_789 // decimal numbers
+0xab + 0xcd_efG // hexadecimal numbers
+
+01_23.45_67g + 1e-23f + 2d + 08.80 // floating-point numbers
+
+trait Test {
+    void foo(List list) {
+        def sum = 0
+        for (n in list) sum += n as int
+        println sum
+    }
+}
+
diff --git a/tests/syntax-highlighting/file.tera b/tests/syntax-highlighting/file.tera
new file mode 100644
index 0000000..be0ddd7
--- /dev/null
+++ b/tests/syntax-highlighting/file.tera
@@ -0,0 +1,15 @@
+{% extends "master" %}
+
+{% set_global number = 1.2 + 4 %}
+
+<html>
+  {% import "macros.tera" as macros %}
+  {# Comment #}
+  {{ macros::input(label="Name", type="text") }}
+
+  {% set result = call_function() %}
+
+  {{ type|first }}
+
+  <h1 class="{{ type|slugify }}">{{ value|join(sep=",") }}</h1>
+</html>
diff --git a/tests/syntax-highlighting/file.toml b/tests/syntax-highlighting/file.toml
new file mode 100644
index 0000000..902a1ae
--- /dev/null
+++ b/tests/syntax-highlighting/file.toml
@@ -0,0 +1,47 @@
+# comment
+
+[table]
+key = "value  - #"          # " comment "
+lines = '''
+multi
+lines
+'''
+
+[tabel] #comment
+date = 1979-05-27T00:32:00.999999-07:00 #date
+int = 1_000
+float = 6.626e-34
+
+hex = 0xDEADBEEF
+oct = 0o012345
+bin = 0b11010110
+inf = inf  # positive infinity
+
+    [[more.complex."array#"]]
+        "key" = "text"
+        multi_line_array = [
+            "]",
+            # ] commmet
+            ]
+
+
+="no key name"   #not allowed
+[...fasd...]     # INVALID
+[a.]   # INVALID
+[a..b] # INVALID
+[.b]   # INVALID
+[.]    # INVALID
+
+
+[error] if you didn't catch this, your parser is broken
+key = # INVALID
+
+string = "after value error" like this
+
+array = [
+         "This might most likely happen in multiline arrays",
+         Like here,
+         "or here,
+         and here"
+         ]     End of array comment, forgot the #
+number = 3.14 pi <--again forgot the #
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]