Skip to content

Instantly share code, notes, and snippets.

@gorkinovich
Last active April 15, 2016 12:12
Show Gist options
  • Select an option

  • Save gorkinovich/de505f091a14cde34fd8 to your computer and use it in GitHub Desktop.

Select an option

Save gorkinovich/de505f091a14cde34fd8 to your computer and use it in GitHub Desktop.
Maude System Syntax Highlighter for GTKSourceView
<?xml version="1.0" encoding="UTF-8"?>
<!--
Maude System Syntax Highlighter for GTKSourceView
Copyright (C) 2016 Adrián Riesco Rodríguez, Gorka Suárez García
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
********************************************************************************
Put this file inside:
/usr/share/gtksourceview-2.0/language-specs/
/usr/share/gtksourceview-3.0/language-specs/
https://developer.gnome.org/gtksourceview/stable/lang-tutorial.html
https://developer.gnome.org/gtksourceview/stable/lang-reference.html
-->
<language id="maude" _name="Maude" version="2.0" _section="Source">
<metadata>
<property name="mimetypes">text/x-maude</property>
<property name="globs">*.maude</property>
</metadata>
<styles>
<style id="esc-char-str" _name="esc-char-str" map-to="def:string"/>
<style id="esc-char-qid" _name="esc-char-qid" map-to="def:character"/>
<style id="comment" _name="comment" map-to="def:comment"/>
<style id="boolean" _name="boolean" map-to="def:boolean"/>
<style id="natural" _name="natural" map-to="def:decimal"/>
<style id="float" _name="float" map-to="def:floating-point"/>
<style id="qid" _name="qid" map-to="def:character"/>
<style id="string" _name="string" map-to="def:string"/>
<style id="keyword" _name="keyword" map-to="def:keyword"/>
<style id="sort" _name="sort" map-to="def:type"/>
<style id="error" _name="error" map-to="def:error"/>
</styles>
<definitions>
<!-- Especial characters -->
<define-regex id="esc-char-str" extended="true">
\\( # leading backslash
[\\\"\'nrbtfav\?] | # escaped character
[0-7]{1,3} | # one, two, or three octal digits
x[0-9A-Fa-f]+) # 'x' followed by hex digits
</define-regex>
<!--
<define-regex id="esc-char-qid" extended="true">
`[\[\]\{\}\(\),]|`;
</define-regex>
-->
<!-- Comments -->
<context id="comment-ol1" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
<start>(---\s*|---\s*[^\s\(\n].*)$</start>
<include>
<context ref="def:in-line-comment"/>
</include>
</context>
<context id="comment-ol2" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
<start>(\*\*\*\s*|\*\*\*\s*[^\s\(\n].*)$</start>
<include>
<context ref="def:in-line-comment"/>
</include>
</context>
<context id="comment-ml1" style-ref="comment" class="comment" class-disabled="no-spell-check">
<start>---\s*\(</start>
<end>\)</end>
<include>
<context ref="def:in-comment"/>
</include>
</context>
<context id="comment-ml2" style-ref="comment" class="comment" class-disabled="no-spell-check">
<start>\*\*\*\s*\(</start>
<end>\)</end>
<include>
<context ref="def:in-comment"/>
</include>
</context>
<!-- Literals -->
<context id="boolean" style-ref="boolean">
<keyword>true</keyword>
<keyword>false</keyword>
</context>
<context id="natural" style-ref="natural">
<match extended="true">
(?&lt;![\w\.])
[0-9]+
(?![\w\.])
</match>
</context>
<context id="float" style-ref="float">
<match extended="true">
(?&lt;![\w\.])
[0-9]+\.[0-9]+([Ee][+-]?[0-9]+)?
(?![\w\.])
</match>
</context>
<!-- Qids -->
<context id="qid" style-ref="qid">
<match extended="true"> '([^\s\(\)\{\}\[\],`]|`[\[\]\{\}\(\),])+ </match>
</context>
<!-- Strings -->
<context id="string" style-ref="string" class="string" class-disabled="no-spell-check">
<start>"</start>
<end>"</end>
<include>
<context id="esc-char-str" style-ref="esc-char-str">
<match>\%{esc-char-str}</match>
</context>
</include>
</context>
<!-- Keywords -->
<context id="keywords" style-ref="keyword">
<keyword>fmod</keyword>
<keyword>endfm</keyword>
<keyword>mod</keyword>
<keyword>endm</keyword>
<keyword>fth</keyword>
<keyword>endfth</keyword>
<keyword>th</keyword>
<keyword>endth</keyword>
<keyword>view</keyword>
<keyword>endv</keyword>
<keyword>is</keyword>
<keyword>from</keyword>
<keyword>to</keyword>
<keyword>sort</keyword>
<keyword>sorts</keyword>
<keyword>subsort</keyword>
<keyword>op</keyword>
<keyword>ops</keyword>
<keyword>var</keyword>
<keyword>vars</keyword>
<keyword>eq</keyword>
<keyword>ceq</keyword>
<keyword>mb</keyword>
<keyword>cmb</keyword>
<keyword>rl</keyword>
<keyword>crl</keyword>
<keyword>pr</keyword>
<keyword>protecting</keyword>
<keyword>ex</keyword>
<keyword>extending</keyword>
<keyword>inc</keyword>
<keyword>including</keyword>
<keyword>prec</keyword>
<keyword>gather</keyword>
<keyword>assoc</keyword>
<keyword>comm</keyword>
<keyword>idem</keyword>
<keyword>id</keyword>
<keyword>left id</keyword>
<keyword>right id</keyword>
<keyword>iter</keyword>
<keyword>ctor</keyword>
<keyword>poly</keyword>
<keyword>format</keyword>
<keyword>ditto</keyword>
<keyword>strat</keyword>
<keyword>memo</keyword>
<keyword>frozen</keyword>
<keyword>special</keyword>
<keyword>label</keyword>
<keyword>metadata</keyword>
<keyword>nonexec</keyword>
<keyword>owise</keyword>
<keyword>print</keyword>
<keyword>if</keyword>
<keyword>then</keyword>
<keyword>else</keyword>
<keyword>fi</keyword>
<keyword>class</keyword>
<keyword>msg</keyword>
</context>
<!--
<context id="sorts" style-ref="sort">
<keyword>Universal</keyword>
<keyword>Bool</keyword>
<keyword>Zero</keyword>
<keyword>NzNat</keyword>
<keyword>Nat</keyword>
<keyword>Clock</keyword>
<keyword>NzInt</keyword>
<keyword>Int</keyword>
<keyword>One</keyword>
<keyword>Two</keyword>
<keyword>Three</keyword>
<keyword>IntGt3</keyword>
<keyword>MachineZero</keyword>
<keyword>NzMachineNat</keyword>
<keyword>MachineNat</keyword>
<keyword>NzMachineInt</keyword>
<keyword>MachineInt</keyword>
<keyword>PosRat</keyword>
<keyword>NzRat</keyword>
<keyword>Rat</keyword>
<keyword>FiniteFloat</keyword>
<keyword>Float</keyword>
<keyword>String</keyword>
<keyword>Char</keyword>
<keyword>FindResult</keyword>
<keyword>DecFloat</keyword>
<keyword>Qid</keyword>
<keyword>Elt</keyword>
<keyword>NeList</keyword>
<keyword>List</keyword>
<keyword>NeNatList</keyword>
<keyword>NatList</keyword>
<keyword>NeQidList</keyword>
<keyword>QidList</keyword>
<keyword>NeSet</keyword>
<keyword>Set</keyword>
<keyword>NeQidSet</keyword>
<keyword>QidSet</keyword>
<keyword>Item</keyword>
<keyword>PreList</keyword>
<keyword>Element</keyword>
<keyword>PreSet</keyword>
<keyword>Entry</keyword>
<keyword>Map</keyword>
<keyword>Array</keyword>
<keyword>IndexPair</keyword>
<keyword>Matrix</keyword>
<keyword>Vector</keyword>
<keyword>IntVectorEntry</keyword>
<keyword>IntVector</keyword>
<keyword>NeIntVectorSet</keyword>
<keyword>IntVectorSet</keyword>
<keyword>IntVectorSetPair</keyword>
<keyword>Object</keyword>
<keyword>Msg</keyword>
<keyword>Configuration</keyword>
<keyword>Oid</keyword>
<keyword>Cid</keyword>
<keyword>Attribute</keyword>
<keyword>AttributeSet</keyword>
<keyword>Portal</keyword>
</context>
-->
<context id="maude" class="no-spell-check">
<include>
<context ref="comment-ol1"/>
<context ref="comment-ol2"/>
<context ref="comment-ml1"/>
<context ref="comment-ml2"/>
<context ref="boolean"/>
<context ref="natural"/>
<context ref="float"/>
<context ref="qid"/>
<context ref="string"/>
<context ref="keywords"/>
<!--<context ref="sorts"/>-->
</include>
</context>
</definitions>
</language>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment