<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
	Proposed language specification for JavaScript files.
	
	Reference used:
		http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf

	Tested with:
		http://www.coffeeblack.org/scripts/map.js
	
	Submitted by Scott Martin (scott@coffeeblack.org)
-->
<language _name="JavaScript" version="1.0" _section="Scripts" mimetypes="application/x-javascript">
	
	<escape-char>\</escape-char>
	
	<string _name="String" style="String" end-at-line-end="TRUE">
		<start-regex>"</start-regex>
		<end-regex>"</end-regex>
	</string>

	<string _name="String 2" style="String" end-at-line-end="TRUE">
		<start-regex>'</start-regex>
		<end-regex>'</end-regex>
	</string>

	<line-comment _name="Line Comment" style="Comment">
		<start-regex>//</start-regex>
	</line-comment>

	<block-comment _name="Block Comment" style="Comment">
		<start-regex>/\*</start-regex>
    <end-regex>\*/</end-regex>
	</block-comment>
	
	<pattern-item _name="Punctuators" style="Others 3">
		<regex>[{}();:,.]</regex>		
	</pattern-item>
	
	<pattern-item _name="Operators" style="Function">
		<regex>[-~^@/%|=+*!?&amp;&lt;&gt;]</regex>
	</pattern-item>
	
	<pattern-item _name="Array Operators" style="Function">
		<regex>(\[|\])</regex>
	</pattern-item>
	
	<pattern-item _name="Hexadecimal Number" style="Base-N Integer">
		<regex>0[xX][a-fA-F0-9]+</regex>
	</pattern-item>
	
	<pattern-item _name="Number" style="Decimal">
		<regex>0|[\+-]?[1-9][0-9]*</regex>
	</pattern-item>
	
	<pattern-item _name="Floating-Point Number" style="Floating Point">
		<regex>[\+-]?(0|[1-9][0-9]*)?\.[0-9]+([Ee][\+-]?[1-9][0-9]*)?</regex>
	</pattern-item>
	
	<pattern-item _name="Unicode Escape Sequence" style="String">
		<regex>\\u[a-fA-F0-9]{4}</regex>
	</pattern-item>
	
	<keyword-list _name="Literals" style="Others" case-sensitive="TRUE">
		<keyword>null</keyword>
		<keyword>true</keyword>
		<keyword>false</keyword>
	</keyword-list>
	
	<keyword-list _name="Keywords" style="Keyword" case-sensitive="TRUE">
		<keyword>function</keyword>
		<keyword>this</keyword>
		<keyword>var</keyword>
		<keyword>const</keyword>
	</keyword-list>
	
	<keyword-list _name="Flow Keywords" style="Keyword" case-sensitive="TRUE">
		<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-list>
	
	<keyword-list _name="Word Operators" style="Function" case-sensitive="TRUE">
		<keyword>delete</keyword>
		<keyword>instanceof</keyword>
		<keyword>new</keyword>
		<keyword>throw</keyword>
		<keyword>typeof</keyword>
		<keyword>void</keyword>
	</keyword-list>
	
	<keyword-list _name="Error Handling" style="Keyword" case-sensitive="TRUE">
		<keyword>try</keyword>
		<keyword>catch</keyword>
		<keyword>finally</keyword>		
	</keyword-list>	
	
	<keyword-list _name="Objects" style="Others" case-sensitive="TRUE">
		<keyword>constructor</keyword>
		<keyword>prototype</keyword>
	</keyword-list>
	
	<keyword-list _name="Global Properties" style="Data Type" case-sensitive="TRUE">
		<keyword>Infinity</keyword>
		<keyword>NaN</keyword>
		<keyword>Math</keyword>
		<keyword>NEGATIVE_INFINITY</keyword>
		<keyword>POSITIVE_INFINITY</keyword>		
	</keyword-list>
	
	<keyword-list _name="Global Functions" style="Function" case-sensitive="TRUE">
		<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-list>
	
	<keyword-list _name="Object Properties" style="Data Type" case-sensitive="TRUE">
		<keyword>length</keyword>
		<keyword>lastIndex</keyword>
		<keyword>global</keyword>
		<keyword>ignoreCase</keyword>
		<keyword>multiline</keyword>
		<keyword>source</keyword>
		<keyword>name</keyword>
		<keyword>message</keyword>
	</keyword-list>
	
	<keyword-list _name="Object Functions" style="Function" case-sensitive="TRUE">
		<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>
	</keyword-list>
	
	<keyword-list _name="Constructors" style="Others 2" case-sensitive="TRUE">
		<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>
	</keyword-list>
	
	<pattern-item _name="Math Value Properties" style="Data Type">
		<regex>(LN(10|2)|(LOG(2|10))?E|PI|SQRT(1_)?2|(MAX|MIN)_VALUE)\b</regex>
	</pattern-item>
	
	<keyword-list _name="Future Reserved Words" style="Specials" case-sensitive="TRUE">
		<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>
	</keyword-list>

</language>
