[gtksourceview] language-specs: new highlight for meson



commit f8b78d5f0d233b1e5980ff6129dccfea12801422
Author: Igor Gnatenko <ignatenko src gnome org>
Date:   Sun Jul 12 20:08:35 2015 +0300

    language-specs: new highlight for meson
    
    Meson is an open source build system meant to be both extremely fast,
    and, even more importantly, as user friendly as possible.
    
    Currently meson highlight is a bit simplified, but in the future we are
    planning to make it much better ;)
    
    v2: add meson.lang to POTFILES.in and add example file for testing
    
    v3: add text/x-meson to mimetypes and add meson_options.txt to matching files
    
    The Meson Build System: http://mesonbuild.com/
    Language Reference: 
https://github.com/mesonbuild/meson/wiki/Reference-manual/cb3ef7a131afe067f56143e0c0f24817b3617315
    Related: 
http://cgit.freedesktop.org/xdg/shared-mime-info/commit/?id=962056d5f178cd0b2fc3fc3788058b7dfe878928
    Reference: https://bugzilla.gnome.org/show_bug.cgi?id=752292
    Signed-off-by: Igor Gnatenko <ignatenko src gnome org>

 data/language-specs/Makefile.am       |    1 +
 data/language-specs/meson.lang        |  103 +++++++++++++++++++++++++++++++++
 po/POTFILES.in                        |    1 +
 tests/syntax-highlighting/meson.build |    9 +++
 4 files changed, 114 insertions(+), 0 deletions(-)
---
diff --git a/data/language-specs/Makefile.am b/data/language-specs/Makefile.am
index 3be09d6..4d7966c 100644
--- a/data/language-specs/Makefile.am
+++ b/data/language-specs/Makefile.am
@@ -70,6 +70,7 @@ LANGUAGES =                   \
        markdown.lang           \
        matlab.lang             \
        mediawiki.lang          \
+       meson.lang              \
        modelica.lang           \
        mxml.lang               \
        nemerle.lang            \
diff --git a/data/language-specs/meson.lang b/data/language-specs/meson.lang
new file mode 100644
index 0000000..bd32044
--- /dev/null
+++ b/data/language-specs/meson.lang
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ This file is part of GtkSourceView
+
+ Copyright (C) 2015 Jussi Pakkanen <jpakkane gmail com>
+ Copyright (C) 2015 Igor Gnatenko <ignatenko src gnome org>
+
+ 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="meson" _name="Meson" version="2.0" _section="Source">
+  <metadata>
+    <property name="mimetypes">text/x-meson</property>
+    <property name="globs">meson.build;meson_options.txt</property>
+    <property name="line-comment-start">#</property>
+  </metadata>
+
+  <styles>
+    <style id="builtin-command" _name="Builtin Command" map-to="def:function"/>
+    <style id="operator" _name="Operator" map-to="def:operator"/>
+    <style id="string" _name="String" map-to="def:string" />
+  </styles>
+
+  <definitions>
+    <context id="multiline-string" style-ref="def:string">
+      <start>'''</start>
+      <end>'''</end>
+    </context>
+
+    <context id="string" style-ref="def:string" end-at-line-end="true">
+      <start>'</start>
+      <end>'</end>
+    </context>
+
+    <context id="builtin-command" style-ref="builtin-command">
+      <prefix>(?i)</prefix>
+      <keyword>add_global_arguments</keyword>
+      <keyword>build_target</keyword>
+      <keyword>configuration_data</keyword>
+      <keyword>configure_file</keyword>
+      <keyword>custom_target</keyword>
+      <keyword>declare_dependency</keyword>
+      <keyword>dependency</keyword>
+      <keyword>error</keyword>
+      <keyword>executable</keyword>
+      <keyword>find_program</keyword>
+      <keyword>find_library</keyword>
+      <keyword>files</keyword>
+      <keyword>generator</keyword>
+      <keyword>get_option</keyword>
+      <keyword>gettext</keyword>
+      <keyword>include_directories</keyword>
+      <keyword>install_data</keyword>
+      <keyword>install_headers</keyword>
+      <keyword>install_man</keyword>
+      <keyword>install_subdir</keyword>
+      <keyword>is_subproject</keyword>
+      <keyword>jar</keyword>
+      <keyword>message</keyword>
+      <keyword>pkgconfig_gen</keyword>
+      <keyword>project</keyword>
+      <keyword>run_command</keyword>
+      <keyword>run_target</keyword>
+      <keyword>set_variable</keyword>
+      <keyword>shared_library</keyword>
+      <keyword>static_library</keyword>
+      <keyword>subdir</keyword>
+      <keyword>subproject</keyword>
+      <keyword>test</keyword>
+      <keyword>vcs_tag</keyword>
+    </context>
+
+    <context id="operator" style-ref="operator">
+      <keyword>if</keyword>
+      <keyword>else</keyword>
+      <keyword>endif</keyword>
+      <keyword>foreach</keyword>
+      <keyword>endforeach</keyword>
+    </context>
+
+    <context id="meson" class="no-spell-check">
+      <include>
+        <context ref="multiline-string"/>
+        <context ref="string"/>
+        <context ref="builtin-command"/>
+        <context ref="operator"/>
+      </include>
+    </context>
+  </definitions>
+</language>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ca19c92..66eed22 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -68,6 +68,7 @@ data/language-specs/mallard.lang
 data/language-specs/markdown.lang
 data/language-specs/matlab.lang
 data/language-specs/mediawiki.lang
+data/language-specs/meson.lang
 data/language-specs/modelica.lang
 data/language-specs/mxml.lang
 data/language-specs/nemerle.lang
diff --git a/tests/syntax-highlighting/meson.build b/tests/syntax-highlighting/meson.build
new file mode 100644
index 0000000..912447f
--- /dev/null
+++ b/tests/syntax-highlighting/meson.build
@@ -0,0 +1,9 @@
+project('gtksourceview', 'c')
+glib = dependency('glib-2.0')
+executable(
+  'hello',
+  sources : [
+    'hello.c',
+  ],
+  dependencies : glib,
+)


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