medit/moo/mooedit/language-specs/javascript.lang

336 lines
15 KiB
Plaintext
Raw Normal View History

2006-08-26 04:46:29 -05:00
<?xml version="1.0" encoding="UTF-8"?>
2007-06-18 00:03:03 -05:00
<!--
Author: Scott Martin <scott@coffeeblack.org>
Copyright (C) 2004 Scott Martin <scott@coffeeblack.org>
Copyright (C) 2005 Stef Walter (formerly Nate Nielsen) <stef@memberwebs.com>
Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
Copyright (C) 2005-2007 Emanuele Aina
This library 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 2 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, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
2006-08-26 04:46:29 -05:00
<!--
Based on the syntax file for the old engine written by
-->
<language id="js" _name="Javascript" version="2.0" _section="Scripts">
<metadata>
<property name="mimetypes">application/x-javascript;text/x-javascript;text/javascript;text/x-js</property>
2006-11-06 08:38:11 -06:00
<property name="globs">*.js</property>
</metadata>
2006-08-26 04:46:29 -05:00
<styles>
<style id="comment" _name="Comment"
map-to="def:comment"/>
<style id="comment-multiline" _name="Multiline Comment"
map-to="def:comment"/>
<style id="error" _name="Error"
map-to="def:error"/>
<style id="string" _name="String"
map-to="def:string"/>
<style id="escape" _name="Escape"
map-to="def:escape"/>
<style id="keyword" _name="Keyword"
map-to="def:keyword"/>
<style id="object" _name="Object"/> <!--map-to="def:others"-->
<style id="data-type" _name="Data Type"
map-to="def:data-type"/>
<style id="function" _name="Function"
map-to="def:function"/>
<style id="properties" _name="Properties"
map-to="def:data-type"/>
<style id="constructors" _name="Constructors"/> <!--map-to="def:others2"-->
<style id="future-words" _name="Future Words"
map-to="def:specials"/>
</styles>
<definitions>
<context id="js">
<include>
<!-- Comments -->
<context id="comment" style-ref="comment">
<start>\/\/</start>
<end>$</end>
<include>
2007-05-27 15:08:41 -05:00
<!-- FIXME no \n in patterns! -->
2006-08-26 04:46:29 -05:00
<context id="comment-continue">
<match>\\\n</match>
</context>
2006-12-31 04:54:51 -06:00
<context ref="def:in-comment"/>
2006-08-26 04:46:29 -05:00
</include>
</context>
<context id="comment-multiline" style-ref="comment-multiline">
<start>\/\*</start>
<end>\*\/</end>
<include>
2006-12-31 04:54:51 -06:00
<context ref="def:in-comment"/>
2006-08-26 04:46:29 -05:00
</include>
</context>
<!-- Strings -->
<context id="string-double" end-at-line-end="true" style-ref="string">
<start>"</start>
<end>"</end>
<include>
2007-05-27 15:08:41 -05:00
<!-- FIXME no \n in patterns! -->
2006-08-26 04:46:29 -05:00
<context id="string-continue" style-ref="escape">
<match>\\\n</match>
</context>
Synced with upstream 2006-08-27 Yevgen Muntyan <muntyan@tamu.edu> * gtksourceview/language-specs/automake.lang, gtksourceview/language-specs/check.sh, gtksourceview/language-specs/Makefile.am: new lang file for Makefile.am. * gtksourceview/language-specs/c.lang: override style for line-continue in macros; use def:string context. * gtksourceview/language-specs/def.lang: renamed 'c-style-escape' to 'escape', it's not really 'C style'; added 'escape' style to 'line-continue' context; added 'string' and 'single-quoted-string' contexts. * gtksourceview/language-specs/javascript.lang: replaced def:c-style-escape with def:escape. * gtksourceview/language-specs/language2.rng: added optional style-ref and ignore-style attributes to <context ref=""> tags. * gtksourceview/gtksourcecontextengine.[ch], gtksourceview/gtksourcelanguage-parser-2.c: made it possible to override style from referenced context: <context ref="some-context" style-ref="some-style"> means "use context some-context with style some-style", and ignore-style attribute means "use no style in this context". 2006-08-27 Yevgen Muntyan <muntyan@tamu.edu> * gtksourceview/language-specs/Makefile.am: install style scheme into $prefix/gtksourceview-2.0/styles dir. * gtksourceview/gtksourcecontextengine.c: fixed subpatterns handling (subpatterns tags were applied randomly); made high-priority one-time idle called more often, which hopefully make it look nicer; (gtk_source_context_engine_update_highlight): highlight as much as possible even if some part of requested area is not analyzed yet. * gtksourceview/gtksourcelanguage-parser-2.c: fixed two leaks. * gtksourceview/gtksourcelanguagesmanager.c, gtksourceview/gtksourcestylescheme.h, gtksourceview/gtksourceview.c: _gtk_source_style_scheme_get_default() - temporary workaround for no-builtin-scheme thing.
2006-08-27 19:11:56 -05:00
<context ref="def:escape"/>
2006-08-26 04:46:29 -05:00
</include>
</context>
<context id="string-single" end-at-line-end="true" style-ref="string">
<start>'</start>
<end>'</end>
<include>
<context ref="string-continue"/>
Synced with upstream 2006-08-27 Yevgen Muntyan <muntyan@tamu.edu> * gtksourceview/language-specs/automake.lang, gtksourceview/language-specs/check.sh, gtksourceview/language-specs/Makefile.am: new lang file for Makefile.am. * gtksourceview/language-specs/c.lang: override style for line-continue in macros; use def:string context. * gtksourceview/language-specs/def.lang: renamed 'c-style-escape' to 'escape', it's not really 'C style'; added 'escape' style to 'line-continue' context; added 'string' and 'single-quoted-string' contexts. * gtksourceview/language-specs/javascript.lang: replaced def:c-style-escape with def:escape. * gtksourceview/language-specs/language2.rng: added optional style-ref and ignore-style attributes to <context ref=""> tags. * gtksourceview/gtksourcecontextengine.[ch], gtksourceview/gtksourcelanguage-parser-2.c: made it possible to override style from referenced context: <context ref="some-context" style-ref="some-style"> means "use context some-context with style some-style", and ignore-style attribute means "use no style in this context". 2006-08-27 Yevgen Muntyan <muntyan@tamu.edu> * gtksourceview/language-specs/Makefile.am: install style scheme into $prefix/gtksourceview-2.0/styles dir. * gtksourceview/gtksourcecontextengine.c: fixed subpatterns handling (subpatterns tags were applied randomly); made high-priority one-time idle called more often, which hopefully make it look nicer; (gtk_source_context_engine_update_highlight): highlight as much as possible even if some part of requested area is not analyzed yet. * gtksourceview/gtksourcelanguage-parser-2.c: fixed two leaks. * gtksourceview/gtksourcelanguagesmanager.c, gtksourceview/gtksourcestylescheme.h, gtksourceview/gtksourceview.c: _gtk_source_style_scheme_get_default() - temporary workaround for no-builtin-scheme thing.
2006-08-27 19:11:56 -05:00
<context ref="def:escape"/>
2006-08-26 04:46:29 -05:00
</include>
</context>
<!-- Numbers -->
2006-08-27 04:36:06 -05:00
<context ref="def:float"/>
2006-08-26 04:46:29 -05:00
<context ref="def:decimal"/>
<context ref="def:octal"/>
<context ref="def:hexadecimal"/>
<!-- Keywords -->
<context id="keywords" style-ref="keyword">
<keyword>const</keyword>
<keyword>function</keyword>
<keyword>this</keyword>
<keyword>var</keyword>
<keyword>break</keyword>
<keyword>case</keyword>
<keyword>continue</keyword>
<keyword>default</keyword>
<keyword>do</keyword>
<keyword>else</keyword>
<keyword>for</keyword>
<keyword>if</keyword>
<keyword>in</keyword>
<keyword>return</keyword>
<keyword>switch</keyword>
<keyword>while</keyword>
<keyword>with</keyword>
<keyword>try</keyword>
<keyword>catch</keyword>
<keyword>finally</keyword>
<keyword>null</keyword>
<keyword>true</keyword>
<keyword>false</keyword>
<keyword>delete</keyword>
<keyword>instanceof</keyword>
<keyword>new</keyword>
<keyword>throw</keyword>
<keyword>typeof</keyword>
<keyword>void</keyword>
</context>
<context id="objects" style-ref="object">
<keyword>constructor</keyword>
<keyword>prototype</keyword>
</context>
<context id="types" style-ref="data-type">
<keyword>Infinity</keyword>
<keyword>NaN</keyword>
<keyword>Math</keyword>
<keyword>NEGATIVE_INFINITY</keyword>
<keyword>POSITIVE_INFINITY</keyword>
</context>
<context id="functions" style-ref="function">
<keyword>eval</keyword>
<keyword>parseInt</keyword>
<keyword>parseFloat</keyword>
<keyword>isNaN</keyword>
<keyword>isFinite</keyword>
<keyword>encodeURI</keyword>
<keyword>decodeURI</keyword>
<keyword>encodeURIComponent</keyword>
<keyword>decodeURIComponent</keyword>
<keyword>toString</keyword>
<keyword>toLocaleString</keyword>
<keyword>valueOf</keyword>
<keyword>hasOwnProperty</keyword>
<keyword>isPrototypeOf</keyword>
<keyword>propertyIsEnumerable</keyword>
<keyword>apply</keyword>
<keyword>call</keyword>
<keyword>concat</keyword>
<keyword>join</keyword>
<keyword>pop</keyword>
<keyword>push</keyword>
<keyword>reverse</keyword>
<keyword>shift</keyword>
<keyword>slice</keyword>
<keyword>sort</keyword>
<keyword>unshift</keyword>
<keyword>fromCharCode</keyword>
<keyword>charAt</keyword>
<keyword>charCodeAt</keyword>
<keyword>indexOf</keyword>
<keyword>lastIndexOf</keyword>
<keyword>localeCompare</keyword>
<keyword>match</keyword>
<keyword>exec</keyword>
<keyword>replace</keyword>
<keyword>search</keyword>
<keyword>split</keyword>
<keyword>substr</keyword>
<keyword>substring</keyword>
<keyword>toLowerCase</keyword>
<keyword>toLocaleLowerCase</keyword>
<keyword>toUpperCase</keyword>
<keyword>toLocaleUpperCase</keyword>
<keyword>toFixed</keyword>
<keyword>toExponential</keyword>
<keyword>toPrecision</keyword>
<keyword>abs</keyword>
<keyword>acos</keyword>
<keyword>asin</keyword>
<keyword>atan</keyword>
<keyword>atan2</keyword>
<keyword>ceil</keyword>
<keyword>cos</keyword>
<keyword>exp</keyword>
<keyword>floor</keyword>
<keyword>log</keyword>
<keyword>max</keyword>
<keyword>min</keyword>
<keyword>pow</keyword>
<keyword>random</keyword>
<keyword>round</keyword>
<keyword>sin</keyword>
<keyword>sqrt</keyword>
<keyword>tan</keyword>
<keyword>parse</keyword>
<keyword>UTC</keyword>
<keyword>toDateString</keyword>
<keyword>toTimeString</keyword>
<keyword>toLocaleString</keyword>
<keyword>toLocaleDateString</keyword>
<keyword>toLocaleTimeString</keyword>
<keyword>getTime</keyword>
<keyword>getFullYear</keyword>
<keyword>getUTCFullYear</keyword>
<keyword>getMonth</keyword>
<keyword>getUTCMonth</keyword>
<keyword>getDate</keyword>
<keyword>getUTCDate</keyword>
<keyword>getDay</keyword>
<keyword>getUTCDay</keyword>
<keyword>getHours</keyword>
<keyword>getUTCHours</keyword>
<keyword>getMinutes</keyword>
<keyword>getUTCMinutes</keyword>
<keyword>getSeconds</keyword>
<keyword>getUTCSeconds</keyword>
<keyword>getMilliseconds</keyword>
<keyword>getUTCMilliseconds</keyword>
<keyword>getTimezoneOffset</keyword>
<keyword>setTime</keyword>
<keyword>setMilliseconds</keyword>
<keyword>setUTCMilliseconds</keyword>
<keyword>setSeconds</keyword>
<keyword>setUTCSeconds</keyword>
<keyword>setMinutes</keyword>
<keyword>setUTCMinutes</keyword>
<keyword>setHours</keyword>
<keyword>setUTCHours</keyword>
<keyword>setDate</keyword>
<keyword>setUTCDate</keyword>
<keyword>setMonth</keyword>
<keyword>setUTCMonth</keyword>
<keyword>setFullYear</keyword>
<keyword>setUTCFullYear</keyword>
<keyword>toUTCString</keyword>
<keyword>escape</keyword>
<keyword>unescape</keyword>
<keyword>getYear</keyword>
<keyword>setYear</keyword>
<keyword>toGMTString</keyword>
</context>
<context id="properties" style-ref="properties">
<keyword>length</keyword>
<keyword>lastIndex</keyword>
<keyword>global</keyword>
<keyword>ignoreCase</keyword>
<keyword>multiline</keyword>
<keyword>source</keyword>
<keyword>name</keyword>
<keyword>message</keyword>
</context>
<context id="constructors" style-ref="constructors">
<keyword>Object</keyword>
<keyword>Function</keyword>
<keyword>Array</keyword>
<keyword>String</keyword>
<keyword>Boolean</keyword>
<keyword>Number</keyword>
<keyword>Date</keyword>
<keyword>RegExp</keyword>
<keyword>Error</keyword>
<keyword>EvalError</keyword>
<keyword>RangeError</keyword>
<keyword>SyntaxError</keyword>
<keyword>TypeError</keyword>
<keyword>URIError</keyword>
</context>
<context id="future-words" style-ref="future-words">
<keyword>abstract</keyword>
<keyword>boolean</keyword>
<keyword>byte</keyword>
<keyword>char</keyword>
<keyword>class</keyword>
<keyword>debugger</keyword>
<keyword>double</keyword>
<keyword>enum</keyword>
<keyword>export</keyword>
<keyword>extends</keyword>
<keyword>final</keyword>
<keyword>float</keyword>
<keyword>goto</keyword>
<keyword>implements</keyword>
<keyword>import</keyword>
<keyword>int</keyword>
<keyword>interface</keyword>
<keyword>long</keyword>
<keyword>native</keyword>
<keyword>package</keyword>
<keyword>private</keyword>
<keyword>protected</keyword>
<keyword>public</keyword>
<keyword>short</keyword>
<keyword>static</keyword>
<keyword>super</keyword>
<keyword>synchronized</keyword>
<keyword>throws</keyword>
<keyword>transient</keyword>
<keyword>volatile</keyword>
</context>
</include>
</context>
</definitions>
</language>