medit/moo/mooedit/syntax/scheme.lang

446 lines
17 KiB
XML

<?xml version="1.0" encoding="UTF-8"?><!-- kate: space-indent on; indent-width 2; strip on; -->
<!DOCTYPE language SYSTEM "language.dtd">
<!--
This file is part of KDE's kate project.
copyright : (C) 2004-2005 by Dominik Haumann
email : dhdev at gmx dot de
copyright : (C) 2004 by Goffart Olivier
email : ogoffart @ kde.org
(brackets coloration)
**********************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; if not, write to the *
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, *
* Boston, MA 02111-1307, USA. *
**********************************************************************
NOTE:
This file defines highlighting rules for both Scheme AND Guile.
Scheme usually has no block comments. Guile has block comments: #! !#
I support these block comments: "Good design means good compromises" :)
Singleline comments are introduced through ';'. In reality EVERY
scheme/guile developer use ';;'. It is indented in emacs in a special way.
That's why I set <comment singleLine=";;">.
As a guile guru tole me it would not make sense to highlight all scheme and
guile procedures (cause then almost everything would be highlighted) I
removed some to have a rather small but "senseful" list of highlighted words.
-->
<language version="1.11" kateversion="2.4" name="Scheme" section="Scripts"
extensions="*.scm;*.ss;*.scheme;*.guile" mimetypes="text/x-scheme"
author="Dominik Haumann (dhdev@gmx.de)" license="LGPL">
<syntax>
<keyword-list name="operators">
<keyword>&lt;=</keyword>
<keyword>&lt;</keyword>
<keyword>=</keyword>
<keyword>=&gt;</keyword>
<keyword>&gt;=</keyword>
<keyword>&gt;</keyword>
<keyword>-</keyword>
<keyword>/</keyword>
<keyword>\*,\*</keyword>
<keyword>\*\)</keyword>
<keyword>\+</keyword>
</keyword-list>
<keyword-list name="characters">
<keyword>#\\nul</keyword>
<keyword>#\\soh</keyword>
<keyword>#\\stx</keyword>
<keyword>#\\etx</keyword>
<keyword>#\\eot</keyword>
<keyword>#\\enq</keyword>
<keyword>#\\ack</keyword>
<keyword>#\\bel</keyword>
<keyword>#\\bs</keyword>
<keyword>#\\ht</keyword>
<keyword>#\\nl</keyword>
<keyword>#\\vt</keyword>
<keyword>#\\np</keyword>
<keyword>#\\cr</keyword>
<keyword>#\\so</keyword>
<keyword>#\\si</keyword>
<keyword>#\\dle</keyword>
<keyword>#\\dc1</keyword>
<keyword>#\\dc2</keyword>
<keyword>#\\dc3</keyword>
<keyword>#\\dc4</keyword>
<keyword>#\\nak</keyword>
<keyword>#\\syn</keyword>
<keyword>#\\etb</keyword>
<keyword>#\\can</keyword>
<keyword>#\\em</keyword>
<keyword>#\\sub</keyword>
<keyword>#\\esc</keyword>
<keyword>#\\fs</keyword>
<keyword>#\\gs</keyword>
<keyword>#\\rs</keyword>
<keyword>#\\us</keyword>
<keyword>#\\space</keyword>
<keyword>#\\sp</keyword>
<keyword>#\\newline</keyword>
<keyword>#\\nl</keyword>
<keyword>#\\tab</keyword>
<keyword>#\\ht</keyword>
<keyword>#\\backspace</keyword>
<keyword>#\\bs</keyword>
<keyword>#\\return</keyword>
<keyword>#\\cr</keyword>
<keyword>#\\page</keyword>
<keyword>#\\np</keyword>
<keyword>#\\null</keyword>
<keyword>#\\nul</keyword>
</keyword-list>
<keyword-list name="defines">
<keyword>define-accessor</keyword>
<keyword>define-class</keyword>
<keyword>defined\?</keyword>
<keyword>define-generic</keyword>
<keyword>define-macro</keyword>
<keyword>define-method</keyword>
<keyword>define-module</keyword>
<keyword>define-private</keyword>
<keyword>define-public</keyword>
<keyword>define\*-public</keyword>
<keyword>define-reader-ctor</keyword>
<keyword>define-syntax</keyword>
<keyword>define-syntax-macro</keyword>
<keyword>define\*</keyword>
<keyword>define</keyword>
<keyword>defmacro\*-public</keyword>
<keyword>defmacro\*</keyword>
<keyword>defmacro</keyword>
</keyword-list>
<keyword-list name="keywords">
<keyword>abs</keyword>
<keyword>acos</keyword>
<keyword>and</keyword>
<keyword>angle</keyword>
<keyword>append</keyword>
<keyword>applymap</keyword>
<keyword>asin</keyword>
<keyword>assoc</keyword>
<keyword>assq</keyword>
<keyword>assv</keyword>
<keyword>atan</keyword>
<keyword>begin</keyword>
<keyword>boolean\?</keyword>
<keyword>break</keyword>
<keyword>caaaar</keyword>
<keyword>caaadr</keyword>
<keyword>caaar</keyword>
<keyword>caadar</keyword>
<keyword>caaddr</keyword>
<keyword>caadr</keyword>
<keyword>caar</keyword>
<keyword>cadaar</keyword>
<keyword>cadadr</keyword>
<keyword>cadar</keyword>
<keyword>caddar</keyword>
<keyword>cadddr</keyword>
<keyword>caddr</keyword>
<keyword>cadr</keyword>
<keyword>call/cc</keyword>
<keyword>call-with-current-continuation</keyword>
<keyword>call-with-input-file</keyword>
<keyword>call-with-output-file</keyword>
<keyword>call-with-values</keyword>
<keyword>car</keyword>
<keyword>case</keyword>
<keyword>catch</keyword>
<keyword>cdaaar</keyword>
<keyword>cdaadr</keyword>
<keyword>cdaar</keyword>
<keyword>cdadar</keyword>
<keyword>cdaddr</keyword>
<keyword>cdadr</keyword>
<keyword>cdar</keyword>
<keyword>cddaar</keyword>
<keyword>cddadr</keyword>
<keyword>cddar</keyword>
<keyword>cdddar</keyword>
<keyword>cddddr</keyword>
<keyword>cdddr</keyword>
<keyword>cddr</keyword>
<keyword>cdr</keyword>
<keyword>ceiling</keyword>
<keyword>char-alphabetic\?</keyword>
<keyword>char-ci&gt;=\?</keyword>
<keyword>char-ci&gt;\?</keyword>
<keyword>char-ci=\?</keyword>
<keyword>char-ci&lt;=\?</keyword>
<keyword>char-downcase</keyword>
<keyword>char-&gt;integer</keyword>
<keyword>char&gt;=\?</keyword>
<keyword>char&gt;\?</keyword>
<keyword>char=\?</keyword>
<keyword>char\?</keyword>
<keyword>char-lower-case\?</keyword>
<keyword>char&lt;\?c</keyword>
<keyword>char&lt;=\?</keyword>
<keyword>char-numeric\?</keyword>
<keyword>char-ready\?</keyword>
<keyword>char-upcase</keyword>
<keyword>char-upper-case\?</keyword>
<keyword>char-whitespace\?</keyword>
<keyword>close-input-port</keyword>
<keyword>close-output-port</keyword>
<keyword>complex\?</keyword>
<keyword>cond</keyword>
<keyword>cons</keyword>
<keyword>continue</keyword>
<keyword>cos</keyword>
<keyword>current-input-port</keyword>
<keyword>current-output-port</keyword>
<keyword>denominator</keyword>
<keyword>display</keyword>
<keyword>do</keyword>
<keyword>dynamic-wind</keyword>
<keyword>else</keyword>
<keyword>eof-object\?</keyword>
<keyword>eq\?</keyword>
<keyword>equal\?</keyword>
<keyword>eqv\?</keyword>
<keyword>eval</keyword>
<keyword>even\?</keyword>
<keyword>exact->inexact</keyword>
<keyword>exact\?</keyword>
<keyword>exp</keyword>
<keyword>expt</keyword>
<keyword>floor</keyword>
<keyword>force</keyword>
<keyword>for-each</keyword>
<keyword>gcd</keyword>
<keyword>har-ci&lt;\?</keyword>
<keyword>if</keyword>
<keyword>imag-part</keyword>
<keyword>inexact-&gt;exact</keyword>
<keyword>inexact\?</keyword>
<keyword>input-port\?</keyword>
<keyword>integer-&gt;char</keyword>
<keyword>integer\?</keyword>
<keyword>interaction-environment</keyword>
<keyword>lambda</keyword>
<keyword>lcm</keyword>
<keyword>length</keyword>
<keyword>let</keyword>
<keyword>let\*</keyword>
<keyword>letrec</keyword>
<keyword>letrec-syntax</keyword>
<keyword>let-syntax</keyword>
<keyword>list-&gt;string</keyword>
<keyword>list</keyword>
<keyword>list\?</keyword>
<keyword>list-ref</keyword>
<keyword>list-tail</keyword>
<keyword>load</keyword>
<keyword>log</keyword>
<keyword>magnitude</keyword>
<keyword>make-polar</keyword>
<keyword>make-rectangular</keyword>
<keyword>make-string</keyword>
<keyword>make-vector</keyword>
<keyword>max</keyword>
<keyword>member</keyword>
<keyword>memq</keyword>
<keyword>memv</keyword>
<keyword>min</keyword>
<keyword>modulo</keyword>
<keyword>negative\?</keyword>
<keyword>newline</keyword>
<keyword>not</keyword>
<keyword>null-environment</keyword>
<keyword>null\?</keyword>
<keyword>number\?</keyword>
<keyword>number->string</keyword>
<keyword>numerator</keyword>
<keyword>odd\?</keyword>
<keyword>open-input-file</keyword>
<keyword>open-output-file</keyword>
<keyword>or</keyword>
<keyword>output-port\?</keyword>
<keyword>pair\?</keyword>
<keyword>peek-char</keyword>
<keyword>port\?</keyword>
<keyword>positive\?</keyword>
<keyword>procedure\?</keyword>
<keyword>quotient</keyword>
<keyword>rational\?</keyword>
<keyword>rationalize</keyword>
<keyword>read-char</keyword>
<keyword>read</keyword>
<keyword>real\?</keyword>
<keyword>real-part</keyword>
<keyword>remainder</keyword>
<keyword>reverse</keyword>
<keyword>round</keyword>
<keyword>scheme-report-environment</keyword>
<keyword>set-car!</keyword>
<keyword>set-cdr!</keyword>
<keyword>sin</keyword>
<keyword>sqrt</keyword>
<keyword>string-append</keyword>
<keyword>string-ci&gt;=\?</keyword>
<keyword>string-ci&gt;\?</keyword>
<keyword>string-ci=\?</keyword>
<keyword>string-ci&lt;=\?</keyword>
<keyword>string-ci&lt;\?</keyword>
<keyword>string-copy</keyword>
<keyword>string-fill!</keyword>
<keyword>string&gt;=\?</keyword>
<keyword>string&gt;\?</keyword>
<keyword>string-&gt;list</keyword>
<keyword>string-&gt;number</keyword>
<keyword>string-&gt;symbol</keyword>
<keyword>string=\?</keyword>
<keyword>string</keyword>
<keyword>string\?</keyword>
<keyword>string-length</keyword>
<keyword>string&lt;=\?</keyword>
<keyword>string&lt;\?</keyword>
<keyword>string-ref</keyword>
<keyword>string-set!</keyword>
<keyword>substring</keyword>
<keyword>symbol-&gt;string</keyword>
<keyword>symbol\?</keyword>
<keyword>syntax-rules</keyword>
<keyword>tan</keyword>
<keyword>transcript-off</keyword>
<keyword>transcript-on</keyword>
<keyword>truncate</keyword>
<keyword>values</keyword>
<keyword>vector-fill!</keyword>
<keyword>vector-&gt;listlist->vector</keyword>
<keyword>vector</keyword>
<keyword>vector\?</keyword>
<keyword>vector-length</keyword>
<keyword>vector-ref</keyword>
<keyword>vector-set!</keyword>
<keyword>while</keyword>
<keyword>with-input-from-file</keyword>
<keyword>with-output-to-file</keyword>
<keyword>write-char</keyword>
<keyword>write</keyword>
<keyword>zero\?</keyword>
</keyword-list>
<context name="Level0" style="Normal" eol-context="#stay">
<Char style="Brackets1" context="Level1" char="("/>
<IncludeRules from="Default"/>
</context>
<context name="Default" style="Normal" eol-context="#stay">
<Regex style="Region Marker" context="#stay" pattern=";+\s*BEGIN.*$" beginRegion="region"/>
<Regex style="Region Marker" context="#stay" pattern=";+\s*END.*$" endRegion="region"/>
<Regex style="Comment" context="#stay" pattern=";.*$"/>
<TwoChars style="Comment" context="MultiLineComment" char1="#" char2="!" beginRegion="region"/>
<Keyword style="Keyword" context="#stay" keyword="keywords"/>
<Keyword style="Operator" context="#stay" keyword="operators"/>
<Keyword style="Definition" context="function_decl" keyword="defines"/>
<Keyword style="Char" context="#stay" keyword="characters"/>
<Regex style="Char" context="#stay" pattern="#\\."/>
<Char style="String" context="String" char="&quot;"/>
<Regex style="Char" context="SpecialNumber" pattern="#[bodxei]"/>
<Regex style="Decimal" context="#stay" pattern="#[tf]"/>
<Float style="Float" context="#stay"/>
<Int style="Decimal" context="#stay"/>
<Char style="Brackets1" context="Level1" char="("/>
</context>
<context name="MultiLineComment" style="Comment" eol-context="#stay">
<Regex style="Comment" context="#pop" pattern="!#\s*$" endRegion="region" bol-only="TRUE"/>
</context>
<context name="SpecialNumber" style="Normal" eol-context="#pop">
<Float style="Float" context="#pop"/>
<Int style="Decimal" context="#pop"/>
<Octal style="BaseN" context="#pop"/>
<Hex style="Float" context="#pop"/>
</context>
<context name="String" style="String" eol-context="#stay">
<Keyword style="Char" context="#stay" keyword="characters"/>
<Regex style="Char" context="#stay" pattern="#\\."/>
<TwoChars style="Char" context="#stay" char1="\" char2="&quot;"/>
<TwoChars style="Char" context="#stay" char1="\" char2="\"/>
<Char style="String" context="#pop" char="&quot;"/>
</context>
<context name="function_decl" style="Function" eol-context="#stay">
<Regex style="Function" context="#pop" pattern="\s*[A-Za-z0-9-+\&lt;\&gt;//\*]*\s*"/>
</context>
<context name="Level1" style="Normal" eol-context="#stay">
<Char style="Brackets2" context="Level2" char="("/>
<Char style="Brackets1" context="#pop" char=")"/>
<IncludeRules from="Default"/>
</context>
<context name="Level2" style="Normal" eol-context="#stay">
<Char style="Brackets3" context="Level3" char="("/>
<Char style="Brackets2" context="#pop" char=")"/>
<IncludeRules from="Default"/>
</context>
<context name="Level3" style="Normal" eol-context="#stay">
<Char style="Brackets4" context="Level4" char="("/>
<Char style="Brackets3" context="#pop" char=")"/>
<IncludeRules from="Default"/>
</context>
<context name="Level4" style="Normal" eol-context="#stay">
<Char style="Brackets5" context="Level5" char="("/>
<Char style="Brackets4" context="#pop" char=")"/>
<IncludeRules from="Default"/>
</context>
<context name="Level5" style="Normal" eol-context="#stay">
<Char style="Brackets6" context="Level6" char="("/>
<Char style="Brackets5" context="#pop" char=")"/>
<IncludeRules from="Default"/>
</context>
<context name="Level6" style="Normal" eol-context="#stay">
<Char style="Brackets1" context="Level1" char="("/>
<Char style="Brackets6" context="#pop" char=")"/>
<IncludeRules from="Default"/>
</context>
</syntax>
<styles>
<style name="Normal" default-style="Normal"/>
<style name="Keyword" default-style="Keyword"/>
<style name="Definition" default-style="Keyword" foreground="#d22811"/>
<style name="Operator" default-style="Keyword" foreground="#d22811"/>
<style name="Function" default-style="Function"/>
<style name="Data" default-style="DataType"/>
<style name="Decimal" default-style="Decimal"/>
<style name="BaseN" default-style="BaseN"/>
<style name="Float" default-style="Float"/>
<style name="Char" default-style="Char"/>
<style name="String" default-style="String"/>
<style name="Comment" default-style="Comment"/>
<style name="Region Marker" default-style="RegionMarker"/>
<style name="Brackets1" default-style="Normal" foreground="#ff0000" bold="1" italic="0"/>
<style name="Brackets2" default-style="Normal" foreground="#ff8800" bold="1" italic="0"/>
<style name="Brackets3" default-style="Normal" foreground="#888800" bold="1" italic="0"/>
<style name="Brackets4" default-style="Normal" foreground="#008800" bold="1" italic="0"/>
<style name="Brackets5" default-style="Normal" foreground="#000088" bold="1" italic="0"/>
<style name="Brackets6" default-style="Normal" foreground="#880088" bold="1" italic="0"/>
</styles>
<general>
<!-- <keywords casesensitive="1" weakDeliminator="-+*?!&lt;&gt;=/:#\"/> -->
<comments>
<single-line start=";;"/>
<multi-line start="#!" end="!#"/>
</comments>
</general>
</language>