From a23bdb49a2cacbb5456cf7ff8975c47a035eb12f Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 5 Apr 2013 12:45:06 +0400 Subject: [PATCH 01/20] workaround for chrome not displaying middle of very long lines --- lib/ace/tokenizer.js | 16 +++++++++++++--- lib/ace/tokenizer_dev.js | 6 ++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 189b671b..8c6417fd 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -83,6 +83,7 @@ var Tokenizer = function(rules) { + (matchcount - 1) + "!=" + rule.token.length); } else { rule.tokenArray = rule.token; + rule.token = null; rule.onMatch = this.$arrayTokens; } } else if (typeof rule.token == "function" && !rule.onMatch) { @@ -271,7 +272,7 @@ var Tokenizer = function(rules) { if (value) { if (typeof type == "string") { - if ((!rule || rule.merge !== false) && token.type === type) { + if ((!rule || rule.merge) && token.type === type) { token.value += value; } else { if (token.type) @@ -293,8 +294,17 @@ var Tokenizer = function(rules) { lastIndex = index; if (tokens.length > MAX_TOKEN_COUNT) { - token.value += line.substr(lastIndex); - currentState = "start" + // chrome doens't show contents of text nodes with very long text + while (lastIndex < line.length) { + if (token.type) + tokens.push(token); + token = { + value: line.substring(lastIndex, lastIndex += 2000), + type: "overflow" + } + } + currentState = "start"; + stack = []; break; } } diff --git a/lib/ace/tokenizer_dev.js b/lib/ace/tokenizer_dev.js index 4321035c..61821f60 100644 --- a/lib/ace/tokenizer_dev.js +++ b/lib/ace/tokenizer_dev.js @@ -32,7 +32,7 @@ define(function(require, exports, module) { var BaseTokenizer = require("./tokenizer").Tokenizer; // tokenizing lines longer than this makes editor very slow -var MAX_TOKEN_COUNT = 1000; +var MAX_TOKEN_COUNT = 100000; /* * version of Tokenizer with additional logging * and infinite loop checks @@ -80,7 +80,7 @@ var Tokenizer = function(rules) { }; initState(); - var maxRecur = 10000; + var maxRecur = 100000; while (match = re.exec(line)) { var type = mapping.defaultToken; @@ -177,5 +177,7 @@ var Tokenizer = function(rules) { }; +Tokenizer.prototype = BaseTokenizer.prototype; + exports.Tokenizer = Tokenizer; }); From 826105b5e969998dce11faa81dd38405ce3eabb1 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 5 Apr 2013 12:45:38 +0400 Subject: [PATCH 02/20] make generated statenames nicer --- lib/ace/mode/text_highlight_rules.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ace/mode/text_highlight_rules.js b/lib/ace/mode/text_highlight_rules.js index 59d7c401..5ece4e00 100644 --- a/lib/ace/mode/text_highlight_rules.js +++ b/lib/ace/mode/text_highlight_rules.js @@ -131,7 +131,14 @@ var TextHighlightRules = function() { } var next = rule.next || rule.push; if (next && Array.isArray(next)) { - var stateName = rule.stateName || (rule.token + id++); + var stateName = rule.stateName; + if (!stateName) { + stateName = rule.token; + if (typeof stateName != "string") + stateName = stateName[0] || ""; + if (rules[stateName]) + stateName += id++; + } rules[stateName] = next; rule.next = stateName; processState(stateName); From 538359ccd6aa62ee64ba64fd381b9fbf2fe01517 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 5 Apr 2013 12:47:16 +0400 Subject: [PATCH 03/20] meta scope isn't for styling --- lib/ace/theme/monokai.css | 2 +- tool/tmthemes/Monokai.tmTheme | 104 +++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 4 deletions(-) diff --git a/lib/ace/theme/monokai.css b/lib/ace/theme/monokai.css index d93600d2..3514fdf6 100644 --- a/lib/ace/theme/monokai.css +++ b/lib/ace/theme/monokai.css @@ -61,7 +61,7 @@ .ace-monokai .ace_entity.ace_name.ace_tag, .ace-monokai .ace_keyword, -.ace-monokai .ace_meta, +.ace-monokai .ace_meta.ace_tag, .ace-monokai .ace_storage { color: #F92672 } diff --git a/tool/tmthemes/Monokai.tmTheme b/tool/tmthemes/Monokai.tmTheme index fb01ff36..c179cbe2 100644 --- a/tool/tmthemes/Monokai.tmTheme +++ b/tool/tmthemes/Monokai.tmTheme @@ -1,5 +1,5 @@ - + name @@ -16,11 +16,32 @@ foreground #F8F8F2 invisibles - #49483E + #3B3A32 lineHighlight - #49483E + #3E3D32 selection #49483E + findHighlight + #FFE792 + findHighlightForeground + #000000 + selectionBorder + #222218 + activeGuide + #9D550FB0 + + bracketsForeground + #F8F8F2A5 + bracketsOptions + underline + + bracketContentsForeground + #F8F8F2A5 + bracketContentsOptions + underline + + tagsOptions + stippled_underline @@ -56,6 +77,7 @@ #AE81FF + name Built-in constant @@ -282,6 +304,82 @@ #F8F8F0 + + name + JSON String + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #CFCFC2 + + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #75715E + + + + name + diff.deleted + scope + markup.deleted + settings + + foreground + #F92672 + + + + name + diff.inserted + scope + markup.inserted + settings + + foreground + #A6E22E + + + + name + diff.changed + scope + markup.changed + settings + + foreground + #E6DB74 + + + + + scope + constant.numeric.line-number.find-in-files - match + settings + + foreground + #AE81FFA0 + + + + scope + entity.name.filename.find-in-files + settings + + foreground + #E6DB74 + + + uuid D8D5E82E-3D5B-46B5-B38E-8C841C21347D From 03fe8a35760e2b7ec0bc57e9fc787b4cb733ff52 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 5 Apr 2013 22:02:32 +0400 Subject: [PATCH 04/20] add several autoconverted modes --- lib/ace/mode/actionscript.js | 64 ++ lib/ace/mode/actionscript_highlight_rules.js | 141 +++ lib/ace/mode/erlang.js | 64 ++ lib/ace/mode/erlang_highlight_rules.js | 876 ++++++++++++++++++ lib/ace/mode/forth.js | 64 ++ lib/ace/mode/forth_highlight_rules.js | 201 ++++ lib/ace/mode/fortran_modern.js | 64 ++ .../mode/fortran_modern_highlight_rules.js | 187 ++++ lib/ace/mode/haskell.js | 64 ++ lib/ace/mode/haskell_highlight_rules.js | 246 +++++ lib/ace/mode/html_twig.js | 64 ++ lib/ace/mode/html_twig_highlight_rules.js | 687 ++++++++++++++ lib/ace/mode/julia.js | 64 ++ lib/ace/mode/julia_highlight_rules.js | 200 ++++ lib/ace/mode/prolog.js | 64 ++ lib/ace/mode/prolog_highlight_rules.js | 238 +++++ lib/ace/mode/rust.js | 64 ++ lib/ace/mode/rust_highlight_rules.js | 129 +++ 18 files changed, 3481 insertions(+) create mode 100644 lib/ace/mode/actionscript.js create mode 100644 lib/ace/mode/actionscript_highlight_rules.js create mode 100644 lib/ace/mode/erlang.js create mode 100644 lib/ace/mode/erlang_highlight_rules.js create mode 100644 lib/ace/mode/forth.js create mode 100644 lib/ace/mode/forth_highlight_rules.js create mode 100644 lib/ace/mode/fortran_modern.js create mode 100644 lib/ace/mode/fortran_modern_highlight_rules.js create mode 100644 lib/ace/mode/haskell.js create mode 100644 lib/ace/mode/haskell_highlight_rules.js create mode 100644 lib/ace/mode/html_twig.js create mode 100644 lib/ace/mode/html_twig_highlight_rules.js create mode 100644 lib/ace/mode/julia.js create mode 100644 lib/ace/mode/julia_highlight_rules.js create mode 100644 lib/ace/mode/prolog.js create mode 100644 lib/ace/mode/prolog_highlight_rules.js create mode 100644 lib/ace/mode/rust.js create mode 100644 lib/ace/mode/rust_highlight_rules.js diff --git a/lib/ace/mode/actionscript.js b/lib/ace/mode/actionscript.js new file mode 100644 index 00000000..7411413d --- /dev/null +++ b/lib/ace/mode/actionscript.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var ActionScriptHighlightRules = require("./actionscript_highlight_rules").ActionScriptHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new ActionScriptHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/actionscript_highlight_rules.js b/lib/ace/mode/actionscript_highlight_rules.js new file mode 100644 index 00000000..52a80391 --- /dev/null +++ b/lib/ace/mode/actionscript_highlight_rules.js @@ -0,0 +1,141 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from tm bundles\actionscript.tmbundle\Syntaxes\ActionScript.plist (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ActionScriptHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { token: 'support.class.actionscript.2', + regex: '\\b(?:R(?:ecordset|DBMSResolver|adioButton(?:Group)?)|X(?:ML(?:Socket|Node|Connector)?|UpdateResolverDataHolder)|M(?:M(?:Save|Execute)|icrophoneMicrophone|o(?:use|vieClip(?:Loader)?)|e(?:nu(?:Bar)?|dia(?:Controller|Display|Playback))|ath)|B(?:yName|inding|utton)|S(?:haredObject|ystem|crollPane|t(?:yleSheet|age|ream)|ound|e(?:ndEvent|rviceObject)|OAPCall|lide)|N(?:umericStepper|et(?:stream|S(?:tream|ervices)|Connection|Debug(?:Config)?))|C(?:heckBox|o(?:ntextMenu(?:Item)?|okie|lor|m(?:ponentMixins|boBox))|ustomActions|lient|amera)|T(?:ypedValue|ext(?:Snapshot|Input|F(?:ield|ormat)|Area)|ree|AB)|Object|D(?:ownload|elta(?:Item|Packet)?|at(?:e(?:Chooser|Field)?|a(?:G(?:lue|rid)|Set|Type)))|U(?:RL|TC|IScrollBar)|P(?:opUpManager|endingCall|r(?:intJob|o(?:duct|gressBar)))|E(?:ndPoint|rror)|Video|Key|F(?:RadioButton|GridColumn|MessageBox|BarChart|S(?:croll(?:Bar|Pane)|tyleFormat|plitView)|orm|C(?:heckbox|omboBox|alendar)|unction|T(?:icker|ooltip(?:Lite)?|ree(?:Node)?)|IconButton|D(?:ataGrid|raggablePane)|P(?:ieChart|ushButton|ro(?:gressBar|mptBox))|L(?:i(?:stBox|neChart)|oadingBox)|AdvancedMessageBox)|W(?:indow|SDLURL|ebService(?:Connector)?)|L(?:ist|o(?:calConnection|ad(?:er|Vars)|g)|a(?:unch|bel))|A(?:sBroadcaster|cc(?:ordion|essibility)|S(?:Set(?:Native|PropFlags)|N(?:ew|ative)|C(?:onstructor|lamp(?:2)?)|InstanceOf)|pplication|lert|rray))\\b' }, + { token: 'support.function.actionscript.2', + regex: '\\b(?:s(?:h(?:ift|ow(?:GridLines|Menu|Border|Settings|Headers|ColumnHeaders|Today|Preferences)?|ad(?:ow|ePane))|c(?:hema|ale(?:X|Mode|Y|Content)|r(?:oll(?:Track|Drag)?|een(?:Resolution|Color|DPI)))|t(?:yleSheet|op(?:Drag|A(?:nimation|llSounds|gent))?|epSize|a(?:tus|rt(?:Drag|A(?:nimation|gent))?))|i(?:n|ze|lence(?:TimeOut|Level))|o(?:ngname|urce|rt(?:Items(?:By)?|On(?:HeaderRelease)?|able(?:Columns)?)?)|u(?:ppressInvalidCalls|bstr(?:ing)?)|p(?:li(?:ce|t)|aceCol(?:umnsEqually|lumnsEqually))|e(?:nd(?:DefaultPushButtonEvent|AndLoad)?|curity|t(?:R(?:GB|o(?:otNode|w(?:Height|Count))|esizable(?:Columns)?|a(?:nge|te))|G(?:ain|roupName)|X(?:AxisTitle)?|M(?:i(?:n(?:imum|utes)|lliseconds)|o(?:nth(?:Names)?|tionLevel|de)|ultilineMode|e(?:ssage|nu(?:ItemEnabled(?:At)?|EnabledAt)|dia)|a(?:sk|ximum))|B(?:u(?:tton(?:s|Width)|fferTime)|a(?:seTabIndex|ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Target|P(?:osition|roperties)|barState|Location)|t(?:yle(?:Property)?|opOnFocus|at(?:us|e))|i(?:ze|lenceLevel)|ort(?:able(?:Columns)?|Function)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)?|Style|Color|ed(?:Node(?:s)?|Cell|I(?:nd(?:ices|ex)|tem(?:s)?))?|able))|kin|m(?:oothness|allScroll))|H(?:ighlight(?:s|Color)|Scroll|o(?:urs|rizontal)|eader(?:Symbol|Height|Text|Property|Format|Width|Location)?|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:ode(?:Properties|ExpansionHandler)|ewTextFormat)|C(?:h(?:ildNodes|a(?:ngeHandler|rt(?:Title|EventHandler)))|o(?:ntent(?:Size)?|okie|lumns)|ell(?:Symbol|Data)|l(?:i(?:ckHandler|pboard)|oseHandler)|redentials)|T(?:ype(?:dVaule)?|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:out(?:Handler)?)?)|oggle|extFormat|ransform)|I(?:s(?:Branch|Open)|n(?:terval|putProperty)|con(?:SymbolName)?|te(?:rator|m(?:ByKey|Symbol)))|Orientation|D(?:i(?:splay(?:Range|Graphics|Mode|Clip|Text|edMonth)|rection)|uration|e(?:pth(?:Below|To|Above)|fault(?:GatewayURL|Mappings|NodeIconSymbolName)|l(?:iveryMode|ay)|bug(?:ID)?)|a(?:yOfWeekNames|t(?:e(?:Filter)?|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Provider|All(?:Height|Property|Format|Width))?))|ra(?:wConnectors|gContent))|U(?:se(?:Shadow|HandCursor|EchoSuppression|rInput|Fade)|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear))|P(?:osition|ercentComplete|an(?:e(?:M(?:inimumSize|aximumSize)|Size|Title))?|ro(?:pert(?:y(?:Data)?|iesAt)|gress))|E(?:nabled|dit(?:Handler|able)|xpand(?:NodeTrigger|erSymbolName))|V(?:Scroll|olume|alue(?:Source)?)|KeyFrameInterval|Quality|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|ocus|ullYear|ps|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:opback|adTarget)|a(?:rgeScroll|bel(?:Source|Placement)?))|A(?:s(?:Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:e(?:State(?:Handler)?|Handler)|ateHandler)|utoH(?:ideScrollBar|eight)))?|paratorBefore|ek|lect(?:ion(?:Disabled|Unfocused)?|ed(?:Node(?:s)?|Child|I(?:nd(?:ices|ex)|tem(?:s)?)|Dat(?:e|a))?|able(?:Ranges)?)|rver(?:String)?)|kip|qrt|wapDepths|lice|aveToSharedObj|moothing)|h(?:scroll(?:Policy)?|tml(?:Text)?|i(?:t(?:Test(?:TextNearPos)?|Area)|de(?:BuiltInItems|Child)?|ghlight(?:2D|3D)?)|orizontal|e(?:ight|ader(?:Re(?:nderer|lease)|Height|Text))|P(?:osition|ageScrollSize)|a(?:s(?:childNodes|MP3|S(?:creen(?:Broadcast|Playback)|treaming(?:Video|Audio)|ort)|Next|OwnProperty|Pr(?:inting|evious)|EmbeddedVideo|VideoEncoder|A(?:ccesibility|udio(?:Encoder)?))|ndlerName)|LineScrollSize)|ye(?:sLabel|ar)|n(?:o(?:t|de(?:Name|Close|Type|Open|Value)|Label)|u(?:llValue|mChild(?:S(?:creens|lides)|ren|Forms))|e(?:w(?:Item|line|Value|LocationDialog)|xt(?:S(?:cene|ibling|lide)|TabIndex|Value|Frame)?)?|ame(?:s)?)|c(?:h(?:ildNodes|eck|a(?:nge(?:sPending)?|r(?:CodeAt|At))|r)|o(?:s|n(?:st(?:ant|ructor)|nect|c(?:urrency|at)|t(?:ent(?:Type|Path)?|ains|rol(?:Placement|lerPolicy))|denseWhite|version)|py|l(?:or|umn(?:Stretch|Name(?:s)?|Count))|m(?:p(?:onent|lete)|ment))|u(?:stomItems|ePoint(?:s)?|r(?:veTo|Value|rent(?:Slide|ChildSlide|Item|F(?:ocused(?:S(?:creen|lide)|Form)|ps))))|e(?:il|ll(?:Renderer|Press|Edit|Focus(?:In|Out)))|l(?:i(?:ck|ents)|o(?:se(?:Button|Pane)?|ne(?:Node)?)|ear(?:S(?:haredObjects|treams)|Timeout|Interval)?)|a(?:ncelLabel|tch|p(?:tion|abilities)|l(?:cFields|l(?:e(?:e|r))?))|reate(?:GatewayConnection|Menu|Se(?:rver|gment)|C(?:hild(?:AtDepth)?|l(?:ient|ass(?:ChildAtDepth|Object(?:AtDepth)?))|all)|Text(?:Node|Field)|Item|Object(?:AtDepth)?|PopUp|E(?:lement|mptyMovieClip)))|t(?:h(?:is|row)|ype(?:of|Name)?|i(?:tle(?:StyleDeclaration)?|me(?:out)?)|o(?:talTime|String|olTipText|p|UpperCase|ggle(?:HighQuality)?|Lo(?:caleString|werCase))|e(?:st|llTarget|xt(?:RightMargin|Bold|S(?:ize|elected)|Height|Color|I(?:ndent|talic)|Disabled|Underline|F(?:ield|ont)|Width|LeftMargin|Align)?)|a(?:n|rget(?:Path)?|b(?:Stops|Children|Index|Enabled|leName))|r(?:y|igger|ac(?:e|k(?:AsMenu)?)))|i(?:s(?:Running|Branch|NaN|Con(?:soleOpen|nected)|Toggled|Installed|Open|D(?:own|ebugger)|P(?:urchased|ro(?:totypeOf|pertyEnumerable))|Empty|F(?:inite|ullyPopulated)|Local|Active)|n(?:s(?:tall|ertBefore)|cludeDeltaPacketInfo|t|it(?:ialize|Component|Pod|A(?:pplication|gent))?|de(?:nt|terminate|x(?:InParent(?:Slide|Form)?|Of)?)|put|validate|finity|LocalInternetCache)?|con(?:F(?:ield|unction))?|t(?:e(?:ratorScrolled|m(?:s|RollO(?:ut|ver)|ClassName))|alic)|d3|p|fFrameLoaded|gnore(?:Case|White))|o(?:s|n(?:R(?:ollO(?:ut|ver)|e(?:s(?:ize|ult)|l(?:ease(?:Outside)?|aseOutside)))|XML|Mouse(?:Move|Down|Up|Wheel)|S(?:ync|croller|tatus|oundComplete|e(?:tFocus|lect(?:edItem)?))|N(?:oticeEvent|etworkChange)|C(?:hanged|onnect|l(?:ipEvent|ose))|ID3|D(?:isconnect|eactivate|ata|ragO(?:ut|ver))|Un(?:install|load)|P(?:aymentResult|ress)|EnterFrame|K(?:illFocus|ey(?:Down|Up))|Fault|Lo(?:ad|g)|A(?:ctiv(?:ity|ate)|ppSt(?:op|art)))?|pe(?:n|ration)|verLayChildren|kLabel|ldValue|r(?:d)?)|d(?:i(?:s(?:connect|play(?:Normal|ed(?:Month|Year)|Full)|able(?:Shader|d(?:Ranges|Days)|CloseBox|Events))|rection)|o(?:cTypeDecl|tall|Decoding|main|LazyDecoding)|u(?:plicateMovieClip|ration)|e(?:stroy(?:ChildAt|Object)|code|fault(?:PushButton(?:Enabled)?|KeydownHandler)?|l(?:ta(?:Packet(?:Changed)?)?|ete(?:PopUp|All)?)|blocking)|a(?:shBoardSave|yNames|ta(?:Provider)?|rkshadow)|r(?:opdown(?:Width)?|a(?:w|gO(?:ut|ver))))|u(?:se(?:Sort|HandCursor|Codepage|EchoSuppression)|n(?:shift|install|derline|escape|format|watch|lo(?:ck|ad(?:Movie(?:Num)?)?))|pdate(?:Results|Mode|I(?:nputProperties|tem(?:ByIndex)?)|P(?:acket|roperties)|View|AfterEvent)|rl)|join|p(?:ixelAspectRatio|o(?:sition|p|w)|u(?:sh|rge|blish)|ercen(?:tComplete|Loaded)|lay(?:head(?:Change|Time)|ing|Hidden|erType)?|a(?:ssword|use|r(?:se(?:XML|CSS|Int|Float)|ent(?:Node|Is(?:S(?:creen|lide)|Form))|ams))|r(?:int(?:Num|AsBitmap(?:Num)?)?|o(?:to(?:type)?|pert(?:y|ies)|gress)|e(?:ss|v(?:ious(?:S(?:ibling|lide)|Value)?|Scene|Frame)|ferred(?:Height|Width))))|e(?:scape|n(?:code(?:r)?|ter(?:Frame)?|dFill|able(?:Shader|d|CloseBox|Events))|dit(?:able|Field|LocationDialog)|v(?:ent|al(?:uate)?)|q|x(?:tended|p|ec(?:ute)?|actSettings)|m(?:phasized(?:StyleDeclaration)?|bedFonts))|v(?:i(?:sible|ewPod)|ScrollPolicy|o(?:id|lume)|ersion|P(?:osition|ageScrollSize)|a(?:l(?:idat(?:ionError|e(?:Property|ActivationKey)?)|ue(?:Of)?)|riable)|LineScrollSize)|k(?:ind|ey(?:Down|Up|Press|FrameInterval))|q(?:sort|uality)|f(?:scommand|i(?:n(?:d(?:Text|First|Last)?|ally)|eldInfo|lter(?:ed|Func)?|rst(?:Slide|Child|DayOfWeek|VisibleNode)?)|o(?:nt|cus(?:In|edCell|Out|Enabled)|r(?:egroundDisabled|mat(?:ter)?))|unctionName|ps|l(?:oor|ush)|ace|romCharCode)|w(?:i(?:th|dth)|ordWrap|atch|riteAccess)|l(?:t|i(?:st(?:Owner)?|ne(?:Style|To))|o(?:c(?:k|a(?:t(?:ion|eByld)|l(?:ToGlobal|FileReadDisable)))|opback|ad(?:Movie(?:Num)?|S(?:crollContent|ound)|ed|Variables(?:Num)?|Application)?|g(?:Changes)?)|e(?:ngth|ft(?:Margin)?|ading)?|a(?:st(?:Slide|Child|Index(?:Of)?)?|nguage|b(?:el(?:Placement|F(?:ield|unction))?|leField)))|a(?:s(?:scociate(?:Controller|Display)|in|pectRatio|function)|nd|c(?:ceptConnection|tiv(?:ityLevel|ePlayControl)|os)|t(?:t(?:ach(?:Movie|Sound|Video|Audio)|ributes)|an(?:2)?)|dd(?:header|RequestHeader|Menu(?:Item(?:At)?|At)?|Sort|Header|No(?:tice|de(?:At)?)|C(?:olumn(?:At)?|uePoint)|T(?:oLocalInternetCache|reeNode(?:At)?)|I(?:con|tem(?:s(?:At)?|At)?)|DeltaItem|P(?:od|age|roperty)|EventListener|View|FieldInfo|Listener|Animation)?|uto(?:Size|Play|KeyNav|Load)|pp(?:endChild|ly(?:Changes|Updates)?)|vHardwareDisable|fterLoaded|l(?:ternateRowColors|ign|l(?:ow(?:InsecureDomain|Domain)|Transitions(?:InDone|OutDone))|bum)|r(?:tist|row|g(?:uments|List))|gent|bs)|r(?:ight(?:Margin)?|o(?:ot(?:S(?:creen|lide)|Form)|und|w(?:Height|Count)|llO(?:ut|ver))|e(?:s(?:yncDepth|t(?:orePane|artAnimation|rict)|iz(?:e|able(?:Columns)?)|olveDelta|ult(?:s)?|ponse)|c(?:o(?:ncile(?:Results|Updates)|rd)|eive(?:Video|Audio))|draw|jectConnection|place(?:Sel|ItemAt|AllItems)?|ve(?:al(?:Child)?|rse)|quest(?:SizeChange|Payment)?|f(?:errer|resh(?:ScrollContent|Destinations|Pane|FromSources)?)|lease(?:Outside)?|ad(?:Only|Access)|gister(?:SkinElement|C(?:olor(?:Style|Name)|lass)|InheritingStyle|Proxy)|move(?:Range|M(?:ovieClip|enu(?:Item(?:At)?|At))|Background|Sort|No(?:tice|de(?:sAt|At)?)|C(?:olum(?:nAt|At)|uePoints)|T(?:extField|reeNode(?:At)?)|Item(?:At)?|Pod|EventListener|FromLocalInternetCache|Listener|All(?:C(?:olumns|uePoints)|Items)?))|a(?:ndom|te|dioDot))|g(?:t|oto(?:Slide|NextSlide|PreviousSlide|FirstSlide|LastSlide|And(?:Stop|Play))|e(?:nre|t(?:R(?:GB|o(?:otNode|wCount)|e(?:sizable|mote))|X(?:AxisTitle)?|M(?:i(?:n(?:imum(?:Size)?|utes)|lliseconds)|onth(?:Names)?|ultilineMode|e(?:ssage|nu(?:ItemAt|EnabledAt|At))|aximum(?:Size)?)|B(?:ytes(?:Total|Loaded)|ounds|utton(?:s|Width)|eginIndex|a(?:ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Position|barState|Location)|t(?:yle(?:Names)?|opOnFocus|ate)|ize|o(?:urce|rtState)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)|Style|ed(?:Node(?:s)?|Cell|Text|I(?:nd(?:ices|ex)|tem(?:s)?))?)|rvice)|moothness|WFVersion)|H(?:ighlight(?:s|Color)|ours|e(?:ight|ader(?:Height|Text|Property|Format|Width|Location)?)|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:o(?:tices|de(?:DisplayedAt|At))|um(?:Children|berAvailable)|e(?:wTextFormat|xtHighestDepth))|C(?:h(?:ild(?:S(?:creen|lide)|Nodes|Form|At)|artTitle)|o(?:n(?:tent|figInfo)|okie|de|unt|lumn(?:Names|Count|Index|At))|uePoint|ellIndex|loseHandler|a(?:ll|retIndex))|T(?:ypedValue|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:stamp|zoneOffset|out(?:State|Handler)|r)?)|oggle|ext(?:Extent|Format)?|r(?:ee(?:NodeAt|Length)|ans(?:form|actionId)))|I(?:s(?:Branch|Open)|n(?:stanceAtDepth|d(?:icesByKey|exByKey))|con(?:SymbolName)?|te(?:rator|m(?:sByKey|By(?:Name|Key)|id|ID|At))|d)|O(?:utput(?:Parameter(?:s|ByName)?|Value(?:s)?)|peration|ri(?:entation|ginalCellData))|D(?:i(?:s(?:play(?:Range|Mode|Clip|Index|edMonth)|kUsage)|rection)|uration|e(?:pth|faultNodeIconSymbolName|l(?:taPacket|ay)|bug(?:Config|ID)?)|a(?:y(?:OfWeekNames)?|t(?:e|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Label|All(?:Height|Property|Format|Width))?))|rawConnectors)|U(?:se(?:Shadow|HandCursor|rInput|Fade)|RL|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear))|P(?:o(?:sition|ds)|ercentComplete|a(?:n(?:e(?:M(?:inimums|aximums)|Height|Title|Width))?|rentNode)|r(?:operty(?:Name|Data)?|efer(?:ences|red(?:Height|Width))))|E(?:n(?:dIndex|abled)|ditingData|x(?:panderSymbolName|andNodeTrigger))|V(?:iewed(?:Pods|Applications)|olume|ersion|alue(?:Source)?)|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|o(?:ntList|cus)|ullYear|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:cal|adTarget)|ength|a(?:stTabIndex|bel(?:Source)?))|A(?:s(?:cii|Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:eState(?:Handler)?|ateHandler)|utoH(?:ideScrollBar|eight)|llItems|gent))?)?|lobal(?:StyleFormat|ToLocal)?|ain|roupName)|x(?:updatePackety|mlDecl)?|m(?:y(?:MethodName|Call)|in(?:imum)?|o(?:nthNames|tion(?:TimeOut|Level)|de(?:lChanged)?|use(?:Move|O(?:ut|ver)|Down(?:Somewhere|Outside)?|Up(?:Somewhere)?|WheelEnabled)|ve(?:To)?)|u(?:ted|lti(?:pleS(?:imultaneousAllowed|elections)|line))|e(?:ssage|nu(?:Show|Hide)?|th(?:od)?|diaType)|a(?:nufacturer|tch|x(?:scroll|hscroll|imum|HPosition|Chars|VPosition)?)|b(?:substring|chr|ord|length))|b(?:ytes(?:Total|Loaded)|indFormat(?:Strings|Function)|o(?:ttom(?:Scroll)?|ld|rder(?:Color)?)|u(?:tton(?:Height|Width)|iltInItems|ffer(?:Time|Length)|llet)|e(?:foreApplyUpdates|gin(?:GradientFill|Fill))|lockIndent|a(?:ndwidth|ckground(?:Style|Color|Disabled)?)|roadcastMessage)|onHTTPStatus)\\b' }, + { token: 'support.constant.actionscript.2', + regex: '\\b(?:__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\\b' }, + { token: 'keyword.control.actionscript.2', + regex: '\\b(?:dynamic|extends|import|implements|interface|public|private|new|static|super|var|for|in|break|continue|while|do|return|if|else|case|switch)\\b' }, + { token: 'storage.type.actionscript.2', + regex: '\\b(?:Boolean|Number|String|Void)\\b' }, + { token: 'constant.language.actionscript.2', + regex: '\\b(?:null|undefined|true|false)\\b' }, + { token: 'constant.numeric.actionscript.2', + regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' }, + { token: 'punctuation.definition.string.begin.actionscript.2', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.actionscript.2', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.actionscript.2', + regex: '\\\\.' }, + { defaultToken: 'string.quoted.double.actionscript.2' } ] }, + { token: 'punctuation.definition.string.begin.actionscript.2', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.actionscript.2', + regex: '\'', + next: 'pop' }, + { token: 'constant.character.escape.actionscript.2', + regex: '\\\\.' }, + { defaultToken: 'string.quoted.single.actionscript.2' } ] }, + { token: 'support.constant.actionscript.2', + regex: '\\b(?:BACKSPACE|CAPSLOCK|CONTROL|DELETEKEY|DOWN|END|ENTER|HOME|INSERT|LEFT|LN10|LN2|LOG10E|LOG2E|MAX_VALUE|MIN_VALUE|NEGATIVE_INFINITY|NaN|PGDN|PGUP|PI|POSITIVE_INFINITY|RIGHT|SPACE|SQRT1_2|SQRT2|UP)\\b' }, + { token: 'punctuation.definition.comment.actionscript.2', + regex: '/\\*', + push: + [ { token: 'punctuation.definition.comment.actionscript.2', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.actionscript.2' } ] }, + { token: 'punctuation.definition.comment.actionscript.2', + regex: '//', + push: + [ { token: 'comment.line.double-slash.actionscript.2', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.double-slash.actionscript.2' } ] }, + { token: 'keyword.operator.actionscript.2', + regex: '\\binstanceof\\b' }, + { token: 'keyword.operator.symbolic.actionscript.2', + regex: '[-!%&*+=/?:]' }, + { token: + [ 'meta.preprocessor.actionscript.2', + 'punctuation.definition.preprocessor.actionscript.2', + 'meta.preprocessor.actionscript.2' ], + regex: '^([ \\t]*)(#)([a-zA-Z]+)' }, + { token: + [ 'storage.type.function.actionscript.2', + 'meta.function.actionscript.2', + 'entity.name.function.actionscript.2', + 'meta.function.actionscript.2', + 'punctuation.definition.parameters.begin.actionscript.2' ], + regex: '\\b(function)(\\s+)([a-zA-Z_]\\w*)(\\s*)(\\()', + push: + [ { token: 'punctuation.definition.parameters.end.actionscript.2', + regex: '\\)', + next: 'pop' }, + { token: 'variable.parameter.function.actionscript.2', + regex: '[^,)$]+' }, + { defaultToken: 'meta.function.actionscript.2' } ] }, + { token: + [ 'storage.type.class.actionscript.2', + 'meta.class.actionscript.2', + 'entity.name.type.class.actionscript.2', + 'meta.class.actionscript.2', + 'storage.modifier.extends.actionscript.2', + 'meta.class.actionscript.2', + 'entity.other.inherited-class.actionscript.2' ], + regex: '\\b(class)(\\s+)([a-zA-Z_](?:\\w|\\.)*)(?:(\\s+)(extends)(\\s+)([a-zA-Z_](?:\\w|\\.)*))?' } ] } + + this.normalizeRules(); +}; + +ActionScriptHighlightRules.metaData = { fileTypes: [ 'as' ], + keyEquivalent: '^~A', + name: 'ActionScript', + scopeName: 'source.actionscript.2' } + + +oop.inherits(ActionScriptHighlightRules, TextHighlightRules); + +exports.ActionScriptHighlightRules = ActionScriptHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/erlang.js b/lib/ace/mode/erlang.js new file mode 100644 index 00000000..8dcb42ea --- /dev/null +++ b/lib/ace/mode/erlang.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var ErlangHighlightRules = require("./erlang_highlight_rules").ErlangHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new ErlangHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "%"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/erlang_highlight_rules.js b/lib/ace/mode/erlang_highlight_rules.js new file mode 100644 index 00000000..c225431c --- /dev/null +++ b/lib/ace/mode/erlang_highlight_rules.js @@ -0,0 +1,876 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from tm bundles\erlang.tmbundle\Syntaxes\Erlang.plist (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ErlangHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { include: '#module-directive' }, + { include: '#import-export-directive' }, + { include: '#behaviour-directive' }, + { include: '#record-directive' }, + { include: '#define-directive' }, + { include: '#macro-directive' }, + { include: '#directive' }, + { include: '#function' }, + { include: '#everything-else' } ], + '#atom': + [ { token: 'punctuation.definition.symbol.begin.erlang', + regex: '\'', + push: + [ { token: 'punctuation.definition.symbol.end.erlang', + regex: '\'', + next: 'pop' }, + { token: + [ 'punctuation.definition.escape.erlang', + 'constant.other.symbol.escape.erlang', + 'punctuation.definition.escape.erlang', + 'constant.other.symbol.escape.erlang', + 'constant.other.symbol.escape.erlang' ], + regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, + { token: 'invalid.illegal.atom.erlang', regex: '\\\\\\^?.?' }, + { defaultToken: 'constant.other.symbol.quoted.single.erlang' } ] }, + { token: 'constant.other.symbol.unquoted.erlang', + regex: '[a-z][a-zA-Z\\d@_]*' } ], + '#behaviour-directive': + [ { token: + [ 'meta.directive.behaviour.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.behaviour.erlang', + 'keyword.control.directive.behaviour.erlang', + 'meta.directive.behaviour.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.behaviour.erlang', + 'entity.name.type.class.behaviour.definition.erlang', + 'meta.directive.behaviour.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.behaviour.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(behaviour)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' } ], + '#binary': + [ { token: 'punctuation.definition.binary.begin.erlang', + regex: '<<', + push: + [ { token: 'punctuation.definition.binary.end.erlang', + regex: '>>', + next: 'pop' }, + { token: + [ 'punctuation.separator.binary.erlang', + 'punctuation.separator.value-size.erlang' ], + regex: '(,)|(:)' }, + { include: '#internal-type-specifiers' }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.binary.erlang' } ] } ], + '#character': + [ { token: + [ 'punctuation.definition.character.erlang', + 'punctuation.definition.escape.erlang', + 'constant.character.escape.erlang', + 'punctuation.definition.escape.erlang', + 'constant.character.escape.erlang', + 'constant.character.escape.erlang' ], + regex: '(\\$)(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, + { token: 'invalid.illegal.character.erlang', + regex: '\\$\\\\\\^?.?' }, + { token: + [ 'punctuation.definition.character.erlang', + 'constant.character.erlang' ], + regex: '(\\$)(\\S)' }, + { token: 'invalid.illegal.character.erlang', regex: '\\$.?' } ], + '#comment': + [ { token: 'punctuation.definition.comment.erlang', + regex: '%', + push: + [ { token: 'comment.line.percentage.erlang', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.percentage.erlang' } ] } ], + '#define-directive': + [ { token: + [ 'meta.directive.define.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.define.erlang', + 'keyword.control.directive.define.erlang', + 'meta.directive.define.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.define.erlang', + 'entity.name.function.macro.definition.erlang', + 'meta.directive.define.erlang', + 'punctuation.separator.parameters.erlang' ], + regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(,)', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.define.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\))(\\s*)(\\.)', + next: 'pop' }, + { include: '#everything-else' }, + { defaultToken: 'meta.directive.define.erlang' } ] }, + { token: 'meta.directive.define.erlang', + regex: '(?=^\\s*-\\s*define\\s*\\(\\s*[a-zA-Z\\d@_]+\\s*\\()', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.define.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\))(\\s*)(\\.)', + next: 'pop' }, + { token: + [ 'text', + 'punctuation.section.directive.begin.erlang', + 'text', + 'keyword.control.directive.define.erlang', + 'text', + 'punctuation.definition.parameters.begin.erlang', + 'text', + 'entity.name.function.macro.definition.erlang', + 'text', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\()', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'text', + 'punctuation.separator.parameters.erlang' ], + regex: '(\\))(\\s*)(,)', + next: 'pop' }, + { token: 'punctuation.separator.parameters.erlang', regex: ',' }, + { include: '#everything-else' } ] }, + { token: 'punctuation.separator.define.erlang', + regex: '\\|\\||\\||:|;|,|\\.|->' }, + { include: '#everything-else' }, + { defaultToken: 'meta.directive.define.erlang' } ] } ], + '#directive': + [ { token: + [ 'meta.directive.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.erlang', + 'keyword.control.directive.erlang', + 'meta.directive.erlang', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\(?)', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\)?)(\\s*)(\\.)', + next: 'pop' }, + { include: '#everything-else' }, + { defaultToken: 'meta.directive.erlang' } ] }, + { token: + [ 'meta.directive.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.erlang', + 'keyword.control.directive.erlang', + 'meta.directive.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\.)' } ], + '#everything-else': + [ { include: '#comment' }, + { include: '#record-usage' }, + { include: '#macro-usage' }, + { include: '#expression' }, + { include: '#keyword' }, + { include: '#textual-operator' }, + { include: '#function-call' }, + { include: '#tuple' }, + { include: '#list' }, + { include: '#binary' }, + { include: '#parenthesized-expression' }, + { include: '#character' }, + { include: '#number' }, + { include: '#atom' }, + { include: '#string' }, + { include: '#symbolic-operator' }, + { include: '#variable' } ], + '#expression': + [ { token: 'keyword.control.if.erlang', + regex: '\\bif\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.if.erlang' } ] }, + { token: 'keyword.control.case.erlang', + regex: '\\bcase\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.case.erlang' } ] }, + { token: 'keyword.control.receive.erlang', + regex: '\\breceive\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.receive.erlang' } ] }, + { token: + [ 'keyword.control.fun.erlang', + 'text', + 'entity.name.type.class.module.erlang', + 'text', + 'punctuation.separator.module-function.erlang', + 'text', + 'entity.name.function.erlang', + 'text', + 'punctuation.separator.function-arity.erlang' ], + regex: '\\b(fun)(\\s*)(?:([a-z][a-zA-Z\\d@_]*)(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*)(\\s*)(/)' }, + { token: 'keyword.control.fun.erlang', + regex: '\\bfun\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { token: 'text', + regex: '(?=\\()', + push: + [ { token: 'punctuation.separator.clauses.erlang', + regex: ';|(?=\\bend\\b)', + next: 'pop' }, + { include: '#internal-function-parts' } ] }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.fun.erlang' } ] }, + { token: 'keyword.control.try.erlang', + regex: '\\btry\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.try.erlang' } ] }, + { token: 'keyword.control.begin.erlang', + regex: '\\bbegin\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.begin.erlang' } ] }, + { token: 'keyword.control.query.erlang', + regex: '\\bquery\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.query.erlang' } ] } ], + '#function': + [ { token: + [ 'meta.function.erlang', + 'entity.name.function.definition.erlang', + 'meta.function.erlang' ], + regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()', + push: + [ { token: 'punctuation.terminator.function.erlang', + regex: '\\.', + next: 'pop' }, + { token: [ 'text', 'entity.name.function.erlang', 'text' ], + regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()' }, + { token: 'text', + regex: '(?=\\()', + push: + [ { token: 'punctuation.separator.clauses.erlang', + regex: ';|(?=\\.)', + next: 'pop' }, + { include: '#parenthesized-expression' }, + { include: '#internal-function-parts' } ] }, + { include: '#everything-else' }, + { defaultToken: 'meta.function.erlang' } ] } ], + '#function-call': + [ { token: 'meta.function-call.erlang', + regex: '(?=(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*(?:\\(|:\\s*(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*\\())', + push: + [ { token: 'punctuation.definition.parameters.end.erlang', + regex: '\\)', + next: 'pop' }, + { token: + [ 'entity.name.type.class.module.erlang', + 'text', + 'punctuation.separator.module-function.erlang', + 'text', + 'entity.name.function.guard.erlang', + 'text', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '(?:(erlang)(\\s*)(:)(\\s*))?(is_atom|is_binary|is_constant|is_float|is_function|is_integer|is_list|is_number|is_pid|is_port|is_reference|is_tuple|is_record|abs|element|hd|length|node|round|self|size|tl|trunc)(\\s*)(\\()', + push: + [ { token: 'text', regex: '(?=\\))', next: 'pop' }, + { token: 'punctuation.separator.parameters.erlang', regex: ',' }, + { include: '#everything-else' } ] }, + { token: + [ 'entity.name.type.class.module.erlang', + 'text', + 'punctuation.separator.module-function.erlang', + 'text', + 'entity.name.function.erlang', + 'text', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\()', + push: + [ { token: 'text', regex: '(?=\\))', next: 'pop' }, + { token: 'punctuation.separator.parameters.erlang', regex: ',' }, + { include: '#everything-else' } ] }, + { defaultToken: 'meta.function-call.erlang' } ] } ], + '#import-export-directive': + [ { token: + [ 'meta.directive.import.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.import.erlang', + 'keyword.control.directive.import.erlang', + 'meta.directive.import.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.import.erlang', + 'entity.name.type.class.module.erlang', + 'meta.directive.import.erlang', + 'punctuation.separator.parameters.erlang' ], + regex: '^(\\s*)(-)(\\s*)(import)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.import.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\))(\\s*)(\\.)', + next: 'pop' }, + { include: '#internal-function-list' }, + { defaultToken: 'meta.directive.import.erlang' } ] }, + { token: + [ 'meta.directive.export.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.export.erlang', + 'keyword.control.directive.export.erlang', + 'meta.directive.export.erlang', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '^(\\s*)(-)(\\s*)(export)(\\s*)(\\()', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.export.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\))(\\s*)(\\.)', + next: 'pop' }, + { include: '#internal-function-list' }, + { defaultToken: 'meta.directive.export.erlang' } ] } ], + '#internal-expression-punctuation': + [ { token: + [ 'punctuation.separator.clause-head-body.erlang', + 'punctuation.separator.clauses.erlang', + 'punctuation.separator.expressions.erlang' ], + regex: '(->)|(;)|(,)' } ], + '#internal-function-list': + [ { token: 'punctuation.definition.list.begin.erlang', + regex: '\\[', + push: + [ { token: 'punctuation.definition.list.end.erlang', + regex: '\\]', + next: 'pop' }, + { token: + [ 'entity.name.function.erlang', + 'text', + 'punctuation.separator.function-arity.erlang' ], + regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(/)', + push: + [ { token: 'punctuation.separator.list.erlang', + regex: ',|(?=\\])', + next: 'pop' }, + { include: '#everything-else' } ] }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.list.function.erlang' } ] } ], + '#internal-function-parts': + [ { token: 'text', + regex: '(?=\\()', + push: + [ { token: 'punctuation.separator.clause-head-body.erlang', + regex: '->', + next: 'pop' }, + { token: 'punctuation.definition.parameters.begin.erlang', + regex: '\\(', + push: + [ { token: 'punctuation.definition.parameters.end.erlang', + regex: '\\)', + next: 'pop' }, + { token: 'punctuation.separator.parameters.erlang', regex: ',' }, + { include: '#everything-else' } ] }, + { token: 'punctuation.separator.guards.erlang', regex: ',|;' }, + { include: '#everything-else' } ] }, + { token: 'punctuation.separator.expressions.erlang', + regex: ',' }, + { include: '#everything-else' } ], + '#internal-record-body': + [ { token: 'punctuation.definition.class.record.begin.erlang', + regex: '\\{', + push: + [ { token: 'meta.structure.record.erlang', + regex: '(?=\\})', + next: 'pop' }, + { token: + [ 'variable.other.field.erlang', + 'variable.language.omitted.field.erlang', + 'text', + 'keyword.operator.assignment.erlang' ], + regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')|(_))(\\s*)(=|::)', + push: + [ { token: 'punctuation.separator.class.record.erlang', + regex: ',|(?=\\})', + next: 'pop' }, + { include: '#everything-else' } ] }, + { token: + [ 'variable.other.field.erlang', + 'text', + 'punctuation.separator.class.record.erlang' ], + regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)((?:,)?)' }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.record.erlang' } ] } ], + '#internal-type-specifiers': + [ { token: 'punctuation.separator.value-type.erlang', + regex: '/', + push: + [ { token: 'text', regex: '(?=,|:|>>)', next: 'pop' }, + { token: + [ 'storage.type.erlang', + 'storage.modifier.signedness.erlang', + 'storage.modifier.endianness.erlang', + 'storage.modifier.unit.erlang', + 'punctuation.separator.type-specifiers.erlang' ], + regex: '(integer|float|binary|bytes|bitstring|bits)|(signed|unsigned)|(big|little|native)|(unit)|(-)' } ] } ], + '#keyword': + [ { token: 'keyword.control.erlang', + regex: '\\b(?:after|begin|case|catch|cond|end|fun|if|let|of|query|try|receive|when)\\b' } ], + '#list': + [ { token: 'punctuation.definition.list.begin.erlang', + regex: '\\[', + push: + [ { token: 'punctuation.definition.list.end.erlang', + regex: '\\]', + next: 'pop' }, + { token: 'punctuation.separator.list.erlang', + regex: '\\||\\|\\||,' }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.list.erlang' } ] } ], + '#macro-directive': + [ { token: + [ 'meta.directive.ifdef.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.ifdef.erlang', + 'keyword.control.directive.ifdef.erlang', + 'meta.directive.ifdef.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.ifdef.erlang', + 'entity.name.function.macro.erlang', + 'meta.directive.ifdef.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.ifdef.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(ifdef)(\\s*)(\\()(\\s*)([a-zA-z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }, + { token: + [ 'meta.directive.ifndef.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.ifndef.erlang', + 'keyword.control.directive.ifndef.erlang', + 'meta.directive.ifndef.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.ifndef.erlang', + 'entity.name.function.macro.erlang', + 'meta.directive.ifndef.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.ifndef.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(ifndef)(\\s*)(\\()(\\s*)([a-zA-z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }, + { token: + [ 'meta.directive.undef.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.undef.erlang', + 'keyword.control.directive.undef.erlang', + 'meta.directive.undef.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.undef.erlang', + 'entity.name.function.macro.erlang', + 'meta.directive.undef.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.undef.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(undef)(\\s*)(\\()(\\s*)([a-zA-z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' } ], + '#macro-usage': + [ { token: + [ 'keyword.operator.macro.erlang', + 'meta.macro-usage.erlang', + 'entity.name.function.macro.erlang' ], + regex: '(\\?\\??)(\\s*)([a-zA-Z\\d@_]+)' } ], + '#module-directive': + [ { token: + [ 'meta.directive.module.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.module.erlang', + 'keyword.control.directive.module.erlang', + 'meta.directive.module.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.module.erlang', + 'entity.name.type.class.module.definition.erlang', + 'meta.directive.module.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.module.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(module)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' } ], + '#number': + [ { token: 'text', + regex: '(?=\\d)', + push: + [ { token: 'text', regex: '(?!\\d)', next: 'pop' }, + { token: + [ 'constant.numeric.float.erlang', + 'punctuation.separator.integer-float.erlang', + 'constant.numeric.float.erlang', + 'punctuation.separator.float-exponent.erlang' ], + regex: '(\\d+)(\\.)(\\d+)((?:[eE][\\+\\-]?\\d+)?)' }, + { token: + [ 'constant.numeric.integer.binary.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.binary.erlang' ], + regex: '(2)(#)([0-1]+)' }, + { token: + [ 'constant.numeric.integer.base-3.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-3.erlang' ], + regex: '(3)(#)([0-2]+)' }, + { token: + [ 'constant.numeric.integer.base-4.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-4.erlang' ], + regex: '(4)(#)([0-3]+)' }, + { token: + [ 'constant.numeric.integer.base-5.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-5.erlang' ], + regex: '(5)(#)([0-4]+)' }, + { token: + [ 'constant.numeric.integer.base-6.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-6.erlang' ], + regex: '(6)(#)([0-5]+)' }, + { token: + [ 'constant.numeric.integer.base-7.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-7.erlang' ], + regex: '(7)(#)([0-6]+)' }, + { token: + [ 'constant.numeric.integer.octal.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.octal.erlang' ], + regex: '(8)(#)([0-7]+)' }, + { token: + [ 'constant.numeric.integer.base-9.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-9.erlang' ], + regex: '(9)(#)([0-8]+)' }, + { token: + [ 'constant.numeric.integer.decimal.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.decimal.erlang' ], + regex: '(10)(#)(\\d+)' }, + { token: + [ 'constant.numeric.integer.base-11.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-11.erlang' ], + regex: '(11)(#)([\\daA]+)' }, + { token: + [ 'constant.numeric.integer.base-12.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-12.erlang' ], + regex: '(12)(#)([\\da-bA-B]+)' }, + { token: + [ 'constant.numeric.integer.base-13.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-13.erlang' ], + regex: '(13)(#)([\\da-cA-C]+)' }, + { token: + [ 'constant.numeric.integer.base-14.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-14.erlang' ], + regex: '(14)(#)([\\da-dA-D]+)' }, + { token: + [ 'constant.numeric.integer.base-15.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-15.erlang' ], + regex: '(15)(#)([\\da-eA-E]+)' }, + { token: + [ 'constant.numeric.integer.hexadecimal.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.hexadecimal.erlang' ], + regex: '(16)(#)([\\da-fA-F]+)' }, + { token: + [ 'constant.numeric.integer.base-17.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-17.erlang' ], + regex: '(17)(#)([\\da-gA-G]+)' }, + { token: + [ 'constant.numeric.integer.base-18.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-18.erlang' ], + regex: '(18)(#)([\\da-hA-H]+)' }, + { token: + [ 'constant.numeric.integer.base-19.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-19.erlang' ], + regex: '(19)(#)([\\da-iA-I]+)' }, + { token: + [ 'constant.numeric.integer.base-20.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-20.erlang' ], + regex: '(20)(#)([\\da-jA-J]+)' }, + { token: + [ 'constant.numeric.integer.base-21.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-21.erlang' ], + regex: '(21)(#)([\\da-kA-K]+)' }, + { token: + [ 'constant.numeric.integer.base-22.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-22.erlang' ], + regex: '(22)(#)([\\da-lA-L]+)' }, + { token: + [ 'constant.numeric.integer.base-23.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-23.erlang' ], + regex: '(23)(#)([\\da-mA-M]+)' }, + { token: + [ 'constant.numeric.integer.base-24.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-24.erlang' ], + regex: '(24)(#)([\\da-nA-N]+)' }, + { token: + [ 'constant.numeric.integer.base-25.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-25.erlang' ], + regex: '(25)(#)([\\da-oA-O]+)' }, + { token: + [ 'constant.numeric.integer.base-26.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-26.erlang' ], + regex: '(26)(#)([\\da-pA-P]+)' }, + { token: + [ 'constant.numeric.integer.base-27.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-27.erlang' ], + regex: '(27)(#)([\\da-qA-Q]+)' }, + { token: + [ 'constant.numeric.integer.base-28.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-28.erlang' ], + regex: '(28)(#)([\\da-rA-R]+)' }, + { token: + [ 'constant.numeric.integer.base-29.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-29.erlang' ], + regex: '(29)(#)([\\da-sA-S]+)' }, + { token: + [ 'constant.numeric.integer.base-30.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-30.erlang' ], + regex: '(30)(#)([\\da-tA-T]+)' }, + { token: + [ 'constant.numeric.integer.base-31.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-31.erlang' ], + regex: '(31)(#)([\\da-uA-U]+)' }, + { token: + [ 'constant.numeric.integer.base-32.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-32.erlang' ], + regex: '(32)(#)([\\da-vA-V]+)' }, + { token: + [ 'constant.numeric.integer.base-33.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-33.erlang' ], + regex: '(33)(#)([\\da-wA-W]+)' }, + { token: + [ 'constant.numeric.integer.base-34.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-34.erlang' ], + regex: '(34)(#)([\\da-xA-X]+)' }, + { token: + [ 'constant.numeric.integer.base-35.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-35.erlang' ], + regex: '(35)(#)([\\da-yA-Y]+)' }, + { token: + [ 'constant.numeric.integer.base-36.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-36.erlang' ], + regex: '(36)(#)([\\da-zA-Z]+)' }, + { token: 'invalid.illegal.integer.erlang', + regex: '\\d+#[\\da-zA-Z]+' }, + { token: 'constant.numeric.integer.decimal.erlang', + regex: '\\d+' } ] } ], + '#parenthesized-expression': + [ { token: 'punctuation.section.expression.begin.erlang', + regex: '\\(', + push: + [ { token: 'punctuation.section.expression.end.erlang', + regex: '\\)', + next: 'pop' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.parenthesized' } ] } ], + '#record-directive': + [ { token: + [ 'meta.directive.record.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.record.erlang', + 'keyword.control.directive.import.erlang', + 'meta.directive.record.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.record.erlang', + 'entity.name.type.class.record.definition.erlang', + 'meta.directive.record.erlang', + 'punctuation.separator.parameters.erlang' ], + regex: '^(\\s*)(-)(\\s*)(record)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)', + push: + [ { token: + [ 'punctuation.definition.class.record.end.erlang', + 'meta.directive.record.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.record.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\})(\\s*)(\\))(\\s*)(\\.)', + next: 'pop' }, + { include: '#internal-record-body' }, + { defaultToken: 'meta.directive.record.erlang' } ] } ], + '#record-usage': + [ { token: + [ 'keyword.operator.record.erlang', + 'meta.record-usage.erlang', + 'entity.name.type.class.record.erlang', + 'meta.record-usage.erlang', + 'punctuation.separator.record-field.erlang', + 'meta.record-usage.erlang', + 'variable.other.field.erlang' ], + regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\.)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')' }, + { token: + [ 'keyword.operator.record.erlang', + 'meta.record-usage.erlang', + 'entity.name.type.class.record.erlang' ], + regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')', + push: + [ { token: 'punctuation.definition.class.record.end.erlang', + regex: '\\}', + next: 'pop' }, + { include: '#internal-record-body' }, + { defaultToken: 'meta.record-usage.erlang' } ] } ], + '#string': + [ { token: 'punctuation.definition.string.begin.erlang', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.erlang', + regex: '"', + next: 'pop' }, + { token: + [ 'punctuation.definition.escape.erlang', + 'constant.character.escape.erlang', + 'punctuation.definition.escape.erlang', + 'constant.character.escape.erlang', + 'constant.character.escape.erlang' ], + regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, + { token: 'invalid.illegal.string.erlang', regex: '\\\\\\^?.?' }, + { token: + [ 'punctuation.definition.placeholder.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'constant.other.placeholder.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'constant.other.placeholder.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'constant.other.placeholder.erlang', + 'constant.other.placeholder.erlang' ], + regex: '(~)(?:((?:\\-)?)(\\d+)|(\\*))?(?:(\\.)(?:(\\d+)|(\\*)))?(?:(\\.)(?:(\\*)|(.)))?([~cfegswpWPBX#bx\\+ni])' }, + { token: + [ 'punctuation.definition.placeholder.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'constant.other.placeholder.erlang', + 'constant.other.placeholder.erlang' ], + regex: '(~)((?:\\*)?)((?:\\d+)?)([~du\\-#fsacl])' }, + { token: 'invalid.illegal.string.erlang', regex: '~.?' }, + { defaultToken: 'string.quoted.double.erlang' } ] } ], + '#symbolic-operator': + [ { token: 'keyword.operator.symbolic.erlang', + regex: '\\+\\+|\\+|--|-|\\*|/=|/|=/=|=:=|==|=<|=|<-|<|>=|>|!|::' } ], + '#textual-operator': + [ { token: 'keyword.operator.textual.erlang', + regex: '\\b(?:andalso|band|and|bxor|xor|bor|orelse|or|bnot|not|bsl|bsr|div|rem)\\b' } ], + '#tuple': + [ { token: 'punctuation.definition.tuple.begin.erlang', + regex: '\\{', + push: + [ { token: 'punctuation.definition.tuple.end.erlang', + regex: '\\}', + next: 'pop' }, + { token: 'punctuation.separator.tuple.erlang', regex: ',' }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.tuple.erlang' } ] } ], + '#variable': + [ { token: [ 'variable.other.erlang', 'variable.language.omitted.erlang' ], + regex: '(_[a-zA-Z\\d@_]+|[A-Z][a-zA-Z\\d@_]*)|(_)' } ] } + + this.normalizeRules(); +}; + +ErlangHighlightRules.metaData = { comment: 'The recognition of function definitions and compiler directives (such as module, record and macro definitions) requires that each of the aforementioned constructs must be the first string inside a line (except for whitespace). Also, the function/module/record/macro names must be given unquoted. -- desp', + fileTypes: [ 'erl', 'hrl' ], + keyEquivalent: '^~E', + name: 'Erlang', + scopeName: 'source.erlang' } + + +oop.inherits(ErlangHighlightRules, TextHighlightRules); + +exports.ErlangHighlightRules = ErlangHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/forth.js b/lib/ace/mode/forth.js new file mode 100644 index 00000000..6208434b --- /dev/null +++ b/lib/ace/mode/forth.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var ForthHighlightRules = require("./forth_highlight_rules").ForthHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new ForthHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "(?<=^|\\s)\\.?\\( [^)]*\\)"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/forth_highlight_rules.js b/lib/ace/mode/forth_highlight_rules.js new file mode 100644 index 00000000..aa67ec55 --- /dev/null +++ b/lib/ace/mode/forth_highlight_rules.js @@ -0,0 +1,201 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from https://raw.github.com/vze26m98/Forth.tmbundle/master/Syntaxes/Forth.tmLanguage (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ForthHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: [ { include: '#forth' } ], + '#comment': + [ { token: 'comment.line.double-dash.forth', + regex: '(?<=^|\\s)--\\s.*$', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(--\\s.*$)', + comment: 'line comments for iForth' }, + { token: 'comment.line.backslash.forth', + regex: '(?<=^|\\s)\\\\[\\s\\S]*$', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(\\\\[\\s\\S]*$)', + comment: 'ANSI line comment' }, + { token: 'comment.line.backslash-g.forth', + regex: '(?<=^|\\s)\\\\[Gg] .*$', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(\\\\[Gg] .*$)', + comment: 'gForth line comment' }, + { token: 'comment.block.forth', + regex: '(?<=^|\\s)\\(\\*(?=\\s)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(\\(\\*)(?=\\s)', + push: + [ { token: 'comment.block.forth', + regex: '(?<=^|\\s)\\*\\)(?=\\s)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(\\*\\))(?=\\s)', + next: 'pop' }, + { defaultToken: 'comment.block.forth' } ], + comment: 'multiline comments for iForth' }, + { token: 'comment.block.documentation.forth', + regex: '\\bDOC\\b', + caseInsensitive: true, + push: + [ { token: 'comment.block.documentation.forth', + regex: '\\bENDDOC\\b', + caseInsensitive: true, + next: 'pop' }, + { defaultToken: 'comment.block.documentation.forth' } ], + comment: 'documentation comments for iForth' }, + { token: 'comment.line.parentheses.forth', + regex: '(?<=^|\\s)\\.?\\( [^)]*\\)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(\\.?\\( [^)]*\\))', + comment: 'ANSI line comment' } ], + '#constant': + [ { token: 'constant.language.forth', + regex: '(?<=^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?i:(?<=^|\\s)(TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s))' }, + { token: 'constant.numeric.forth', + regex: '(?<=^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)([$#%]?[-+]?[0-9]+(\\.[0-9]*e(-?[0-9]+)|\\.?[0-9a-fA-F]*))(?=\\s)' }, + { token: 'constant.character.forth', + regex: '(?<=^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(([&^]\\S)|(("|\')\\S("|\')))(?=\\s)' } ], + '#forth': + [ { include: '#constant' }, + { include: '#comment' }, + { include: '#string' }, + { include: '#word' }, + { include: '#variable' }, + { include: '#storage' }, + { include: '#word-def' } ], + '#storage': + [ { token: 'storage.type.forth', + regex: '(?<=^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(?i:(2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY))(?=\\s)' } ], + '#string': + [ { token: 'string.quoted.double.forth', + regex: '(?:(?<=ABORT" )|(?<=BREAK" )|(?<=\\." )|C" |0"|S\\\\?" )[^"]+"', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?i:((?<=ABORT" )|(?<=BREAK" )|(?<=\\." )|(C" )|(0")|(S\\\\?" )))[^"]+"' }, + { token: 'string.unquoted.forth', + regex: '(?:(?<=INCLUDE)|(?<=NEEDS)|(?<=REQUIRE)|(?<=USE))[ ]\\S+(?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?i:((?<=INCLUDE)|(?<=NEEDS)|(?<=REQUIRE)|(?<=USE)))[ ]\\S+(?=\\s)' } ], + '#variable': + [ { token: 'variable.language.forth', + regex: '\\b(?:I|J)\\b', + caseInsensitive: true } ], + '#word': + [ { token: 'keyword.control.immediate.forth', + regex: '(?<=^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)\\[(?i:(\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE))\\](?=\\s)' }, + { token: 'keyword.other.immediate.forth', + regex: '(?<=^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(?i:(COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|]))(?=\\s)' }, + { token: 'keyword.control.compile-only.forth', + regex: '(?<=^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(?i:(-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE))(?=\\s)' }, + { token: 'keyword.other.compile-only.forth', + regex: '(?<=^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(?i:(\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE))(?=\\s)' }, + { token: 'keyword.other.non-immediate.forth', + regex: '(?<=^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(?i:(\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE))(?=\\s)' }, + { token: 'keyword.other.warning.forth', + regex: '(?<=^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s)', + caseInsensitive: true, + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=^|\\s)(?i:(~~|BREAK:|BREAK"|DBG))(?=\\s)' } ], + '#word-def': + [ { token: + [ 'keyword.other.compile-only.forth', + 'meta.block.forth', + 'entity.name.function.forth', + 'meta.block.forth', + 'keyword.other.compile-only.forth' ], + regex: '(^:|\\s:)(\\s)(\\S+)(\\s)|(:NONAME)', + caseInsensitive: true, + push: + [ { token: 'keyword.other.compile-only.forth', + regex: ';(?:CODE)?', + caseInsensitive: true, + next: 'pop' }, + { include: '#constant' }, + { include: '#comment' }, + { include: '#string' }, + { include: '#word' }, + { include: '#variable' }, + { include: '#storage' }, + { defaultToken: 'meta.block.forth' } ] } ] } + + this.normalizeRules(); +}; + +ForthHighlightRules.metaData = { fileTypes: [ 'frt', 'fs', 'ldr' ], + foldingStartMarker: '/\\*\\*|\\{\\s*$', + foldingStopMarker: '\\*\\*/|^\\s*\\}', + keyEquivalent: '^~F', + name: 'Forth', + scopeName: 'source.forth' } + + +oop.inherits(ForthHighlightRules, TextHighlightRules); + +exports.ForthHighlightRules = ForthHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/fortran_modern.js b/lib/ace/mode/fortran_modern.js new file mode 100644 index 00000000..5e12e38d --- /dev/null +++ b/lib/ace/mode/fortran_modern.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var FortranModernHighlightRules = require("./fortran_modern_highlight_rules").FortranModernHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new FortranModernHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "!"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/fortran_modern_highlight_rules.js b/lib/ace/mode/fortran_modern_highlight_rules.js new file mode 100644 index 00000000..b213e1d0 --- /dev/null +++ b/lib/ace/mode/fortran_modern_highlight_rules.js @@ -0,0 +1,187 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from tm bundles\fortran.tmbundle\Syntaxes\Fortran - Modern.tmLanguage (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var FortranModernHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { include: 'source.fortran' }, + { todo: + { token: + [ 'meta.function.interface.operator.fortran.modern', + 'storage.type.function.fortran', + 'meta.function.interface.operator.fortran.modern', + 'storage.type.fortran', + 'meta.function.interface.operator.fortran.modern', + 'keyword.operator.fortran', + 'meta.function.interface.operator.fortran.modern' ], + regex: '^(\\s*)(interface)(\\s+)(operator|assignment)(\\()(\\.[a-zA-Z0-9_]+\\.|[\\+\\-\\=\\/\\*]+)(\\))', + caseInsensitive: true, + push: + [ { token: + [ 'keyword.other.fortran', + 'meta.function.interface.operator.fortran.modern', + 'storage.type.function.fortran' ], + regex: '(end)(\\s*)((?:interface)?)', + caseInsensitive: true, + next: 'pop' }, + { include: '$self' }, + { defaultToken: 'meta.function.interface.operator.fortran.modern' } ] }, + comment: 'Interface declaration of operator/assignments' }, + { todo: + { token: + [ 'meta.function.interface.fortran.modern', + 'storage.type.function.fortran', + 'meta.function.interface.fortran.modern', + 'entity.name.function.fortran' ], + regex: '^(\\s*)(interface)(\\s+)([A-Za-z_][A-Za-z0-9_]*)', + caseInsensitive: true, + push: + [ { token: + [ 'keyword.other.fortran', + 'meta.function.interface.fortran.modern', + 'storage.type.function.fortran' ], + regex: '(end)(\\s*)((?:interface)?)', + caseInsensitive: true, + next: 'pop' }, + { include: '$self' }, + { defaultToken: 'meta.function.interface.fortran.modern' } ] }, + comment: 'Interface declaration of function/subroutines' }, + { todo: + { token: + [ 'meta.type-definition.fortran.modern', + 'storage.type.fortran.modern', + 'meta.type-definition.fortran.modern', + 'entity.name.type.fortran.modern' ], + regex: '^(\\s*)(type)(\\s+)([a-zA-Z_][a-zA-Z0-9_]*)', + caseInsensitive: true, + push: + [ { token: + [ 'keyword.other.fortran', + 'meta.type-definition.fortran.modern', + 'storage.type.fortran.modern', + 'entity.name.type.end.fortran.modern' ], + regex: '(end)(\\s*)(?:(type))?((?:\\s+[A-Za-z_][A-Za-z0-9_]*)?)', + caseInsensitive: true, + next: 'pop' }, + { include: '$self' }, + { defaultToken: 'meta.type-definition.fortran.modern' } ] }, + comment: 'Type definition' }, + { token: 'punctuation.definition.comment.fortran', + regex: '!-', + push: + [ { token: 'comment.line.exclamation.mark.fortran.modern', + regex: '$', + next: 'pop' }, + { token: 'text', regex: '\\\\\\s*$' }, + { defaultToken: 'comment.line.exclamation.mark.fortran.modern' } ] }, + { token: 'punctuation.definition.comment.fortran', + regex: '!', + push: + [ { token: 'comment.line.exclamation.fortran.modern', + regex: '$', + next: 'pop' }, + { token: 'text', regex: '\\\\\\s*$' }, + { defaultToken: 'comment.line.exclamation.fortran.modern' } ] }, + { token: 'keyword.control.fortran.modern', + regex: '\\b(?:select\\s+case|case(?:\\s+default)?|end\\s+select|use|(?:end\\s+)?forall)\\b', + caseInsensitive: true, + comment: 'statements controling the flow of the program' }, + { token: 'keyword.control.io.fortran.modern', + regex: '\\b(?:access|action|advance|append|apostrophe|asis|blank|delete|delim|direct|end|eor|err|exist|file|fmt|form|formatted|iolength|iostat|keep|name|named|nextrec|new|nml|no|null|number|old|opened|pad|position|quote|read|readwrite|rec|recl|replace|scratch|sequential|size|status|undefined|unformatted|unit|unknown|write|yes|zero|namelist)(?=\\()', + caseInsensitive: true, + comment: 'input/output instrinsics' }, + { token: 'keyword.operator.logical.fortran.modern', + regex: '\\b(?:\\=\\=|\\/\\=|\\>\\=|\\>|\\<|\\<\\=)\\b', + comment: 'logical operators in symbolic format' }, + { token: 'keyword.operator.fortran.modern', + regex: '\\%|\\=\\>', + comment: 'operators' }, + { token: 'keyword.other.instrinsic.numeric.fortran.modern', + regex: '\\b(?:ceiling|floor|modulo)(?=\\()', + caseInsensitive: true, + comment: 'numeric instrinsics' }, + { token: 'keyword.other.instrinsic.array.fortran.modern', + regex: '\\b(?:allocate|allocated|deallocate)(?=\\()', + caseInsensitive: true, + comment: 'matrix/vector/array instrinsics' }, + { token: 'keyword.other.instrinsic.pointer.fortran.modern', + regex: '\\bassociated(?=\\()', + caseInsensitive: true, + comment: 'pointer instrinsics' }, + { token: 'keyword.other.programming-units.fortran.modern', + regex: '\\b(?:end\\s*)?(?:interface|procedure|module)\\b', + caseInsensitive: true, + comment: 'programming units' }, + { token: 'storage.type.fortran.modern', + regex: '\\btype(?=\\s*\\()\\b(?=.*::)', + caseInsensitive: true, + push: + [ { token: 'meta.specification.fortran.modern', + regex: '(?=!)|$', + next: 'pop' }, + { include: '$base' }, + { defaultToken: 'meta.specification.fortran.modern' } ], + comment: 'Line of type specification' }, + { token: 'storage.type.fortran.modern', + regex: '\\btype(?=\\s*\\()\\b', + caseInsensitive: true }, + { token: 'storage.modifier.fortran.modern', + regex: '\\b(?:optional|recursive|pointer|allocatable|target|private|public)\\b', + caseInsensitive: true } ] } + + this.normalizeRules(); +}; + +FortranModernHighlightRules.metaData = { comment: 'Specificities of Fortran >= 90', + fileTypes: [ 'f90', 'F90', 'f95', 'F95', 'f03', 'F03', 'f08', 'F08' ], + firstLineMatch: '(?i)-[*]- mode: f90 -[*]-', + keyEquivalent: '^~F', + name: 'Fortran - Modern', + scopeName: 'source.fortran.modern' } + + +oop.inherits(FortranModernHighlightRules, TextHighlightRules); + +exports.FortranModernHighlightRules = FortranModernHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/haskell.js b/lib/ace/mode/haskell.js new file mode 100644 index 00000000..11e6c17d --- /dev/null +++ b/lib/ace/mode/haskell.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var HaskellHighlightRules = require("./haskell_highlight_rules").HaskellHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new HaskellHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/haskell_highlight_rules.js b/lib/ace/mode/haskell_highlight_rules.js new file mode 100644 index 00000000..9ecf68ad --- /dev/null +++ b/lib/ace/mode/haskell_highlight_rules.js @@ -0,0 +1,246 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from tm bundles\haskell.tmbundle\Syntaxes\Haskell.plist (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var HaskellHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { token: + [ 'punctuation.definition.entity.haskell', + 'keyword.operator.function.infix.haskell', + 'punctuation.definition.entity.haskell' ], + regex: '(`)([a-zA-Z_\']*?)(`)', + comment: 'In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).' }, + { token: 'constant.language.unit.haskell', regex: '\\(\\)' }, + { token: 'constant.language.empty-list.haskell', + regex: '\\[\\]' }, + { token: 'keyword.other.haskell', + regex: 'module', + push: + [ { token: 'keyword.other.haskell', regex: 'where', next: 'pop' }, + { include: '#module_name' }, + { include: '#module_exports' }, + { token: 'invalid', regex: '[a-z]+' }, + { defaultToken: 'meta.declaration.module.haskell' } ] }, + { token: 'keyword.other.haskell', + regex: '\\bclass\\b', + push: + [ { token: 'keyword.other.haskell', + regex: '\\bwhere\\b', + next: 'pop' }, + { token: 'support.class.prelude.haskell', + regex: '\\b(?:Monad|Functor|Eq|Ord|Read|Show|Num|(?:Frac|Ra)tional|Enum|Bounded|Real(?:Frac|Float)?|Integral|Floating)\\b' }, + { token: 'entity.other.inherited-class.haskell', + regex: '[A-Z][A-Za-z_\']*' }, + { token: 'variable.other.generic-type.haskell', + regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' }, + { defaultToken: 'meta.declaration.class.haskell' } ] }, + { token: 'keyword.other.haskell', + regex: '\\binstance\\b', + push: + [ { token: 'keyword.other.haskell', + regex: '\\bwhere\\b|$', + next: 'pop' }, + { include: '#type_signature' }, + { defaultToken: 'meta.declaration.instance.haskell' } ] }, + { token: 'keyword.other.haskell', + regex: 'import', + push: + [ { token: 'meta.import.haskell', regex: '$|;', next: 'pop' }, + { token: 'keyword.other.haskell', regex: 'qualified|as|hiding' }, + { include: '#module_name' }, + { include: '#module_exports' }, + { defaultToken: 'meta.import.haskell' } ] }, + { token: [ 'keyword.other.haskell', 'meta.deriving.haskell' ], + regex: '(deriving)(\\s*\\()', + push: + [ { token: 'meta.deriving.haskell', regex: '\\)', next: 'pop' }, + { token: 'entity.other.inherited-class.haskell', + regex: '\\b[A-Z][a-zA-Z_\']*' }, + { defaultToken: 'meta.deriving.haskell' } ] }, + { token: 'keyword.other.haskell', + regex: '\\b(?:deriving|where|data|type|case|of|let|in|newtype|default)\\b' }, + { token: 'keyword.operator.haskell', regex: '\\binfix[lr]?\\b' }, + { token: 'keyword.control.haskell', + regex: '\\b(?:do|if|then|else)\\b' }, + { token: 'constant.numeric.float.haskell', + regex: '\\b(?:[0-9]+\\.[0-9]+(?:[eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b', + comment: 'Floats are always decimal' }, + { token: 'constant.numeric.haskell', + regex: '\\b(?:[0-9]+|0(?:[xX][0-9a-fA-F]+|[oO][0-7]+))\\b' }, + { token: + [ 'meta.preprocessor.c', + 'punctuation.definition.preprocessor.c', + 'meta.preprocessor.c' ], + regex: '^(\\s*)(#)(\\s*\\w+)', + comment: 'In addition to Haskell\'s "native" syntax, GHC permits the C preprocessor to be run on a source file.' }, + { include: '#pragma' }, + { token: 'punctuation.definition.string.begin.haskell', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.haskell', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.haskell', + regex: '\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&])' }, + { token: 'constant.character.escape.octal.haskell', + regex: '\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+' }, + { token: 'constant.character.escape.control.haskell', + regex: '\\^[A-Z@\\[\\]\\\\\\^_]' }, + { defaultToken: 'string.quoted.double.haskell' } ] }, + { token: + [ 'punctuation.definition.string.begin.haskell', + 'string.quoted.single.haskell', + 'constant.character.escape.haskell', + 'constant.character.escape.octal.haskell', + 'constant.character.escape.hexadecimal.haskell', + 'constant.character.escape.control.haskell', + 'punctuation.definition.string.end.haskell' ], + regex: '(\')(?:([\\ -\\[\\]-~])|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))(\')' }, + { token: + [ 'meta.function.type-declaration.haskell', + 'entity.name.function.haskell', + 'meta.function.type-declaration.haskell', + 'keyword.other.double-colon.haskell' ], + regex: '^(\\s*)([a-z_][a-zA-Z0-9_\']*|\\([|!%$+\\-.,=]+\\))(\\s*)(::)', + push: + [ { token: 'meta.function.type-declaration.haskell', + regex: '$', + next: 'pop' }, + { include: '#type_signature' }, + { defaultToken: 'meta.function.type-declaration.haskell' } ] }, + { token: 'support.constant.haskell', + regex: '\\b(?:Just|Nothing|Left|Right|True|False|LT|EQ|GT|\\(\\)|\\[\\])\\b' }, + { token: 'constant.other.haskell', regex: '\\b[A-Z]\\w*\\b' }, + { include: '#comments' }, + { token: 'support.function.prelude.haskell', + regex: '\\b(?:abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\\b' }, + { include: '#infix_op' }, + { token: 'keyword.operator.haskell', + regex: '[|!%$?~+:\\-.=\\\\]+', + comment: 'In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.' }, + { token: 'punctuation.separator.comma.haskell', regex: ',' } ], + '#block_comment': + [ { token: 'punctuation.definition.comment.haskell', + regex: '\\{-(?!#)', + push: + [ { include: '#block_comment' }, + { token: 'punctuation.definition.comment.haskell', + regex: '-\\}', + next: 'pop' }, + { defaultToken: 'comment.block.haskell' } ] } ], + '#comments': + [ { token: 'punctuation.definition.comment.haskell', + regex: '--', + push: + [ { token: 'comment.line.double-dash.haskell', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.double-dash.haskell' } ] }, + { include: '#block_comment' } ], + '#infix_op': + [ { token: 'entity.name.function.infix.haskell', + regex: '\\([|!%$+:\\-.=]+\\)|\\(,+\\)' } ], + '#module_exports': + [ { token: 'meta.declaration.exports.haskell', + regex: '\\(', + push: + [ { token: 'meta.declaration.exports.haskell', + regex: '\\)', + next: 'pop' }, + { token: 'entity.name.function.haskell', + regex: '\\b[a-z][a-zA-Z_\']*' }, + { token: 'storage.type.haskell', regex: '\\b[A-Z][A-Za-z_\']*' }, + { token: 'punctuation.separator.comma.haskell', regex: ',' }, + { include: '#infix_op' }, + { token: 'meta.other.unknown.haskell', + regex: '\\(.*?\\)', + comment: 'So named because I don\'t know what to call this.' }, + { defaultToken: 'meta.declaration.exports.haskell' } ] } ], + '#module_name': + [ { token: 'support.other.module.haskell', + regex: '[A-Z][A-Za-z._\']*' } ], + '#pragma': + [ { token: 'meta.preprocessor.haskell', + regex: '\\{-#', + push: + [ { token: 'meta.preprocessor.haskell', + regex: '#-\\}', + next: 'pop' }, + { token: 'keyword.other.preprocessor.haskell', + regex: '\\b(?:LANGUAGE|UNPACK|INLINE)\\b' }, + { defaultToken: 'meta.preprocessor.haskell' } ] } ], + '#type_signature': + [ { token: + [ 'meta.class-constraint.haskell', + 'entity.other.inherited-class.haskell', + 'meta.class-constraint.haskell', + 'variable.other.generic-type.haskell', + 'meta.class-constraint.haskell', + 'keyword.other.big-arrow.haskell' ], + regex: '(\\(\\s*)([A-Z][A-Za-z]*)(\\s+)([a-z][A-Za-z_\']*)(\\)\\s*)(=>)' }, + { include: '#pragma' }, + { token: 'keyword.other.arrow.haskell', regex: '->' }, + { token: 'keyword.other.big-arrow.haskell', regex: '=>' }, + { token: 'support.type.prelude.haskell', + regex: '\\b(?:Int(?:eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(?:Error)?)\\b' }, + { token: 'variable.other.generic-type.haskell', + regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' }, + { token: 'storage.type.haskell', + regex: '\\b[A-Z][a-zA-Z0-9_\']*\\b' }, + { token: 'support.constant.unit.haskell', regex: '\\(\\)' }, + { include: '#comments' } ] } + + this.normalizeRules(); +}; + +HaskellHighlightRules.metaData = { fileTypes: [ 'hs' ], + keyEquivalent: '^~H', + name: 'Haskell', + scopeName: 'source.haskell' } + + +oop.inherits(HaskellHighlightRules, TextHighlightRules); + +exports.HaskellHighlightRules = HaskellHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/html_twig.js b/lib/ace/mode/html_twig.js new file mode 100644 index 00000000..f14a1450 --- /dev/null +++ b/lib/ace/mode/html_twig.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var HTMLTwigHighlightRules = require("./html_twig_highlight_rules").HTMLTwigHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new HTMLTwigHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "<%+#"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/html_twig_highlight_rules.js b/lib/ace/mode/html_twig_highlight_rules.js new file mode 100644 index 00000000..a72ba682 --- /dev/null +++ b/lib/ace/mode/html_twig_highlight_rules.js @@ -0,0 +1,687 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from https://raw.github.com/Anomareh/PHP-Twig.tmbundle/master/Syntaxes/HTML (Twig).tmLanguage (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var HTMLTwigHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { token: [ 'punctuation.definition.tag.html', 'entity.name.tag.html' ], + regex: '(<)([a-zA-Z0-9:]+)(?=[^>]*>)', + push: + [ { token: + [ 'punctuation.definition.tag.html', + 'meta.scope.between-tag-pair.html', + 'punctuation.definition.tag.html', + 'entity.name.tag.html', + 'punctuation.definition.tag.html' ], + regex: '(>)(<)(/)([a-zA-Z0-9:]+)(>)', + next: 'pop' }, + { include: '#tag-stuff' }, + { defaultToken: 'meta.tag.any.html' } ] }, + { token: + [ 'punctuation.definition.tag.html', + 'entity.name.tag.xml.html' ], + regex: '(<\\?)(xml)', + push: + [ { token: 'punctuation.definition.tag.html', + regex: '\\?>', + next: 'pop' }, + { include: '#tag-generic-attribute' }, + { include: '#string-double-quoted' }, + { include: '#string-single-quoted' }, + { defaultToken: 'meta.tag.preprocessor.xml.html' } ] }, + { token: 'punctuation.definition.comment.html', + regex: ')$\n |\\{%\\s+(if|for|spaceless|raw|autoescape|macro|)\n )', + foldingStopMarker: '(?x)\n (\n |^(?!.*?$\n |\\{%\\s+end(if|for|spaceless|raw|autoescape|macro|)\n )', + keyEquivalent: '^~T', + name: 'HTML (Twig)', + scopeName: 'text.html.twig' } + + +oop.inherits(HTMLTwigHighlightRules, TextHighlightRules); + +exports.HTMLTwigHighlightRules = HTMLTwigHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/julia.js b/lib/ace/mode/julia.js new file mode 100644 index 00000000..7e29ae88 --- /dev/null +++ b/lib/ace/mode/julia.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var JuliaHighlightRules = require("./julia_highlight_rules").JuliaHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new JuliaHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/julia_highlight_rules.js b/lib/ace/mode/julia_highlight_rules.js new file mode 100644 index 00000000..497e6d56 --- /dev/null +++ b/lib/ace/mode/julia_highlight_rules.js @@ -0,0 +1,200 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from https://raw.github.com/JuliaLang/julia/master/contrib/Julia.tmbundle/Syntaxes/Julia.tmLanguage (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JuliaHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { include: '#function_decl' }, + { include: '#function_call' }, + { include: '#type_decl' }, + { include: '#keyword' }, + { include: '#operator' }, + { include: '#number' }, + { include: '#string' }, + { include: '#comment' } ], + '#bracket': + [ { token: 'keyword.bracket.julia', + regex: '\\(|\\)|\\[|\\]|\\{|\\}|,' } ], + '#comment': + [ { token: + [ 'punctuation.definition.comment.julia', + 'comment.line.number-sign.julia' ], + regex: '(?>=' }, + { token: 'keyword.operator.ternary.julia', regex: '\\?|:' }, + { token: 'keyword.operator.boolean.julia', + regex: '\\|\\||&&|!' }, + { token: 'keyword.operator.arrow.julia', regex: '->|<-|-->' }, + { token: 'keyword.operator.relation.julia', + regex: '>|<|>=|<=|==|!=|\\.>|\\.<|\\.>=|\\.>=|\\.==|\\.!=|\\.=|\\.!|<:|:>' }, + { token: 'keyword.operator.range.julia', regex: ':' }, + { token: 'keyword.operator.shift.julia', regex: '<<|>>' }, + { token: 'keyword.operator.bitwise.julia', regex: '\\||\\&|~' }, + { token: 'keyword.operator.arithmetic.julia', + regex: '\\+|-|\\*|\\.\\*|/|\\./|//|\\.//|%|\\.%|\\\\|\\.\\\\|\\^|\\.\\^' }, + { token: 'keyword.operator.isa.julia', regex: '::' }, + { token: 'keyword.operator.dots.julia', + regex: '\\.(?=[a-zA-Z])|\\.\\.+' }, + { token: 'keyword.operator.interpolation.julia', + regex: '\\$(?=.+)' }, + { token: [ 'variable', 'keyword.operator.transposed-variable.julia' ], + regex: '(\\w+)((?:\'|\\.\')*\\.?\')' }, + { todo: + { token: 'test', + regex: '\\[', + push: + [ { token: [ 'test', 'keyword.operator.transposed-matrix.julia' ], + regex: '(\\])((?:\'|\\.\')*\\.?\')', + next: 'pop' }, + { include: '$self' }, + { defaultToken: 'test' } ] } }, + { todo: + { token: 'text', + regex: '\\(', + push: + [ { token: [ 'text', 'keyword.operator.transposed-parens.julia' ], + regex: '(\\))((?:\'|\\.\')*\\.?\')', + next: 'pop' }, + { include: '$self' } ] } } ], + '#string': + [ { token: 'punctuation.definition.string.begin.julia', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.julia', + regex: '\'', + next: 'pop' }, + { include: '#string_escaped_char' }, + { defaultToken: 'string.quoted.single.julia' } ] }, + { token: 'punctuation.definition.string.begin.julia', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.julia', + regex: '"', + next: 'pop' }, + { include: '#string_escaped_char' }, + { defaultToken: 'string.quoted.double.julia' } ] }, + { token: 'punctuation.definition.string.begin.julia', + regex: '\\b\\w+"', + push: + [ { token: 'punctuation.definition.string.end.julia', + regex: '"\\w*', + next: 'pop' }, + { include: '#string_custom_escaped_char' }, + { defaultToken: 'string.quoted.custom-double.julia' } ] }, + { token: 'punctuation.definition.string.begin.julia', + regex: '`', + push: + [ { token: 'punctuation.definition.string.end.julia', + regex: '`', + next: 'pop' }, + { include: '#string_escaped_char' }, + { defaultToken: 'string.quoted.backtick.julia' } ] } ], + '#string_custom_escaped_char': [ { token: 'constant.character.escape.julia', regex: '\\\\"' } ], + '#string_escaped_char': + [ { token: 'constant.character.escape.julia', + regex: '\\\\(?:\\\\|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}|.)' } ], + '#type_decl': + [ { token: + [ 'keyword.control.type.julia', + 'meta.type.julia', + 'entity.name.type.julia', + 'entity.other.inherited-class.julia', + 'punctuation.separator.inheritance.julia', + 'entity.other.inherited-class.julia' ], + regex: '(type|immutable)(\\s+)([a-zA-Z0-9_]+)(?:(\\s*)(<:)(\\s*[.a-zA-Z0-9_:]+))?' }, + { token: [ 'other.typed-variable.julia', 'support.type.julia' ], + regex: '([a-zA-Z0-9_]+)(::[a-zA-Z0-9_{}]+)' } ] } + + this.normalizeRules(); +}; + +JuliaHighlightRules.metaData = { fileTypes: [ 'jl' ], + firstLineMatch: '^#!.*\\bjulia\\s*$', + foldingStartMarker: '^\\s*(?:if|while|for|begin|function|macro|module|baremodule|type|immutable|let)\\b(?!.*\\bend\\b).*$', + foldingStopMarker: '^\\s*(?:end)\\b.*$', + name: 'Julia', + scopeName: 'source.julia' } + + +oop.inherits(JuliaHighlightRules, TextHighlightRules); + +exports.JuliaHighlightRules = JuliaHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/prolog.js b/lib/ace/mode/prolog.js new file mode 100644 index 00000000..10203ce6 --- /dev/null +++ b/lib/ace/mode/prolog.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var PrologHighlightRules = require("./prolog_highlight_rules").PrologHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new PrologHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "/\\*"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/prolog_highlight_rules.js b/lib/ace/mode/prolog_highlight_rules.js new file mode 100644 index 00000000..fb3fa74f --- /dev/null +++ b/lib/ace/mode/prolog_highlight_rules.js @@ -0,0 +1,238 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from https://raw.github.com/stephenroller/prolog-tmbundle/master/Syntaxes/Prolog.tmLanguage (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PrologHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { include: '#comment' }, + { include: '#basic_fact' }, + { include: '#rule' }, + { include: '#directive' }, + { include: '#fact' } ], + '#atom': + [ { token: 'constant.other.atom.prolog', + regex: '\\b[a-z][a-zA-Z0-9_]*\\b' }, + { token: 'constant.numeric.prolog', + regex: '-?\\d+(?:\\.\\d+)?' }, + { include: '#string' } ], + '#basic_elem': + [ { include: '#comment' }, + { include: '#statement' }, + { include: '#constants' }, + { include: '#operators' }, + { include: '#builtins' }, + { include: '#list' }, + { include: '#atom' }, + { include: '#variable' } ], + '#basic_fact': + [ { token: + [ 'entity.name.function.fact.basic.prolog', + 'punctuation.end.fact.basic.prolog' ], + regex: '([a-z]\\w*)(\\.)' } ], + '#builtins': + [ { token: 'support.function.builtin.prolog', + regex: '\\b(?:\n\t\t\t\t\t\tabolish|abort|ancestors|arg|ascii|assert[az]|\n\t\t\t\t\t\tatom(?:ic)?|body|char|close|conc|concat|consult|\n\t\t\t\t\t\tdefine|definition|dynamic|dump|fail|file|free|\n\t\t\t\t\t\tfree_proc|functor|getc|goal|halt|head|head|integer|\n\t\t\t\t\t\tlength|listing|match_args|member|next_clause|nl|\n\t\t\t\t\t\tnonvar|nth|number|cvars|nvars|offset|op|\n\t\t\t\t\t\tprint?|prompt|putc|quoted|ratom|read|redefine|\n\t\t\t\t\t\trename|retract(?:all)?|see|seeing|seen|skip|spy|\n\t\t\t\t\t\tstatistics|system|tab|tell|telling|term|\n\t\t\t\t\t\ttime|told|univ|unlink_clause|unspy_predicate|\n\t\t\t\t\t\tvar|write\n\t\t\t\t\t)\\b' } ], + '#comment': + [ { token: + [ 'punctuation.definition.comment.prolog', + 'comment.line.percentage.prolog' ], + regex: '(%)(.*$)' }, + { token: 'punctuation.definition.comment.prolog', + regex: '/\\*', + push: + [ { token: 'punctuation.definition.comment.prolog', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.prolog' } ] } ], + '#constants': + [ { token: 'constant.language.prolog', + regex: '\\b(?:true|false|yes|no)\\b' } ], + '#directive': + [ { token: 'keyword.operator.directive.prolog', + regex: ':-', + push: + [ { token: 'meta.directive.prolog', regex: '\\.', next: 'pop' }, + { include: '#comment' }, + { include: '#statement' }, + { defaultToken: 'meta.directive.prolog' } ] } ], + '#expr': + [ { include: '#comments' }, + { token: 'meta.expression.prolog', + regex: '\\(', + push: + [ { token: 'meta.expression.prolog', regex: '\\)', next: 'pop' }, + { include: '#expr' }, + { defaultToken: 'meta.expression.prolog' } ] }, + { token: 'keyword.control.cutoff.prolog', regex: '!' }, + { token: 'punctuation.control.and.prolog', regex: ',' }, + { token: 'punctuation.control.or.prolog', regex: ';' }, + { include: '#basic_elem' } ], + '#fact': + [ { token: + [ 'entity.name.function.fact.prolog', + 'punctuation.begin.fact.parameters.prolog' ], + regex: '([a-z]\\w*)(\\()(?!.*:-)', + push: + [ { token: + [ 'punctuation.end.fact.parameters.prolog', + 'punctuation.end.fact.prolog' ], + regex: '(\\))(\\.)', + next: 'pop' }, + { include: '#parameter' }, + { defaultToken: 'meta.fact.prolog' } ] } ], + '#list': + [ { token: 'punctuation.begin.list.prolog', + regex: '\\[(?=.*\\])', + push: + [ { token: 'punctuation.end.list.prolog', + regex: '\\]', + next: 'pop' }, + { include: '#comment' }, + { token: 'punctuation.separator.list.prolog', regex: ',' }, + { token: 'punctuation.concat.list.prolog', + regex: '\\|', + push: + [ { token: 'meta.list.concat.prolog', + regex: '(?=\\s*\\])', + next: 'pop' }, + { include: '#basic_elem' }, + { defaultToken: 'meta.list.concat.prolog' } ] }, + { include: '#basic_elem' }, + { defaultToken: 'meta.list.prolog' } ] } ], + '#operators': + [ { token: 'keyword.operator.prolog', + regex: '\\\\\\+|\\bnot\\b|\\bis\\b|->|[><]|[><\\\\:=]?=|(?:=\\\\|\\\\=)=' } ], + '#parameter': + [ { token: 'variable.language.anonymous.prolog', + regex: '\\b_\\b' }, + { token: 'variable.parameter.prolog', + regex: '\\b[A-Z_]\\w*\\b' }, + { token: 'punctuation.separator.parameters.prolog', regex: ',' }, + { include: '#basic_elem' }, + { token: 'invalid.illegal.invalidchar.prolog', regex: '[^\\s]' } ], + '#rule': + [ { token: 'meta.rule.prolog', + regex: '(?=[a-z]\\w*.*:-)', + push: + [ { token: 'punctuation.rule.end.prolog', + regex: '\\.', + next: 'pop' }, + { token: 'meta.rule.signature.prolog', + regex: '(?=[a-z]\\w*.*:-)', + push: + [ { token: 'meta.rule.signature.prolog', + regex: '(?=:-)', + next: 'pop' }, + { token: 'entity.name.function.rule.prolog', + regex: '[a-z]\\w*(?=\\(|\\s*:-)' }, + { token: 'punctuation.rule.parameters.begin.prolog', + regex: '\\(', + push: + [ { token: 'punctuation.rule.parameters.end.prolog', + regex: '\\)', + next: 'pop' }, + { include: '#parameter' }, + { defaultToken: 'meta.rule.parameters.prolog' } ] }, + { defaultToken: 'meta.rule.signature.prolog' } ] }, + { token: 'keyword.operator.definition.prolog', + regex: ':-', + push: + [ { token: 'meta.rule.definition.prolog', + regex: '(?=\\.)', + next: 'pop' }, + { include: '#comment' }, + { include: '#expr' }, + { defaultToken: 'meta.rule.definition.prolog' } ] }, + { defaultToken: 'meta.rule.prolog' } ] } ], + '#statement': + [ { token: 'meta.statement.prolog', + regex: '(?=[a-z]\\w*\\()', + push: + [ { token: 'punctuation.end.statement.parameters.prolog', + regex: '\\)', + next: 'pop' }, + { include: '#builtins' }, + { include: '#atom' }, + { token: 'punctuation.begin.statement.parameters.prolog', + regex: '\\(', + push: + [ { token: 'meta.statement.parameters.prolog', + regex: '(?=\\))', + next: 'pop' }, + { token: 'punctuation.separator.statement.prolog', regex: ',' }, + { include: '#basic_elem' }, + { defaultToken: 'meta.statement.parameters.prolog' } ] }, + { defaultToken: 'meta.statement.prolog' } ] } ], + '#string': + [ { token: 'punctuation.definition.string.begin.prolog', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.prolog', + regex: '\'', + next: 'pop' }, + { token: 'constant.character.escape.prolog', regex: '\\\\.' }, + { token: 'constant.character.escape.quote.prolog', + regex: '\'\'' }, + { defaultToken: 'string.quoted.single.prolog' } ] } ], + '#variable': + [ { token: 'variable.language.anonymous.prolog', + regex: '\\b_\\b' }, + { token: 'variable.other.prolog', + regex: '\\b[A-Z_][a-zA-Z0-9_]*\\b' } ] } + + this.normalizeRules(); +}; + +PrologHighlightRules.metaData = { fileTypes: [ 'plg', 'prolog' ], + foldingStartMarker: '(%\\s*region \\w*)|([a-z]\\w*.*:- ?)', + foldingStopMarker: '(%\\s*end(\\s*region)?)|(?=\\.)', + keyEquivalent: '^~P', + name: 'Prolog', + scopeName: 'source.prolog' } + + +oop.inherits(PrologHighlightRules, TextHighlightRules); + +exports.PrologHighlightRules = PrologHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/rust.js b/lib/ace/mode/rust.js new file mode 100644 index 00000000..75b02ca9 --- /dev/null +++ b/lib/ace/mode/rust.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var RustHighlightRules = require("./rust_highlight_rules").RustHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new RustHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "/\\*"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/rust_highlight_rules.js b/lib/ace/mode/rust_highlight_rules.js new file mode 100644 index 00000000..03312a45 --- /dev/null +++ b/lib/ace/mode/rust_highlight_rules.js @@ -0,0 +1,129 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from https://raw.github.com/dbp/sublime-rust/master/Rust.tmLanguage (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var RustHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { token: 'variable.other.source.rust', + regex: '\'[a-zA-Z_][a-zA-Z0-9_]*[^\\\']' }, + { token: 'string.quoted.single.source.rust', + regex: '\'', + push: + [ { token: 'string.quoted.single.source.rust', + regex: '\'', + next: 'pop' }, + { include: '#rust_escaped_character' }, + { defaultToken: 'string.quoted.single.source.rust' } ] }, + { token: 'string.quoted.double.source.rust', + regex: '"', + push: + [ { token: 'string.quoted.double.source.rust', + regex: '"', + next: 'pop' }, + { include: '#rust_escaped_character' }, + { defaultToken: 'string.quoted.double.source.rust' } ] }, + { token: + [ 'keyword.source.rust', + 'meta.function.source.rust', + 'entity.name.function.source.rust', + 'meta.function.source.rust' ], + regex: '\\b(fn)(\\s+)([a-zA-Z_][a-zA-Z0-9_][\\w\\:,+ \\\'<>]*)(\\s*\\()' }, + { token: 'keyword.source.rust', + regex: '\\b(?:as|assert|break|claim|const|copy|Copy|do|drop|else|extern|fail|for|if|impl|in|let|log|loop|match|mod|module|move|mut|Owned|priv|pub|pure|ref|return|unchecked|unsafe|use|while|mod|Send|static|trait|class|struct|enum|type)\\b' }, + { token: 'storage.type.source.rust', + regex: '\\b(?:Self|m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b' }, + { token: 'variable.language.source.rust', regex: '\\bself\\b' }, + { token: 'constant.language.source.rust', + regex: '\\b(?:true|false|Some|None|Left|Right|Ok|Err)\\b' }, + { token: 'support.constant.source.rust', + regex: '\\b(?:EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\\b' }, + { token: 'meta.preprocessor.source.rust', + regex: '\\b\\w\\(\\w\\)*!|#\\[[\\w=\\(\\)_]+\\]\\b' }, + { token: 'constant.numeric.integer.source.rust', + regex: '\\b(?:[0-9][0-9_]*|[0-9][0-9_]*(?:u|u8|u16|u32|u64)|[0-9][0-9_]*(?:i|i8|i16|i32|i64))\\b' }, + { token: 'constant.numeric.hex.source.rust', + regex: '\\b(?:0x[a-fA-F0-9_]+|0x[a-fA-F0-9_]+(?:u|u8|u16|u32|u64)|0x[a-fA-F0-9_]+(?:i|i8|i16|i32|i64))\\b' }, + { token: 'constant.numeric.binary.source.rust', + regex: '\\b(?:0b[01_]+|0b[01_]+(?:u|u8|u16|u32|u64)|0b[01_]+(?:i|i8|i16|i32|i64))\\b' }, + { token: 'constant.numeric.float.source.rust', + regex: '[0-9][0-9_]*(?:f32|f64|f)|[0-9][0-9_]*[eE][+-]=[0-9_]+|[0-9][0-9_]*[eE][+-]=[0-9_]+(?:f32|f64|f)|[0-9][0-9_]*\\.[0-9_]+|[0-9][0-9_]*\\.[0-9_]+(?:f32|f64|f)|[0-9][0-9_]*\\.[0-9_]+%[eE][+-]=[0-9_]+|[0-9][0-9_]*\\.[0-9_]+%[eE][+-]=[0-9_]+(?:f32|f64|f)' }, + { token: 'comment.line.documentation.source.rust', + regex: '//!', + push: + [ { token: 'comment.line.documentation.source.rust', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.documentation.source.rust' } ] }, + { token: 'comment.line.double-dash.source.rust', + regex: '//', + push: + [ { token: 'comment.line.double-dash.source.rust', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.double-dash.source.rust' } ] }, + { token: 'comment.block.source.rust', + regex: '/\\*', + push: + [ { token: 'comment.block.source.rust', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.source.rust' } ] } ], + '#rust_escaped_character': + [ { token: 'constant.character.escape.source.rust', + regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)' } ] } + + this.normalizeRules(); +}; + +RustHighlightRules.metaData = { fileTypes: [ 'rs', 'rc' ], + foldingStartMarker: '^.*\\bfn\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$', + foldingStopMarker: '^\\s*\\}', + name: 'Rust', + scopeName: 'source.rust' } + + +oop.inherits(RustHighlightRules, TextHighlightRules); + +exports.RustHighlightRules = RustHighlightRules; +}); \ No newline at end of file From 5d63adb2a7505d0c30d9af2cd01f8e27e08912f2 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 5 Apr 2013 23:59:34 +0400 Subject: [PATCH 05/20] workaround for unsupported regex features --- lib/ace/mode/forth_highlight_rules.js | 79 ++++++----------------- lib/ace/mode/html_twig_highlight_rules.js | 10 +-- lib/ace/mode/julia.js | 4 +- lib/ace/mode/julia_highlight_rules.js | 54 ++++------------ 4 files changed, 38 insertions(+), 109 deletions(-) diff --git a/lib/ace/mode/forth_highlight_rules.js b/lib/ace/mode/forth_highlight_rules.js index aa67ec55..31ced17b 100644 --- a/lib/ace/mode/forth_highlight_rules.js +++ b/lib/ace/mode/forth_highlight_rules.js @@ -47,29 +47,19 @@ var ForthHighlightRules = function() { this.$rules = { start: [ { include: '#forth' } ], '#comment': [ { token: 'comment.line.double-dash.forth', - regex: '(?<=^|\\s)--\\s.*$', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(--\\s.*$)', + regex: '(?:^|\\s)--\\s.*$', comment: 'line comments for iForth' }, { token: 'comment.line.backslash.forth', - regex: '(?<=^|\\s)\\\\[\\s\\S]*$', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\\\[\\s\\S]*$)', + regex: '(?:^|\\s)\\\\[\\s\\S]*$', comment: 'ANSI line comment' }, { token: 'comment.line.backslash-g.forth', - regex: '(?<=^|\\s)\\\\[Gg] .*$', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\\\[Gg] .*$)', + regex: '(?:^|\\s)\\\\[Gg] .*$', comment: 'gForth line comment' }, { token: 'comment.block.forth', - regex: '(?<=^|\\s)\\(\\*(?=\\s)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\(\\*)(?=\\s)', + regex: '(?:^|\\s)\\(\\*(?=\\s|$)', push: [ { token: 'comment.block.forth', - regex: '(?<=^|\\s)\\*\\)(?=\\s)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\*\\))(?=\\s)', + regex: '(?:^|\\s)\\*\\)(?=\\s|$)', next: 'pop' }, { defaultToken: 'comment.block.forth' } ], comment: 'multiline comments for iForth' }, @@ -84,24 +74,16 @@ var ForthHighlightRules = function() { { defaultToken: 'comment.block.documentation.forth' } ], comment: 'documentation comments for iForth' }, { token: 'comment.line.parentheses.forth', - regex: '(?<=^|\\s)\\.?\\( [^)]*\\)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\.?\\( [^)]*\\))', + regex: '(?:^|\\s)\\.?\\( [^)]*\\)', comment: 'ANSI line comment' } ], '#constant': [ { token: 'constant.language.forth', - regex: '(?<=^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s)', + regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?i:(?<=^|\\s)(TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s))' }, { token: 'constant.numeric.forth', - regex: '(?<=^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)([$#%]?[-+]?[0-9]+(\\.[0-9]*e(-?[0-9]+)|\\.?[0-9a-fA-F]*))(?=\\s)' }, + regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)', { token: 'constant.character.forth', - regex: '(?<=^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(([&^]\\S)|(("|\')\\S("|\')))(?=\\s)' } ], + regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)', '#forth': [ { include: '#constant' }, { include: '#comment' }, @@ -112,64 +94,45 @@ var ForthHighlightRules = function() { { include: '#word-def' } ], '#storage': [ { token: 'storage.type.forth', - regex: '(?<=^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s)', + regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY))(?=\\s)' } ], '#string': [ { token: 'string.quoted.double.forth', - regex: '(?:(?<=ABORT" )|(?<=BREAK" )|(?<=\\." )|C" |0"|S\\\\?" )[^"]+"', + regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?i:((?<=ABORT" )|(?<=BREAK" )|(?<=\\." )|(C" )|(0")|(S\\\\?" )))[^"]+"' }, { token: 'string.unquoted.forth', - regex: '(?:(?<=INCLUDE)|(?<=NEEDS)|(?<=REQUIRE)|(?<=USE))[ ]\\S+(?=\\s)', + regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?i:((?<=INCLUDE)|(?<=NEEDS)|(?<=REQUIRE)|(?<=USE)))[ ]\\S+(?=\\s)' } ], '#variable': [ { token: 'variable.language.forth', regex: '\\b(?:I|J)\\b', caseInsensitive: true } ], '#word': [ { token: 'keyword.control.immediate.forth', - regex: '(?<=^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s)', + regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)\\[(?i:(\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE))\\](?=\\s)' }, { token: 'keyword.other.immediate.forth', - regex: '(?<=^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s)', + regex: '(?:^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|]))(?=\\s)' }, { token: 'keyword.control.compile-only.forth', - regex: '(?<=^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s)', + regex: '(?:^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE))(?=\\s)' }, { token: 'keyword.other.compile-only.forth', - regex: '(?<=^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s)', + regex: '(?:^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE))(?=\\s)' }, { token: 'keyword.other.non-immediate.forth', - regex: '(?<=^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s)', + regex: '(?:^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE))(?=\\s)' }, { token: 'keyword.other.warning.forth', - regex: '(?<=^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s)', + regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(~~|BREAK:|BREAK"|DBG))(?=\\s)' } ], '#word-def': [ { token: [ 'keyword.other.compile-only.forth', + 'keyword.other.compile-only.forth', 'meta.block.forth', - 'entity.name.function.forth', - 'meta.block.forth', - 'keyword.other.compile-only.forth' ], - regex: '(^:|\\s:)(\\s)(\\S+)(\\s)|(:NONAME)', + 'entity.name.function.forth' ], + regex: '(:NONAME)|(^:|\\s:)(\\s)(\\S+)(?=\\s|$)', caseInsensitive: true, push: [ { token: 'keyword.other.compile-only.forth', diff --git a/lib/ace/mode/html_twig_highlight_rules.js b/lib/ace/mode/html_twig_highlight_rules.js index a72ba682..2a9e57a5 100644 --- a/lib/ace/mode/html_twig_highlight_rules.js +++ b/lib/ace/mode/html_twig_highlight_rules.js @@ -638,12 +638,7 @@ var HTMLTwigHighlightRules = function() { 'punctuation.separator.key-value.html' ], regex: '\\b(id)\\b(\\s*)(=)', push: - [ { token: [], - regex: '(?<=\'|")', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=\'|")', - next: 'pop' }, - { token: 'punctuation.definition.string.begin.html', + [{ token: 'punctuation.definition.string.begin.html', regex: '"', push: [ { token: 'punctuation.definition.string.end.html', @@ -661,7 +656,8 @@ var HTMLTwigHighlightRules = function() { { include: '#embedded-code' }, { include: '#entities' }, { defaultToken: 'string.quoted.single.html' } ] }, - { defaultToken: 'meta.attribute-with-value.id.html' } ] } ], + { defaultToken: 'meta.attribute-with-value.id.html' }, + { token: '', regex: '', next: 'pop' } ] } ], '#tag-stuff': [ { include: '#tag-id-attribute' }, { include: '#tag-generic-attribute' }, diff --git a/lib/ace/mode/julia.js b/lib/ace/mode/julia.js index 7e29ae88..cb28d62c 100644 --- a/lib/ace/mode/julia.js +++ b/lib/ace/mode/julia.js @@ -55,8 +55,8 @@ var Mode = function() { oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; + this.lineCommentStart = "#"; + this.blockComment = ""; // Extra logic goes here. }).call(Mode.prototype); diff --git a/lib/ace/mode/julia_highlight_rules.js b/lib/ace/mode/julia_highlight_rules.js index 497e6d56..fabec1e3 100644 --- a/lib/ace/mode/julia_highlight_rules.js +++ b/lib/ace/mode/julia_highlight_rules.js @@ -60,32 +60,15 @@ var JuliaHighlightRules = function() { [ { token: [ 'punctuation.definition.comment.julia', 'comment.line.number-sign.julia' ], - regex: '(? Date: Sat, 6 Apr 2013 12:53:21 +0400 Subject: [PATCH 06/20] add demo docs --- .gitignore | 1 + demo/kitchen-sink/doclist.js | 11 +++++- demo/kitchen-sink/docs/actionscript.as | 51 ++++++++++++++++++++++++++ demo/kitchen-sink/docs/erlang.erl | 20 ++++++++++ demo/kitchen-sink/docs/forth.frt | 41 +++++++++++++++++++++ demo/kitchen-sink/docs/fortran.f95 | 28 ++++++++++++++ demo/kitchen-sink/docs/haskell.hs | 20 ++++++++++ demo/kitchen-sink/docs/julia.jl | 15 ++++++++ demo/kitchen-sink/docs/prolog.plg | 18 +++++++++ demo/kitchen-sink/docs/rust.rs | 20 ++++++++++ demo/kitchen-sink/modelist.js | 17 +++++++-- lib/ace/mode/rust_highlight_rules.js | 10 ++--- 12 files changed, 243 insertions(+), 9 deletions(-) create mode 100644 demo/kitchen-sink/docs/actionscript.as create mode 100644 demo/kitchen-sink/docs/erlang.erl create mode 100644 demo/kitchen-sink/docs/forth.frt create mode 100644 demo/kitchen-sink/docs/fortran.f95 create mode 100644 demo/kitchen-sink/docs/haskell.hs create mode 100644 demo/kitchen-sink/docs/julia.jl create mode 100644 demo/kitchen-sink/docs/prolog.plg create mode 100644 demo/kitchen-sink/docs/rust.rs diff --git a/.gitignore b/.gitignore index ceba2ce9..813d6c10 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ .* !/.gitignore .*.gz +*.tmTheme.js # A handy place to put stuff that git should ignore: /ignore/ diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index e4f4833b..81fc5081 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -135,7 +135,16 @@ var docs = { "docs/xml.xml": "XML", "docs/xquery.xq": "XQuery", "docs/yaml.yaml": "YAML", - "docs/c9search.c9search_results": "C9 Search Results" + "docs/c9search.c9search_results": "C9 Search Results", + + "docs/actionscript.as": "ActionScript", + "docs/erlang/erl": "Erlang", + "docs/forth.frt": "Forth", + "docs/fortran.f95": "Fortran", + "docs/haskell.hs": "Haskell", + "docs/julia.js": "Julia", + "docs/prolog/plg": "Prolog", + "docs/rust.rs": "Rust" }; var ownSource = { diff --git a/demo/kitchen-sink/docs/actionscript.as b/demo/kitchen-sink/docs/actionscript.as new file mode 100644 index 00000000..ffe21fbf --- /dev/null +++ b/demo/kitchen-sink/docs/actionscript.as @@ -0,0 +1,51 @@ +package code +{ + /***************************************** + * based on textmate actionscript bundle + ****************************************/ + + import fl.events.SliderEvent; + + public class Foo extends MovieClip + { + //************************* + // Properties: + + public var activeSwatch:MovieClip; + + // Color offsets + public var c1:Number = 0; // R + + //************************* + // Constructor: + + public function Foo() + { + // Respond to mouse events + swatch1_btn.addEventListener(MouseEvent.CLICK,swatchHandler,false,0,false); + previewBox_btn.addEventListener(MouseEvent.MOUSE_DOWN,dragPressHandler); + + // Respond to drag events + red_slider.addEventListener(SliderEvent.THUMB_DRAG,sliderHandler); + + // Draw a frame later + addEventListener(Event.ENTER_FRAME,draw); + } + + protected function clickHandler(event:MouseEvent):void + { + car.transform.colorTransform = new ColorTransform(0,0,0,1,c1,c2,c3); + } + + protected function changeRGBHandler(event:Event):void + { + c1 = Number(c1_txt.text); + + if(!(c1>=0)){ + c1 = 0; + } + + updateSliders(); + } + } +} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/erlang.erl b/demo/kitchen-sink/docs/erlang.erl new file mode 100644 index 00000000..705642b3 --- /dev/null +++ b/demo/kitchen-sink/docs/erlang.erl @@ -0,0 +1,20 @@ + %% A process whose only job is to keep a counter. + %% First version + -module(counter). + -export([start/0, codeswitch/1]). + + start() -> loop(0). + + loop(Sum) -> + receive + {increment, Count} -> + loop(Sum+Count); + {counter, Pid} -> + Pid ! {counter, Sum}, + loop(Sum); + code_switch -> + ?MODULE:codeswitch(Sum) + % Force the use of 'codeswitch/1' from the latest MODULE version + end. + + codeswitch(Sum) -> loop(Sum). \ No newline at end of file diff --git a/demo/kitchen-sink/docs/forth.frt b/demo/kitchen-sink/docs/forth.frt new file mode 100644 index 00000000..dc85cd7b --- /dev/null +++ b/demo/kitchen-sink/docs/forth.frt @@ -0,0 +1,41 @@ +: HELLO ( -- ) CR ." Hello, world!" ; + +HELLO +Hello, world! + +: [CHAR] CHAR POSTPONE LITERAL ; IMMEDIATE + +0 value ii 0 value jj +0 value KeyAddr 0 value KeyLen +create SArray 256 allot \ state array of 256 bytes +: KeyArray KeyLen mod KeyAddr ; + +: get_byte + c@ ; +: set_byte + c! ; +: as_byte 255 and ; +: reset_ij 0 TO ii 0 TO jj ; +: i_update 1 + as_byte TO ii ; +: j_update ii SArray get_byte + as_byte TO jj ; +: swap_s_ij + jj SArray get_byte + ii SArray get_byte jj SArray set_byte + ii SArray set_byte +; + +: rc4_init ( KeyAddr KeyLen -- ) + 256 min TO KeyLen TO KeyAddr + 256 0 DO i i SArray set_byte LOOP + reset_ij + BEGIN + ii KeyArray get_byte jj + j_update + swap_s_ij + ii 255 < WHILE + ii i_update + REPEAT + reset_ij +; +: rc4_byte + ii i_update jj j_update + swap_s_ij + ii SArray get_byte jj SArray get_byte + as_byte SArray get_byte xor +; \ No newline at end of file diff --git a/demo/kitchen-sink/docs/fortran.f95 b/demo/kitchen-sink/docs/fortran.f95 new file mode 100644 index 00000000..8dbd8809 --- /dev/null +++ b/demo/kitchen-sink/docs/fortran.f95 @@ -0,0 +1,28 @@ +! sum.f90 +! Performs summations using in a loop using EXIT statement +! Saves input information and the summation in a data file + +program summation +implicit none +integer :: sum, a + +print*, "This program performs summations. Enter 0 to stop." +open(unit=10, file="SumData.DAT") + +sum = 0 + +do + print*, "Add:" + read*, a + if (a == 0) then + exit + else + sum = sum + a + end if + write(10,*) a +end do + +print*, "Summation =", sum +write(10,*) "Summation =", sum +close(10) + \ No newline at end of file diff --git a/demo/kitchen-sink/docs/haskell.hs b/demo/kitchen-sink/docs/haskell.hs new file mode 100644 index 00000000..5c0defc2 --- /dev/null +++ b/demo/kitchen-sink/docs/haskell.hs @@ -0,0 +1,20 @@ +-- Type annotation (optional) +fib :: Int -> Integer + +-- With self-referencing data +fib n = fibs !! n + where fibs = 0 : scanl (+) 1 fibs + -- 0,1,1,2,3,5,... + +-- Same, coded directly +fib n = fibs !! n + where fibs = 0 : 1 : next fibs + next (a : t@(b:_)) = (a+b) : next t + +-- Similar idea, using zipWith +fib n = fibs !! n + where fibs = 0 : 1 : zipWith (+) fibs (tail fibs) + +-- Using a generator function +fib n = fibs (0,1) !! n + where fibs (a,b) = a : fibs (b,a+b) \ No newline at end of file diff --git a/demo/kitchen-sink/docs/julia.jl b/demo/kitchen-sink/docs/julia.jl new file mode 100644 index 00000000..97178469 --- /dev/null +++ b/demo/kitchen-sink/docs/julia.jl @@ -0,0 +1,15 @@ +for op = (:+, :*, :&, :|, :$) + @eval ($op)(a,b,c) = ($op)(($op)(a,b),c) +end + + +function g(x,y) + return x * y + x + y +end + +cd("data") do + open("outfile", "w") do f + write(f, data) + end +end diff --git a/demo/kitchen-sink/docs/prolog.plg b/demo/kitchen-sink/docs/prolog.plg new file mode 100644 index 00000000..2c867157 --- /dev/null +++ b/demo/kitchen-sink/docs/prolog.plg @@ -0,0 +1,18 @@ +partition([], _, [], []). +partition([X|Xs], Pivot, Smalls, Bigs) :- + ( X @< Pivot -> + Smalls = [X|Rest], + partition(Xs, Pivot, Rest, Bigs) + ; Bigs = [X|Rest], + partition(Xs, Pivot, Smalls, Rest) + ). + +quicksort([]) --> []. +quicksort([X|Xs]) --> + { partition(Xs, X, Smaller, Bigger) }, + quicksort(Smaller), [X], quicksort(Bigger). + +perfect(N) :- + between(1, inf, N), U is N // 2, + findall(D, (between(1,U,D), N mod D =:= 0), Ds), + sumlist(Ds, N). \ No newline at end of file diff --git a/demo/kitchen-sink/docs/rust.rs b/demo/kitchen-sink/docs/rust.rs new file mode 100644 index 00000000..7ab5418c --- /dev/null +++ b/demo/kitchen-sink/docs/rust.rs @@ -0,0 +1,20 @@ +use core::rand::RngUtil; + +fn main() { + for ["Alice", "Bob", "Carol"].each |&name| { + do spawn { + let v = rand::Rng().shuffle([1, 2, 3]); + for v.each |&num| { + print(fmt!("%s says: '%d'\n", name, num + 1)) + } + } + } +} + +fn map(vector: &[T], function: &fn(v: &T) -> U) -> ~[U] { + let mut accumulator = ~[]; + for vec::each(vector) |element| { + accumulator.push(function(element)); + } + return accumulator; +} diff --git a/demo/kitchen-sink/modelist.js b/demo/kitchen-sink/modelist.js index 9c693f99..9ba4a13d 100644 --- a/demo/kitchen-sink/modelist.js +++ b/demo/kitchen-sink/modelist.js @@ -35,7 +35,6 @@ Mode.prototype.supportsFile = function(filename) { }; var modesByName = { - abap: ["ABAP" , "abap"], asciidoc: ["AsciiDoc" , "asciidoc"], c9search: ["C9Search" , "c9search_results"], coffee: ["CoffeeScript" , "^Cakefile|coffee|cf|cson"], @@ -100,12 +99,24 @@ var modesByName = { text: ["Text" , "txt"], textile: ["Textile" , "textile"], tmsnippet: ["tmSnippet" , "tmSnippet"], - toml: ["toml" , "toml"], + toml: ["Toml" , "toml"], typescript: ["Typescript" , "typescript|ts|str"], vbscript: ["VBScript" , "vbs"], xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], xquery: ["XQuery" , "xq"], - yaml: ["YAML" , "yaml"] + yaml: ["YAML" , "yaml"], + + abap: ["ABAP" , "abap"], + actionscript: ["ActionScript" ,"as"], + erlang: ["Erlang" ,"erl|hrl"], + forth: ["Forth", ,"frt|fs|ldr"], + fortran_modern: ["Fortran - Modern", ,"f90|F90|f95|F95|f03|F03|f08|F08"], + haskell: ["Haskell", "hs"], + julia: ["Julia", "jl"], + prolog: ["Prolog", "plg|prolog"], + rust: ["Rust", "rs|rc"] + + }; for (var name in modesByName) { diff --git a/lib/ace/mode/rust_highlight_rules.js b/lib/ace/mode/rust_highlight_rules.js index 03312a45..817cb65e 100644 --- a/lib/ace/mode/rust_highlight_rules.js +++ b/lib/ace/mode/rust_highlight_rules.js @@ -63,17 +63,17 @@ var RustHighlightRules = function() { next: 'pop' }, { include: '#rust_escaped_character' }, { defaultToken: 'string.quoted.double.source.rust' } ] }, - { token: - [ 'keyword.source.rust', - 'meta.function.source.rust', - 'entity.name.function.source.rust', - 'meta.function.source.rust' ], + { token: [ 'keyword.source.rust', 'meta.function.source.rust', + 'entity.name.function.source.rust', 'meta.function.source.rust' ], regex: '\\b(fn)(\\s+)([a-zA-Z_][a-zA-Z0-9_][\\w\\:,+ \\\'<>]*)(\\s*\\()' }, + { token: 'support.constant', regex: '\\b[a-zA-Z_][\\w\\d]*::' }, { token: 'keyword.source.rust', regex: '\\b(?:as|assert|break|claim|const|copy|Copy|do|drop|else|extern|fail|for|if|impl|in|let|log|loop|match|mod|module|move|mut|Owned|priv|pub|pure|ref|return|unchecked|unsafe|use|while|mod|Send|static|trait|class|struct|enum|type)\\b' }, { token: 'storage.type.source.rust', regex: '\\b(?:Self|m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b' }, { token: 'variable.language.source.rust', regex: '\\bself\\b' }, + { token: 'keyword.operator', + regex: '!|\\$|\\*|\\-\\-|\\-|\\+\\+|\\+|-->|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|/=|%=|\\+=|\\-=|&=|\\^=|,|;' }, { token: 'constant.language.source.rust', regex: '\\b(?:true|false|Some|None|Left|Right|Ok|Err)\\b' }, { token: 'support.constant.source.rust', From ab1ed57d55fc3546e299621963968e06d7979fab Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 6 Apr 2013 13:13:54 +0400 Subject: [PATCH 07/20] remove half working fortran and html_twig --- demo/kitchen-sink/doclist.js | 1 - demo/kitchen-sink/docs/fortran.f95 | 28 - demo/kitchen-sink/modelist.js | 5 +- lib/ace/mode/fortran_modern.js | 64 -- .../mode/fortran_modern_highlight_rules.js | 187 ----- lib/ace/mode/html_twig.js | 64 -- lib/ace/mode/html_twig_highlight_rules.js | 683 ------------------ 7 files changed, 1 insertion(+), 1031 deletions(-) delete mode 100644 demo/kitchen-sink/docs/fortran.f95 delete mode 100644 lib/ace/mode/fortran_modern.js delete mode 100644 lib/ace/mode/fortran_modern_highlight_rules.js delete mode 100644 lib/ace/mode/html_twig.js delete mode 100644 lib/ace/mode/html_twig_highlight_rules.js diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index 81fc5081..f0300f1f 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -140,7 +140,6 @@ var docs = { "docs/actionscript.as": "ActionScript", "docs/erlang/erl": "Erlang", "docs/forth.frt": "Forth", - "docs/fortran.f95": "Fortran", "docs/haskell.hs": "Haskell", "docs/julia.js": "Julia", "docs/prolog/plg": "Prolog", diff --git a/demo/kitchen-sink/docs/fortran.f95 b/demo/kitchen-sink/docs/fortran.f95 deleted file mode 100644 index 8dbd8809..00000000 --- a/demo/kitchen-sink/docs/fortran.f95 +++ /dev/null @@ -1,28 +0,0 @@ -! sum.f90 -! Performs summations using in a loop using EXIT statement -! Saves input information and the summation in a data file - -program summation -implicit none -integer :: sum, a - -print*, "This program performs summations. Enter 0 to stop." -open(unit=10, file="SumData.DAT") - -sum = 0 - -do - print*, "Add:" - read*, a - if (a == 0) then - exit - else - sum = sum + a - end if - write(10,*) a -end do - -print*, "Summation =", sum -write(10,*) "Summation =", sum -close(10) - \ No newline at end of file diff --git a/demo/kitchen-sink/modelist.js b/demo/kitchen-sink/modelist.js index 9ba4a13d..7001001b 100644 --- a/demo/kitchen-sink/modelist.js +++ b/demo/kitchen-sink/modelist.js @@ -110,13 +110,10 @@ var modesByName = { actionscript: ["ActionScript" ,"as"], erlang: ["Erlang" ,"erl|hrl"], forth: ["Forth", ,"frt|fs|ldr"], - fortran_modern: ["Fortran - Modern", ,"f90|F90|f95|F95|f03|F03|f08|F08"], haskell: ["Haskell", "hs"], julia: ["Julia", "jl"], prolog: ["Prolog", "plg|prolog"], - rust: ["Rust", "rs|rc"] - - + rust: ["Rust", "rs"] }; for (var name in modesByName) { diff --git a/lib/ace/mode/fortran_modern.js b/lib/ace/mode/fortran_modern.js deleted file mode 100644 index 5e12e38d..00000000 --- a/lib/ace/mode/fortran_modern.js +++ /dev/null @@ -1,64 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var FortranModernHighlightRules = require("./fortran_modern_highlight_rules").FortranModernHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - var highlighter = new FortranModernHighlightRules(); - this.foldingRules = new FoldMode(); - this.$tokenizer = new Tokenizer(highlighter.getRules()); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "!"; - this.blockComment = {start: "/*", end: "*/"}; - // Extra logic goes here. -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/fortran_modern_highlight_rules.js b/lib/ace/mode/fortran_modern_highlight_rules.js deleted file mode 100644 index b213e1d0..00000000 --- a/lib/ace/mode/fortran_modern_highlight_rules.js +++ /dev/null @@ -1,187 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from tm bundles\fortran.tmbundle\Syntaxes\Fortran - Modern.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var FortranModernHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { include: 'source.fortran' }, - { todo: - { token: - [ 'meta.function.interface.operator.fortran.modern', - 'storage.type.function.fortran', - 'meta.function.interface.operator.fortran.modern', - 'storage.type.fortran', - 'meta.function.interface.operator.fortran.modern', - 'keyword.operator.fortran', - 'meta.function.interface.operator.fortran.modern' ], - regex: '^(\\s*)(interface)(\\s+)(operator|assignment)(\\()(\\.[a-zA-Z0-9_]+\\.|[\\+\\-\\=\\/\\*]+)(\\))', - caseInsensitive: true, - push: - [ { token: - [ 'keyword.other.fortran', - 'meta.function.interface.operator.fortran.modern', - 'storage.type.function.fortran' ], - regex: '(end)(\\s*)((?:interface)?)', - caseInsensitive: true, - next: 'pop' }, - { include: '$self' }, - { defaultToken: 'meta.function.interface.operator.fortran.modern' } ] }, - comment: 'Interface declaration of operator/assignments' }, - { todo: - { token: - [ 'meta.function.interface.fortran.modern', - 'storage.type.function.fortran', - 'meta.function.interface.fortran.modern', - 'entity.name.function.fortran' ], - regex: '^(\\s*)(interface)(\\s+)([A-Za-z_][A-Za-z0-9_]*)', - caseInsensitive: true, - push: - [ { token: - [ 'keyword.other.fortran', - 'meta.function.interface.fortran.modern', - 'storage.type.function.fortran' ], - regex: '(end)(\\s*)((?:interface)?)', - caseInsensitive: true, - next: 'pop' }, - { include: '$self' }, - { defaultToken: 'meta.function.interface.fortran.modern' } ] }, - comment: 'Interface declaration of function/subroutines' }, - { todo: - { token: - [ 'meta.type-definition.fortran.modern', - 'storage.type.fortran.modern', - 'meta.type-definition.fortran.modern', - 'entity.name.type.fortran.modern' ], - regex: '^(\\s*)(type)(\\s+)([a-zA-Z_][a-zA-Z0-9_]*)', - caseInsensitive: true, - push: - [ { token: - [ 'keyword.other.fortran', - 'meta.type-definition.fortran.modern', - 'storage.type.fortran.modern', - 'entity.name.type.end.fortran.modern' ], - regex: '(end)(\\s*)(?:(type))?((?:\\s+[A-Za-z_][A-Za-z0-9_]*)?)', - caseInsensitive: true, - next: 'pop' }, - { include: '$self' }, - { defaultToken: 'meta.type-definition.fortran.modern' } ] }, - comment: 'Type definition' }, - { token: 'punctuation.definition.comment.fortran', - regex: '!-', - push: - [ { token: 'comment.line.exclamation.mark.fortran.modern', - regex: '$', - next: 'pop' }, - { token: 'text', regex: '\\\\\\s*$' }, - { defaultToken: 'comment.line.exclamation.mark.fortran.modern' } ] }, - { token: 'punctuation.definition.comment.fortran', - regex: '!', - push: - [ { token: 'comment.line.exclamation.fortran.modern', - regex: '$', - next: 'pop' }, - { token: 'text', regex: '\\\\\\s*$' }, - { defaultToken: 'comment.line.exclamation.fortran.modern' } ] }, - { token: 'keyword.control.fortran.modern', - regex: '\\b(?:select\\s+case|case(?:\\s+default)?|end\\s+select|use|(?:end\\s+)?forall)\\b', - caseInsensitive: true, - comment: 'statements controling the flow of the program' }, - { token: 'keyword.control.io.fortran.modern', - regex: '\\b(?:access|action|advance|append|apostrophe|asis|blank|delete|delim|direct|end|eor|err|exist|file|fmt|form|formatted|iolength|iostat|keep|name|named|nextrec|new|nml|no|null|number|old|opened|pad|position|quote|read|readwrite|rec|recl|replace|scratch|sequential|size|status|undefined|unformatted|unit|unknown|write|yes|zero|namelist)(?=\\()', - caseInsensitive: true, - comment: 'input/output instrinsics' }, - { token: 'keyword.operator.logical.fortran.modern', - regex: '\\b(?:\\=\\=|\\/\\=|\\>\\=|\\>|\\<|\\<\\=)\\b', - comment: 'logical operators in symbolic format' }, - { token: 'keyword.operator.fortran.modern', - regex: '\\%|\\=\\>', - comment: 'operators' }, - { token: 'keyword.other.instrinsic.numeric.fortran.modern', - regex: '\\b(?:ceiling|floor|modulo)(?=\\()', - caseInsensitive: true, - comment: 'numeric instrinsics' }, - { token: 'keyword.other.instrinsic.array.fortran.modern', - regex: '\\b(?:allocate|allocated|deallocate)(?=\\()', - caseInsensitive: true, - comment: 'matrix/vector/array instrinsics' }, - { token: 'keyword.other.instrinsic.pointer.fortran.modern', - regex: '\\bassociated(?=\\()', - caseInsensitive: true, - comment: 'pointer instrinsics' }, - { token: 'keyword.other.programming-units.fortran.modern', - regex: '\\b(?:end\\s*)?(?:interface|procedure|module)\\b', - caseInsensitive: true, - comment: 'programming units' }, - { token: 'storage.type.fortran.modern', - regex: '\\btype(?=\\s*\\()\\b(?=.*::)', - caseInsensitive: true, - push: - [ { token: 'meta.specification.fortran.modern', - regex: '(?=!)|$', - next: 'pop' }, - { include: '$base' }, - { defaultToken: 'meta.specification.fortran.modern' } ], - comment: 'Line of type specification' }, - { token: 'storage.type.fortran.modern', - regex: '\\btype(?=\\s*\\()\\b', - caseInsensitive: true }, - { token: 'storage.modifier.fortran.modern', - regex: '\\b(?:optional|recursive|pointer|allocatable|target|private|public)\\b', - caseInsensitive: true } ] } - - this.normalizeRules(); -}; - -FortranModernHighlightRules.metaData = { comment: 'Specificities of Fortran >= 90', - fileTypes: [ 'f90', 'F90', 'f95', 'F95', 'f03', 'F03', 'f08', 'F08' ], - firstLineMatch: '(?i)-[*]- mode: f90 -[*]-', - keyEquivalent: '^~F', - name: 'Fortran - Modern', - scopeName: 'source.fortran.modern' } - - -oop.inherits(FortranModernHighlightRules, TextHighlightRules); - -exports.FortranModernHighlightRules = FortranModernHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/html_twig.js b/lib/ace/mode/html_twig.js deleted file mode 100644 index f14a1450..00000000 --- a/lib/ace/mode/html_twig.js +++ /dev/null @@ -1,64 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HTMLTwigHighlightRules = require("./html_twig_highlight_rules").HTMLTwigHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - var highlighter = new HTMLTwigHighlightRules(); - this.foldingRules = new FoldMode(); - this.$tokenizer = new Tokenizer(highlighter.getRules()); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "<%+#"; - this.blockComment = {start: "/*", end: "*/"}; - // Extra logic goes here. -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/html_twig_highlight_rules.js b/lib/ace/mode/html_twig_highlight_rules.js deleted file mode 100644 index 2a9e57a5..00000000 --- a/lib/ace/mode/html_twig_highlight_rules.js +++ /dev/null @@ -1,683 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from https://raw.github.com/Anomareh/PHP-Twig.tmbundle/master/Syntaxes/HTML (Twig).tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var HTMLTwigHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: [ 'punctuation.definition.tag.html', 'entity.name.tag.html' ], - regex: '(<)([a-zA-Z0-9:]+)(?=[^>]*>)', - push: - [ { token: - [ 'punctuation.definition.tag.html', - 'meta.scope.between-tag-pair.html', - 'punctuation.definition.tag.html', - 'entity.name.tag.html', - 'punctuation.definition.tag.html' ], - regex: '(>)(<)(/)([a-zA-Z0-9:]+)(>)', - next: 'pop' }, - { include: '#tag-stuff' }, - { defaultToken: 'meta.tag.any.html' } ] }, - { token: - [ 'punctuation.definition.tag.html', - 'entity.name.tag.xml.html' ], - regex: '(<\\?)(xml)', - push: - [ { token: 'punctuation.definition.tag.html', - regex: '\\?>', - next: 'pop' }, - { include: '#tag-generic-attribute' }, - { include: '#string-double-quoted' }, - { include: '#string-single-quoted' }, - { defaultToken: 'meta.tag.preprocessor.xml.html' } ] }, - { token: 'punctuation.definition.comment.html', - regex: ')$\n |\\{%\\s+(if|for|spaceless|raw|autoescape|macro|)\n )', - foldingStopMarker: '(?x)\n (\n |^(?!.*?$\n |\\{%\\s+end(if|for|spaceless|raw|autoescape|macro|)\n )', - keyEquivalent: '^~T', - name: 'HTML (Twig)', - scopeName: 'text.html.twig' } - - -oop.inherits(HTMLTwigHighlightRules, TextHighlightRules); - -exports.HTMLTwigHighlightRules = HTMLTwigHighlightRules; -}); \ No newline at end of file From 743aad3ad48f69f75596cc32eee819e67ad61303 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 6 Apr 2013 14:58:47 +0400 Subject: [PATCH 08/20] Add AutoHotKey/AutoIT syntax highglight fixes #886 --- demo/kitchen-sink/doclist.js | 1 + demo/kitchen-sink/docs/autohotkey.ahk | 35 +++ demo/kitchen-sink/modelist.js | 1 + lib/ace/mode/_test/tokens_autohotkey.json | 261 +++++++++++++++++++++ lib/ace/mode/autohotkey.js | 64 +++++ lib/ace/mode/autohotkey_highlight_rules.js | 107 +++++++++ lib/ace/mode/text_highlight_rules.js | 9 +- 7 files changed, 477 insertions(+), 1 deletion(-) create mode 100644 demo/kitchen-sink/docs/autohotkey.ahk create mode 100644 lib/ace/mode/_test/tokens_autohotkey.json create mode 100644 lib/ace/mode/autohotkey.js create mode 100644 lib/ace/mode/autohotkey_highlight_rules.js diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index f0300f1f..f025db5f 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -138,6 +138,7 @@ var docs = { "docs/c9search.c9search_results": "C9 Search Results", "docs/actionscript.as": "ActionScript", + "docs/autohotkey.ahk": "AutoHotKey", "docs/erlang/erl": "Erlang", "docs/forth.frt": "Forth", "docs/haskell.hs": "Haskell", diff --git a/demo/kitchen-sink/docs/autohotkey.ahk b/demo/kitchen-sink/docs/autohotkey.ahk new file mode 100644 index 00000000..73687e67 --- /dev/null +++ b/demo/kitchen-sink/docs/autohotkey.ahk @@ -0,0 +1,35 @@ +#NoEnv +SetBatchLines -1 + +CoordMode Mouse, Screen +OnExit GuiClose + +zoom := 9 + +computeSize(){ + global as_x + as_x := Round(ws_x/zoom/2 - 0.5) + if (zoom>1) { + pix := Round(zoom) + } ele { + pix := 1 + } + ToolTip Message %as_x% %zoom% %ws_x% %hws_x% +} + +hdc_frame := DllCall("GetDC", UInt, MagnifierID) + +; comment +DrawCross(byRef x="", rX,rY,z, dc){ + ;specify the style, thickness and color of the cross lines + h_pen := DllCall( "gdi32.dll\CreatePen", Int, 0, Int, 1, UInt, 0x0000FF) +} + +;Ctrl ^; Shift +; Win #; Alt ! +^NumPadAdd:: +^WheelUp:: +^;:: ;comment + If(zoom < ws_x and ( A_ThisHotKey = "^WheelUp" or A_ThisHotKey ="^NumPadAdd") ) + zoom *= 1.189207115 ; sqrt(sqrt(2)) + Gosub,setZoom +return diff --git a/demo/kitchen-sink/modelist.js b/demo/kitchen-sink/modelist.js index 7001001b..2159f531 100644 --- a/demo/kitchen-sink/modelist.js +++ b/demo/kitchen-sink/modelist.js @@ -108,6 +108,7 @@ var modesByName = { abap: ["ABAP" , "abap"], actionscript: ["ActionScript" ,"as"], + autohotkey: ["AutoHotKey" , "ahk"], erlang: ["Erlang" ,"erl|hrl"], forth: ["Forth", ,"frt|fs|ldr"], haskell: ["Haskell", "hs"], diff --git a/lib/ace/mode/_test/tokens_autohotkey.json b/lib/ace/mode/_test/tokens_autohotkey.json new file mode 100644 index 00000000..374310fb --- /dev/null +++ b/lib/ace/mode/_test/tokens_autohotkey.json @@ -0,0 +1,261 @@ +[[ + "start", + ["punctuation.ahk","#"], + ["keyword.command.ahk","NoEnv"] +],[ + "start", + ["keyword.command.ahk","SetBatchLines"], + ["text"," "], + ["constant.numeric","-1"] +],[ + "start" +],[ + "start", + ["keyword.command.ahk","CoordMode"], + ["text"," "], + ["variable.parameter","Mouse"], + ["punctuation.ahk",","], + ["text"," "], + ["variable.parameter","Screen"] +],[ + "start", + ["keyword.command.ahk","OnExit"], + ["text"," "], + ["variable.parameter","GuiClose"] +],[ + "start" +],[ + "start", + ["text","zoom "], + ["keyword.operator.ahk",":="], + ["text"," 9"] +],[ + "start" +],[ + "start", + ["text","computeSize"], + ["punctuation.ahk","(){"] +],[ + "start", + ["text","\t"], + ["keyword.control.ahk","global"], + ["text"," as_x"] +],[ + "start", + ["text","\tas_x "], + ["keyword.operator.ahk",":="], + ["text"," "], + ["support.function.ahk","Round"], + ["punctuation.ahk","("], + ["text","ws_x"], + ["keyword.operator.ahk","/"], + ["text","zoom"], + ["keyword.operator.ahk","/"], + ["text","2 "], + ["keyword.operator.ahk","-"], + ["text"," 0.5"], + ["punctuation.ahk",")"] +],[ + "start", + ["text","\t"], + ["keyword.control.ahk","if"], + ["text"," "], + ["punctuation.ahk","("], + ["text","zoom"], + ["keyword.operator.ahk",">"], + ["text","1"], + ["punctuation.ahk",")"], + ["text"," "], + ["punctuation.ahk","{"] +],[ + "start", + ["text","\t\tpix "], + ["keyword.operator.ahk",":="], + ["text"," "], + ["support.function.ahk","Round"], + ["punctuation.ahk","("], + ["text","zoom"], + ["punctuation.ahk",")"] +],[ + "start", + ["text","\t"], + ["punctuation.ahk","}"], + ["text"," ele "], + ["punctuation.ahk","{"] +],[ + "start", + ["text","\t\tpix "], + ["keyword.operator.ahk",":="], + ["text"," 1"] +],[ + "start", + ["text","\t"], + ["punctuation.ahk","}"] +],[ + "start", + ["text"," "], + ["keyword.command.ahk","ToolTip"], + ["text"," Message "], + ["punctuation.ahk","%"], + ["text","as_x"], + ["punctuation.ahk","%"], + ["text"," "], + ["punctuation.ahk","%"], + ["text","zoom"], + ["punctuation.ahk","%"], + ["text"," "], + ["punctuation.ahk","%"], + ["text","ws_x"], + ["punctuation.ahk","%"], + ["text"," "], + ["punctuation.ahk","%"], + ["text","hws_x"], + ["punctuation.ahk","%"], + ["text"," "] +],[ + "start", + ["punctuation.ahk","}"] +],[ + "start" +],[ + "start", + ["text","hdc_frame "], + ["keyword.operator.ahk",":="], + ["text"," "], + ["support.function.ahk","DllCall"], + ["punctuation.ahk","("], + ["punctuation.quote.double","\""], + ["string.quoted.ahk","GetDC"], + ["punctuation.quote.double","\""], + ["punctuation.ahk",","], + ["text"," UInt"], + ["punctuation.ahk",","], + ["text"," MagnifierID"], + ["punctuation.ahk",")"] +],[ + "start" +],[ + "start", + ["comment.line.ahk","; comment"] +],[ + "start", + ["text","DrawCross"], + ["punctuation.ahk","("], + ["keyword.control.ahk","byRef"], + ["text"," x"], + ["keyword.operator.ahk","="], + ["punctuation.quote.double","\""], + ["punctuation.quote.double","\""], + ["punctuation.ahk",","], + ["text"," rX"], + ["punctuation.ahk",","], + ["text","rY"], + ["punctuation.ahk",","], + ["text","z"], + ["punctuation.ahk",","], + ["text"," dc"], + ["punctuation.ahk","){"] +],[ + "start", + ["text"," "], + ["comment.line.ahk"," ;specify the style, thickness and color of the cross lines"] +],[ + "start", + ["text"," h_pen "], + ["keyword.operator.ahk",":="], + ["text"," "], + ["support.function.ahk","DllCall"], + ["punctuation.ahk","("], + ["text"," "], + ["punctuation.quote.double","\""], + ["string.quoted.ahk","gdi32.dll\\CreatePen"], + ["punctuation.quote.double","\""], + ["punctuation.ahk",","], + ["text"," "], + ["constant.language","Int"], + ["punctuation.ahk",","], + ["text"," 0"], + ["punctuation.ahk",","], + ["text"," "], + ["constant.language","Int"], + ["punctuation.ahk",","], + ["text"," 1"], + ["punctuation.ahk",","], + ["text"," UInt"], + ["punctuation.ahk",","], + ["text"," 0x0000FF"], + ["punctuation.ahk",")"] +],[ + "start", + ["punctuation.ahk","}"] +],[ + "start" +],[ + "start", + ["comment.line.ahk",";Ctrl ^; Shift +; Win #; Alt !"] +],[ + "start", + ["text","^"], + ["support.constant.ahk","NumPadAdd"], + ["keyword.operator.ahk","::"] +],[ + "start", + ["text","^"], + ["support.constant.ahk","WheelUp"], + ["keyword.operator.ahk","::"], + ["text"," "] +],[ + "start", + ["text","^;"], + ["keyword.operator.ahk","::"], + ["text"," "], + ["comment.line.ahk"," ;comment"] +],[ + "start", + ["text"," "], + ["keyword.control.ahk","If"], + ["punctuation.ahk","("], + ["text","zoom "], + ["keyword.operator.ahk","<"], + ["text"," ws_x "], + ["variable.parameter","and"], + ["text"," "], + ["punctuation.ahk","("], + ["text"," "], + ["variable.predefined.ahk","A_ThisHotKey"], + ["text"," "], + ["keyword.operator.ahk","="], + ["text"," "], + ["punctuation.quote.double","\""], + ["string.quoted.ahk","^WheelUp"], + ["punctuation.quote.double","\""], + ["text"," "], + ["variable.parameter","or"], + ["text"," "], + ["variable.predefined.ahk","A_ThisHotKey"], + ["text"," "], + ["keyword.operator.ahk","="], + ["punctuation.quote.double","\""], + ["string.quoted.ahk","^NumPadAdd"], + ["punctuation.quote.double","\""], + ["punctuation.ahk",")"], + ["text"," "], + ["punctuation.ahk",")"] +],[ + "start", + ["text","\t\tzoom "], + ["keyword.operator.ahk","*="], + ["text"," 1.189207115 "], + ["comment.line.ahk"," ; sqrt(sqrt(2))"] +],[ + "start", + ["text","\t"], + ["keyword.command.ahk","Gosub"], + ["punctuation.ahk",","], + ["text","setZoom"] +],[ + "start", + ["keyword.control.ahk","return"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/autohotkey.js b/lib/ace/mode/autohotkey.js new file mode 100644 index 00000000..b8e69fd9 --- /dev/null +++ b/lib/ace/mode/autohotkey.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var AutoHotKeyHighlightRules = require("./autohotkey_highlight_rules").AutoHotKeyHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new AutoHotKeyHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "/\\*"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/autohotkey_highlight_rules.js b/lib/ace/mode/autohotkey_highlight_rules.js new file mode 100644 index 00000000..45193996 --- /dev/null +++ b/lib/ace/mode/autohotkey_highlight_rules.js @@ -0,0 +1,107 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from C:\Users\LED\Desktop\AutoHotKey.tmLanguage (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var AutoHotKeyHighlightRules = function() { + var autoItKeywords = 'And|ByRef|Case|Const|ContinueCase|ContinueLoop|Default|Dim|Do|Else|ElseIf|EndFunc|EndIf|EndSelect|EndSwitch|EndWith|Enum|Exit|ExitLoop|False|For|Func|Global|If|In|Local|Next|Not|Or|ReDim|Return|Select|Step|Switch|Then|To|True|Until|WEnd|While|With|' + + 'Abs|ACos|AdlibDisable|AdlibEnable|Asc|AscW|ASin|Assign|ATan|AutoItSetOption|AutoItWinGetTitle|AutoItWinSetTitle|Beep|Binary|BinaryLen|BinaryMid|BinaryToString|BitAND|BitNOT|BitOR|BitRotate|BitShift|BitXOR|BlockInput|Break|Call|CDTray|Ceiling|Chr|ChrW|ClipGet|ClipPut|ConsoleRead|ConsoleWrite|ConsoleWriteError|ControlClick|ControlCommand|ControlDisable|ControlEnable|ControlFocus|ControlGetFocus|ControlGetHandle|ControlGetPos|ControlGetText|ControlHide|ControlListView|ControlMove|ControlSend|ControlSetText|ControlShow|ControlTreeView|Cos|Dec|DirCopy|DirCreate|DirGetSize|DirMove|DirRemove|DllCall|DllCallbackFree|DllCallbackGetPtr|DllCallbackRegister|DllClose|DllOpen|DllStructCreate|DllStructGetData|DllStructGetPtr|DllStructGetSize|DllStructSetData|DriveGetDrive|DriveGetFileSystem|DriveGetLabel|DriveGetSerial|DriveGetType|DriveMapAdd|DriveMapDel|DriveMapGet|DriveSetLabel|DriveSpaceFree|DriveSpaceTotal|DriveStatus|EnvGet|EnvSet|EnvUpdate|Eval|Execute|Exp|FileChangeDir|FileClose|FileCopy|FileCreateNTFSLink|FileCreateShortcut|FileDelete|FileExists|FileFindFirstFile|FileFindNextFile|FileGetAttrib|FileGetLongName|FileGetShortcut|FileGetShortName|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileOpen|FileOpenDialog|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileSaveDialog|FileSelectFolder|FileSetAttrib|FileSetTime|FileWrite|FileWriteLine|Floor|FtpSetProxy|GUICreate|GUICtrlCreateAvi|GUICtrlCreateButton|GUICtrlCreateCheckbox|GUICtrlCreateCombo|GUICtrlCreateContextMenu|GUICtrlCreateDate|GUICtrlCreateDummy|GUICtrlCreateEdit|GUICtrlCreateGraphic|GUICtrlCreateGroup|GUICtrlCreateIcon|GUICtrlCreateInput|GUICtrlCreateLabel|GUICtrlCreateList|GUICtrlCreateListView|GUICtrlCreateListViewItem|GUICtrlCreateMenu|GUICtrlCreateMenuItem|GUICtrlCreateMonthCal|GUICtrlCreateObj|GUICtrlCreatePic|GUICtrlCreateProgress|GUICtrlCreateRadio|GUICtrlCreateSlider|GUICtrlCreateTab|GUICtrlCreateTabItem|GUICtrlCreateTreeView|GUICtrlCreateTreeViewItem|GUICtrlCreateUpdown|GUICtrlDelete|GUICtrlGetHandle|GUICtrlGetState|GUICtrlRead|GUICtrlRecvMsg|GUICtrlRegisterListViewSort|GUICtrlSendMsg|GUICtrlSendToDummy|GUICtrlSetBkColor|GUICtrlSetColor|GUICtrlSetCursor|GUICtrlSetData|GUICtrlSetFont|GUICtrlSetDefColor|GUICtrlSetDefBkColor|GUICtrlSetGraphic|GUICtrlSetImage|GUICtrlSetLimit|GUICtrlSetOnEvent|GUICtrlSetPos|GUICtrlSetResizing|GUICtrlSetState|GUICtrlSetStyle|GUICtrlSetTip|GUIDelete|GUIGetCursorInfo|GUIGetMsg|GUIGetStyle|GUIRegisterMsg|GUISetAccelerators()|GUISetBkColor|GUISetCoord|GUISetCursor|GUISetFont|GUISetHelp|GUISetIcon|GUISetOnEvent|GUISetState|GUISetStyle|GUIStartGroup|GUISwitch|Hex|HotKeySet|HttpSetProxy|HWnd|InetGet|InetGetSize|IniDelete|IniRead|IniReadSection|IniReadSectionNames|IniRenameSection|IniWrite|IniWriteSection|InputBox|Int|IsAdmin|IsArray|IsBinary|IsBool|IsDeclared|IsDllStruct|IsFloat|IsHWnd|IsInt|IsKeyword|IsNumber|IsObj|IsPtr|IsString|Log|MemGetStats|Mod|MouseClick|MouseClickDrag|MouseDown|MouseGetCursor|MouseGetPos|MouseMove|MouseUp|MouseWheel|MsgBox|Number|ObjCreate|ObjEvent|ObjGet|ObjName|Opt|Ping|PixelChecksum|PixelGetColor|PixelSearch|PluginClose|PluginOpen|ProcessClose|ProcessExists|ProcessGetStats|ProcessList|ProcessSetPriority|ProcessWait|ProcessWaitClose|ProgressOff|ProgressOn|ProgressSet|Ptr|Random|RegDelete|RegEnumKey|RegEnumVal|RegRead|RegWrite|Round|Run|RunAs|RunAsWait|RunWait|Send|SendKeepActive|SetError|SetExtended|ShellExecute|ShellExecuteWait|Shutdown|Sin|Sleep|SoundPlay|SoundSetWaveVolume|SplashImageOn|SplashOff|SplashTextOn|Sqrt|SRandom|StatusbarGetText|StderrRead|StdinWrite|StdioClose|StdoutRead|String|StringAddCR|StringCompare|StringFormat|StringInStr|StringIsAlNum|StringIsAlpha|StringIsASCII|StringIsDigit|StringIsFloat|StringIsInt|StringIsLower|StringIsSpace|StringIsUpper|StringIsXDigit|StringLeft|StringLen|StringLower|StringMid|StringRegExp|StringRegExpReplace|StringReplace|StringRight|StringSplit|StringStripCR|StringStripWS|StringToBinary|StringTrimLeft|StringTrimRight|StringUpper|Tan|TCPAccept|TCPCloseSocket|TCPConnect|TCPListen|TCPNameToIP|TCPRecv|TCPSend|TCPShutdown|TCPStartup|TimerDiff|TimerInit|ToolTip|TrayCreateItem|TrayCreateMenu|TrayGetMsg|TrayItemDelete|TrayItemGetHandle|TrayItemGetState|TrayItemGetText|TrayItemSetOnEvent|TrayItemSetState|TrayItemSetText|TraySetClick|TraySetIcon|TraySetOnEvent|TraySetPauseIcon|TraySetState|TraySetToolTip|TrayTip|UBound|UDPBind|UDPCloseSocket|UDPOpen|UDPRecv|UDPSend|UDPShutdown|UDPStartup|VarGetType|WinActivate|WinActive|WinClose|WinExists|WinFlash|WinGetCaretPos|WinGetClassList|WinGetClientSize|WinGetHandle|WinGetPos|WinGetProcess|WinGetState|WinGetText|WinGetTitle|WinKill|WinList|WinMenuSelectItem|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinSetOnTop|WinSetState|WinSetTitle|WinSetTrans|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive|' + + 'ArrayAdd|ArrayBinarySearch|ArrayConcatenate|ArrayDelete|ArrayDisplay|ArrayFindAll|ArrayInsert|ArrayMax|ArrayMaxIndex|ArrayMin|ArrayMinIndex|ArrayPop|ArrayPush|ArrayReverse|ArraySearch|ArraySort|ArraySwap|ArrayToClip|ArrayToString|ArrayTrim|ChooseColor|ChooseFont|ClipBoard_ChangeChain|ClipBoard_Close|ClipBoard_CountFormats|ClipBoard_Empty|ClipBoard_EnumFormats|ClipBoard_FormatStr|ClipBoard_GetData|ClipBoard_GetDataEx|ClipBoard_GetFormatName|ClipBoard_GetOpenWindow|ClipBoard_GetOwner|ClipBoard_GetPriorityFormat|ClipBoard_GetSequenceNumber|ClipBoard_GetViewer|ClipBoard_IsFormatAvailable|ClipBoard_Open|ClipBoard_RegisterFormat|ClipBoard_SetData|ClipBoard_SetDataEx|ClipBoard_SetViewer|ClipPutFile|ColorConvertHSLtoRGB|ColorConvertRGBtoHSL|ColorGetBlue|ColorGetGreen|ColorGetRed|Date_Time_CompareFileTime|Date_Time_DOSDateTimeToArray|Date_Time_DOSDateTimeToFileTime|Date_Time_DOSDateTimeToStr|Date_Time_DOSDateToArray|Date_Time_DOSDateToStr|Date_Time_DOSTimeToArray|Date_Time_DOSTimeToStr|Date_Time_EncodeFileTime|Date_Time_EncodeSystemTime|Date_Time_FileTimeToArray|Date_Time_FileTimeToDOSDateTime|Date_Time_FileTimeToLocalFileTime|Date_Time_FileTimeToStr|Date_Time_FileTimeToSystemTime|Date_Time_GetFileTime|Date_Time_GetLocalTime|Date_Time_GetSystemTime|Date_Time_GetSystemTimeAdjustment|Date_Time_GetSystemTimeAsFileTime|Date_Time_GetSystemTimes|Date_Time_GetTickCount|Date_Time_GetTimeZoneInformation|Date_Time_LocalFileTimeToFileTime|Date_Time_SetFileTime|Date_Time_SetLocalTime|Date_Time_SetSystemTime|Date_Time_SetSystemTimeAdjustment|Date_Time_SetTimeZoneInformation|Date_Time_SystemTimeToArray|Date_Time_SystemTimeToDateStr|Date_Time_SystemTimeToDateTimeStr|Date_Time_SystemTimeToFileTime|Date_Time_SystemTimeToTimeStr|Date_Time_SystemTimeToTzSpecificLocalTime|Date_Time_TzSpecificLocalTimeToSystemTime|DateAdd|DateDayOfWeek|DateDaysInMonth|DateDiff|DateIsLeapYear|DateIsValid|DateTimeFormat|DateTimeSplit|DateToDayOfWeek|DateToDayOfWeekISO|DateToDayValue|DateToMonth|DayValueToDate|DebugBugReportEnv|DebugOut|DebugSetup|Degree|EventLog__Backup|EventLog__Clear|EventLog__Close|EventLog__Count|EventLog__DeregisterSource|EventLog__Full|EventLog__Notify|EventLog__Oldest|EventLog__Open|EventLog__OpenBackup|EventLog__Read|EventLog__RegisterSource|EventLog__Report|FileCountLines|FileCreate|FileListToArray|FilePrint|FileReadToArray|FileWriteFromArray|FileWriteLog|FileWriteToLine|GDIPlus_ArrowCapCreate|GDIPlus_ArrowCapDispose|GDIPlus_ArrowCapGetFillState|GDIPlus_ArrowCapGetHeight|GDIPlus_ArrowCapGetMiddleInset|GDIPlus_ArrowCapGetWidth|GDIPlus_ArrowCapSetFillState|GDIPlus_ArrowCapSetHeight|GDIPlus_ArrowCapSetMiddleInset|GDIPlus_ArrowCapSetWidth|GDIPlus_BitmapCloneArea|GDIPlus_BitmapCreateFromFile|GDIPlus_BitmapCreateFromGraphics|GDIPlus_BitmapCreateFromHBITMAP|GDIPlus_BitmapCreateHBITMAPFromBitmap|GDIPlus_BitmapDispose|GDIPlus_BitmapLockBits|GDIPlus_BitmapUnlockBits|GDIPlus_BrushClone|GDIPlus_BrushCreateSolid|GDIPlus_BrushDispose|GDIPlus_BrushGetType|GDIPlus_CustomLineCapDispose|GDIPlus_Decoders|GDIPlus_DecodersGetCount|GDIPlus_DecodersGetSize|GDIPlus_Encoders|GDIPlus_EncodersGetCLSID|GDIPlus_EncodersGetCount|GDIPlus_EncodersGetParamList|GDIPlus_EncodersGetParamListSize|GDIPlus_EncodersGetSize|GDIPlus_FontCreate|GDIPlus_FontDispose|GDIPlus_FontFamilyCreate|GDIPlus_FontFamilyDispose|GDIPlus_GraphicsClear|GDIPlus_GraphicsCreateFromHDC|GDIPlus_GraphicsCreateFromHWND|GDIPlus_GraphicsDispose|GDIPlus_GraphicsDrawArc|GDIPlus_GraphicsDrawBezier|GDIPlus_GraphicsDrawClosedCurve|GDIPlus_GraphicsDrawCurve|GDIPlus_GraphicsDrawEllipse|GDIPlus_GraphicsDrawImage|GDIPlus_GraphicsDrawImageRect|GDIPlus_GraphicsDrawImageRectRect|GDIPlus_GraphicsDrawLine|GDIPlus_GraphicsDrawPie|GDIPlus_GraphicsDrawPolygon|GDIPlus_GraphicsDrawRect|GDIPlus_GraphicsDrawString|GDIPlus_GraphicsDrawStringEx|GDIPlus_GraphicsFillClosedCurve|GDIPlus_GraphicsFillEllipse|GDIPlus_GraphicsFillPie|GDIPlus_GraphicsFillRect|GDIPlus_GraphicsGetDC|GDIPlus_GraphicsGetSmoothingMode|GDIPlus_GraphicsMeasureString|GDIPlus_GraphicsReleaseDC|GDIPlus_GraphicsSetSmoothingMode|GDIPlus_GraphicsSetTransform|GDIPlus_ImageDispose|GDIPlus_ImageGetGraphicsContext|GDIPlus_ImageGetHeight|GDIPlus_ImageGetWidth|GDIPlus_ImageLoadFromFile|GDIPlus_ImageSaveToFile|GDIPlus_ImageSaveToFileEx|GDIPlus_MatrixCreate|GDIPlus_MatrixDispose|GDIPlus_MatrixRotate|GDIPlus_ParamAdd|GDIPlus_ParamInit|GDIPlus_PenCreate|GDIPlus_PenDispose|GDIPlus_PenGetAlignment|GDIPlus_PenGetColor|GDIPlus_PenGetCustomEndCap|GDIPlus_PenGetDashCap|GDIPlus_PenGetDashStyle|GDIPlus_PenGetEndCap|GDIPlus_PenGetWidth|GDIPlus_PenSetAlignment|GDIPlus_PenSetColor|GDIPlus_PenSetCustomEndCap|GDIPlus_PenSetDashCap|GDIPlus_PenSetDashStyle|GDIPlus_PenSetEndCap|GDIPlus_PenSetWidth|GDIPlus_RectFCreate|GDIPlus_Shutdown|GDIPlus_Startup|GDIPlus_StringFormatCreate|GDIPlus_StringFormatDispose|GetIP|GUICtrlAVI_Close|GUICtrlAVI_Create|GUICtrlAVI_Destroy|GUICtrlAVI_Open|GUICtrlAVI_OpenEx|GUICtrlAVI_Play|GUICtrlAVI_Seek|GUICtrlAVI_Show|GUICtrlAVI_Stop|GUICtrlButton_Click|GUICtrlButton_Create|GUICtrlButton_Destroy|GUICtrlButton_Enable|GUICtrlButton_GetCheck|GUICtrlButton_GetFocus|GUICtrlButton_GetIdealSize|GUICtrlButton_GetImage|GUICtrlButton_GetImageList|GUICtrlButton_GetState|GUICtrlButton_GetText|GUICtrlButton_GetTextMargin|GUICtrlButton_SetCheck|GUICtrlButton_SetFocus|GUICtrlButton_SetImage|GUICtrlButton_SetImageList|GUICtrlButton_SetSize|GUICtrlButton_SetState|GUICtrlButton_SetStyle|GUICtrlButton_SetText|GUICtrlButton_SetTextMargin|GUICtrlButton_Show|GUICtrlComboBox_AddDir|GUICtrlComboBox_AddString|GUICtrlComboBox_AutoComplete|GUICtrlComboBox_BeginUpdate|GUICtrlComboBox_Create|GUICtrlComboBox_DeleteString|GUICtrlComboBox_Destroy|GUICtrlComboBox_EndUpdate|GUICtrlComboBox_FindString|GUICtrlComboBox_FindStringExact|GUICtrlComboBox_GetComboBoxInfo|GUICtrlComboBox_GetCount|GUICtrlComboBox_GetCurSel|GUICtrlComboBox_GetDroppedControlRect|GUICtrlComboBox_GetDroppedControlRectEx|GUICtrlComboBox_GetDroppedState|GUICtrlComboBox_GetDroppedWidth|GUICtrlComboBox_GetEditSel|GUICtrlComboBox_GetEditText|GUICtrlComboBox_GetExtendedUI|GUICtrlComboBox_GetHorizontalExtent|GUICtrlComboBox_GetItemHeight|GUICtrlComboBox_GetLBText|GUICtrlComboBox_GetLBTextLen|GUICtrlComboBox_GetList|GUICtrlComboBox_GetListArray|GUICtrlComboBox_GetLocale|GUICtrlComboBox_GetLocaleCountry|GUICtrlComboBox_GetLocaleLang|GUICtrlComboBox_GetLocalePrimLang|GUICtrlComboBox_GetLocaleSubLang|GUICtrlComboBox_GetMinVisible|GUICtrlComboBox_GetTopIndex|GUICtrlComboBox_InitStorage|GUICtrlComboBox_InsertString|GUICtrlComboBox_LimitText|GUICtrlComboBox_ReplaceEditSel|GUICtrlComboBox_ResetContent|GUICtrlComboBox_SelectString|GUICtrlComboBox_SetCurSel|GUICtrlComboBox_SetDroppedWidth|GUICtrlComboBox_SetEditSel|GUICtrlComboBox_SetEditText|GUICtrlComboBox_SetExtendedUI|GUICtrlComboBox_SetHorizontalExtent|GUICtrlComboBox_SetItemHeight|GUICtrlComboBox_SetMinVisible|GUICtrlComboBox_SetTopIndex|GUICtrlComboBox_ShowDropDown|GUICtrlComboBoxEx_AddDir|GUICtrlComboBoxEx_AddString|GUICtrlComboBoxEx_BeginUpdate|GUICtrlComboBoxEx_Create|GUICtrlComboBoxEx_CreateSolidBitMap|GUICtrlComboBoxEx_DeleteString|GUICtrlComboBoxEx_Destroy|GUICtrlComboBoxEx_EndUpdate|GUICtrlComboBoxEx_FindStringExact|GUICtrlComboBoxEx_GetComboBoxInfo|GUICtrlComboBoxEx_GetComboControl|GUICtrlComboBoxEx_GetCount|GUICtrlComboBoxEx_GetCurSel|GUICtrlComboBoxEx_GetDroppedControlRect|GUICtrlComboBoxEx_GetDroppedControlRectEx|GUICtrlComboBoxEx_GetDroppedState|GUICtrlComboBoxEx_GetDroppedWidth|GUICtrlComboBoxEx_GetEditControl|GUICtrlComboBoxEx_GetEditSel|GUICtrlComboBoxEx_GetEditText|GUICtrlComboBoxEx_GetExtendedStyle|GUICtrlComboBoxEx_GetExtendedUI|GUICtrlComboBoxEx_GetImageList|GUICtrlComboBoxEx_GetItem|GUICtrlComboBoxEx_GetItemEx|GUICtrlComboBoxEx_GetItemHeight|GUICtrlComboBoxEx_GetItemImage|GUICtrlComboBoxEx_GetItemIndent|GUICtrlComboBoxEx_GetItemOverlayImage|GUICtrlComboBoxEx_GetItemParam|GUICtrlComboBoxEx_GetItemSelectedImage|GUICtrlComboBoxEx_GetItemText|GUICtrlComboBoxEx_GetItemTextLen|GUICtrlComboBoxEx_GetList|GUICtrlComboBoxEx_GetListArray|GUICtrlComboBoxEx_GetLocale|GUICtrlComboBoxEx_GetLocaleCountry|GUICtrlComboBoxEx_GetLocaleLang|GUICtrlComboBoxEx_GetLocalePrimLang|GUICtrlComboBoxEx_GetLocaleSubLang|GUICtrlComboBoxEx_GetMinVisible|GUICtrlComboBoxEx_GetTopIndex|GUICtrlComboBoxEx_InitStorage|GUICtrlComboBoxEx_InsertString|GUICtrlComboBoxEx_LimitText|GUICtrlComboBoxEx_ReplaceEditSel|GUICtrlComboBoxEx_ResetContent|GUICtrlComboBoxEx_SetCurSel|GUICtrlComboBoxEx_SetDroppedWidth|GUICtrlComboBoxEx_SetEditSel|GUICtrlComboBoxEx_SetEditText|GUICtrlComboBoxEx_SetExtendedStyle|GUICtrlComboBoxEx_SetExtendedUI|GUICtrlComboBoxEx_SetImageList|GUICtrlComboBoxEx_SetItem|GUICtrlComboBoxEx_SetItemEx|GUICtrlComboBoxEx_SetItemHeight|GUICtrlComboBoxEx_SetItemImage|GUICtrlComboBoxEx_SetItemIndent|GUICtrlComboBoxEx_SetItemOverlayImage|GUICtrlComboBoxEx_SetItemParam|GUICtrlComboBoxEx_SetItemSelectedImage|GUICtrlComboBoxEx_SetMinVisible|GUICtrlComboBoxEx_SetTopIndex|GUICtrlComboBoxEx_ShowDropDown|GUICtrlDTP_Create|GUICtrlDTP_Destroy|GUICtrlDTP_GetMCColor|GUICtrlDTP_GetMCFont|GUICtrlDTP_GetMonthCal|GUICtrlDTP_GetRange|GUICtrlDTP_GetRangeEx|GUICtrlDTP_GetSystemTime|GUICtrlDTP_GetSystemTimeEx|GUICtrlDTP_SetFormat|GUICtrlDTP_SetMCColor|GUICtrlDTP_SetMCFont|GUICtrlDTP_SetRange|GUICtrlDTP_SetRangeEx|GUICtrlDTP_SetSystemTime|GUICtrlDTP_SetSystemTimeEx|GUICtrlEdit_AppendText|GUICtrlEdit_BeginUpdate|GUICtrlEdit_CanUndo|GUICtrlEdit_CharFromPos|GUICtrlEdit_Create|GUICtrlEdit_Destroy|GUICtrlEdit_EmptyUndoBuffer|GUICtrlEdit_EndUpdate|GUICtrlEdit_Find|GUICtrlEdit_FmtLines|GUICtrlEdit_GetFirstVisibleLine|GUICtrlEdit_GetLimitText|GUICtrlEdit_GetLine|GUICtrlEdit_GetLineCount|GUICtrlEdit_GetMargins|GUICtrlEdit_GetModify|GUICtrlEdit_GetPasswordChar|GUICtrlEdit_GetRECT|GUICtrlEdit_GetRECTEx|GUICtrlEdit_GetSel|GUICtrlEdit_GetText|GUICtrlEdit_GetTextLen|GUICtrlEdit_HideBalloonTip|GUICtrlEdit_InsertText|GUICtrlEdit_LineFromChar|GUICtrlEdit_LineIndex|GUICtrlEdit_LineLength|GUICtrlEdit_LineScroll|GUICtrlEdit_PosFromChar|GUICtrlEdit_ReplaceSel|GUICtrlEdit_Scroll|GUICtrlEdit_SetLimitText|GUICtrlEdit_SetMargins|GUICtrlEdit_SetModify|GUICtrlEdit_SetPasswordChar|GUICtrlEdit_SetReadOnly|GUICtrlEdit_SetRECT|GUICtrlEdit_SetRECTEx|GUICtrlEdit_SetRECTNP|GUICtrlEdit_SetRectNPEx|GUICtrlEdit_SetSel|GUICtrlEdit_SetTabStops|GUICtrlEdit_SetText|GUICtrlEdit_ShowBalloonTip|GUICtrlEdit_Undo|GUICtrlHeader_AddItem|GUICtrlHeader_ClearFilter|GUICtrlHeader_ClearFilterAll|GUICtrlHeader_Create|GUICtrlHeader_CreateDragImage|GUICtrlHeader_DeleteItem|GUICtrlHeader_Destroy|GUICtrlHeader_EditFilter|GUICtrlHeader_GetBitmapMargin|GUICtrlHeader_GetImageList|GUICtrlHeader_GetItem|GUICtrlHeader_GetItemAlign|GUICtrlHeader_GetItemBitmap|GUICtrlHeader_GetItemCount|GUICtrlHeader_GetItemDisplay|GUICtrlHeader_GetItemFlags|GUICtrlHeader_GetItemFormat|GUICtrlHeader_GetItemImage|GUICtrlHeader_GetItemOrder|GUICtrlHeader_GetItemParam|GUICtrlHeader_GetItemRect|GUICtrlHeader_GetItemRectEx|GUICtrlHeader_GetItemText|GUICtrlHeader_GetItemWidth|GUICtrlHeader_GetOrderArray|GUICtrlHeader_GetUnicodeFormat|GUICtrlHeader_HitTest|GUICtrlHeader_InsertItem|GUICtrlHeader_Layout|GUICtrlHeader_OrderToIndex|GUICtrlHeader_SetBitmapMargin|GUICtrlHeader_SetFilterChangeTimeout|GUICtrlHeader_SetHotDivider|GUICtrlHeader_SetImageList|GUICtrlHeader_SetItem|GUICtrlHeader_SetItemAlign|GUICtrlHeader_SetItemBitmap|GUICtrlHeader_SetItemDisplay|GUICtrlHeader_SetItemFlags|GUICtrlHeader_SetItemFormat|GUICtrlHeader_SetItemImage|GUICtrlHeader_SetItemOrder|GUICtrlHeader_SetItemParam|GUICtrlHeader_SetItemText|GUICtrlHeader_SetItemWidth|GUICtrlHeader_SetOrderArray|GUICtrlHeader_SetUnicodeFormat|GUICtrlIpAddress_ClearAddress|GUICtrlIpAddress_Create|GUICtrlIpAddress_Destroy|GUICtrlIpAddress_Get|GUICtrlIpAddress_GetArray|GUICtrlIpAddress_GetEx|GUICtrlIpAddress_IsBlank|GUICtrlIpAddress_Set|GUICtrlIpAddress_SetArray|GUICtrlIpAddress_SetEx|GUICtrlIpAddress_SetFocus|GUICtrlIpAddress_SetFont|GUICtrlIpAddress_SetRange|GUICtrlIpAddress_ShowHide|GUICtrlListBox_AddFile|GUICtrlListBox_AddString|GUICtrlListBox_BeginUpdate|GUICtrlListBox_Create|GUICtrlListBox_DeleteString|GUICtrlListBox_Destroy|GUICtrlListBox_Dir|GUICtrlListBox_EndUpdate|GUICtrlListBox_FindInText|GUICtrlListBox_FindString|GUICtrlListBox_GetAnchorIndex|GUICtrlListBox_GetCaretIndex|GUICtrlListBox_GetCount|GUICtrlListBox_GetCurSel|GUICtrlListBox_GetHorizontalExtent|GUICtrlListBox_GetItemData|GUICtrlListBox_GetItemHeight|GUICtrlListBox_GetItemRect|GUICtrlListBox_GetItemRectEx|GUICtrlListBox_GetListBoxInfo|GUICtrlListBox_GetLocale|GUICtrlListBox_GetLocaleCountry|GUICtrlListBox_GetLocaleLang|GUICtrlListBox_GetLocalePrimLang|GUICtrlListBox_GetLocaleSubLang|GUICtrlListBox_GetSel|GUICtrlListBox_GetSelCount|GUICtrlListBox_GetSelItems|GUICtrlListBox_GetSelItemsText|GUICtrlListBox_GetText|GUICtrlListBox_GetTextLen|GUICtrlListBox_GetTopIndex|GUICtrlListBox_InitStorage|GUICtrlListBox_InsertString|GUICtrlListBox_ItemFromPoint|GUICtrlListBox_ReplaceString|GUICtrlListBox_ResetContent|GUICtrlListBox_SelectString|GUICtrlListBox_SelItemRange|GUICtrlListBox_SelItemRangeEx|GUICtrlListBox_SetAnchorIndex|GUICtrlListBox_SetCaretIndex|GUICtrlListBox_SetColumnWidth|GUICtrlListBox_SetCurSel|GUICtrlListBox_SetHorizontalExtent|GUICtrlListBox_SetItemData|GUICtrlListBox_SetItemHeight|GUICtrlListBox_SetLocale|GUICtrlListBox_SetSel|GUICtrlListBox_SetTabStops|GUICtrlListBox_SetTopIndex|GUICtrlListBox_Sort|GUICtrlListBox_SwapString|GUICtrlListBox_UpdateHScroll|GUICtrlListView_AddArray|GUICtrlListView_AddColumn|GUICtrlListView_AddItem|GUICtrlListView_AddSubItem|GUICtrlListView_ApproximateViewHeight|GUICtrlListView_ApproximateViewRect|GUICtrlListView_ApproximateViewWidth|GUICtrlListView_Arrange|GUICtrlListView_BeginUpdate|GUICtrlListView_CancelEditLabel|GUICtrlListView_ClickItem|GUICtrlListView_CopyItems|GUICtrlListView_Create|GUICtrlListView_CreateDragImage|GUICtrlListView_CreateSolidBitMap|GUICtrlListView_DeleteAllItems|GUICtrlListView_DeleteColumn|GUICtrlListView_DeleteItem|GUICtrlListView_DeleteItemsSelected|GUICtrlListView_Destroy|GUICtrlListView_DrawDragImage|GUICtrlListView_EditLabel|GUICtrlListView_EnableGroupView|GUICtrlListView_EndUpdate|GUICtrlListView_EnsureVisible|GUICtrlListView_FindInText|GUICtrlListView_FindItem|GUICtrlListView_FindNearest|GUICtrlListView_FindParam|GUICtrlListView_FindText|GUICtrlListView_GetBkColor|GUICtrlListView_GetBkImage|GUICtrlListView_GetCallbackMask|GUICtrlListView_GetColumn|GUICtrlListView_GetColumnCount|GUICtrlListView_GetColumnOrder|GUICtrlListView_GetColumnOrderArray|GUICtrlListView_GetColumnWidth|GUICtrlListView_GetCounterPage|GUICtrlListView_GetEditControl|GUICtrlListView_GetExtendedListViewStyle|GUICtrlListView_GetGroupInfo|GUICtrlListView_GetGroupViewEnabled|GUICtrlListView_GetHeader|GUICtrlListView_GetHotCursor|GUICtrlListView_GetHotItem|GUICtrlListView_GetHoverTime|GUICtrlListView_GetImageList|GUICtrlListView_GetISearchString|GUICtrlListView_GetItem|GUICtrlListView_GetItemChecked|GUICtrlListView_GetItemCount|GUICtrlListView_GetItemCut|GUICtrlListView_GetItemDropHilited|GUICtrlListView_GetItemEx|GUICtrlListView_GetItemFocused|GUICtrlListView_GetItemGroupID|GUICtrlListView_GetItemImage|GUICtrlListView_GetItemIndent|GUICtrlListView_GetItemParam|GUICtrlListView_GetItemPosition|GUICtrlListView_GetItemPositionX|GUICtrlListView_GetItemPositionY|GUICtrlListView_GetItemRect|GUICtrlListView_GetItemRectEx|GUICtrlListView_GetItemSelected|GUICtrlListView_GetItemSpacing|GUICtrlListView_GetItemSpacingX|GUICtrlListView_GetItemSpacingY|GUICtrlListView_GetItemState|GUICtrlListView_GetItemStateImage|GUICtrlListView_GetItemText|GUICtrlListView_GetItemTextArray|GUICtrlListView_GetItemTextString|GUICtrlListView_GetNextItem|GUICtrlListView_GetNumberOfWorkAreas|GUICtrlListView_GetOrigin|GUICtrlListView_GetOriginX|GUICtrlListView_GetOriginY|GUICtrlListView_GetOutlineColor|GUICtrlListView_GetSelectedColumn|GUICtrlListView_GetSelectedCount|GUICtrlListView_GetSelectedIndices|GUICtrlListView_GetSelectionMark|GUICtrlListView_GetStringWidth|GUICtrlListView_GetSubItemRect|GUICtrlListView_GetTextBkColor|GUICtrlListView_GetTextColor|GUICtrlListView_GetToolTips|GUICtrlListView_GetTopIndex|GUICtrlListView_GetUnicodeFormat|GUICtrlListView_GetView|GUICtrlListView_GetViewDetails|GUICtrlListView_GetViewLarge|GUICtrlListView_GetViewList|GUICtrlListView_GetViewRect|GUICtrlListView_GetViewSmall|GUICtrlListView_GetViewTile|GUICtrlListView_HideColumn|GUICtrlListView_HitTest|GUICtrlListView_InsertColumn|GUICtrlListView_InsertGroup|GUICtrlListView_InsertItem|GUICtrlListView_JustifyColumn|GUICtrlListView_MapIDToIndex|GUICtrlListView_MapIndexToID|GUICtrlListView_RedrawItems|GUICtrlListView_RegisterSortCallBack|GUICtrlListView_RemoveAllGroups|GUICtrlListView_RemoveGroup|GUICtrlListView_Scroll|GUICtrlListView_SetBkColor|GUICtrlListView_SetBkImage|GUICtrlListView_SetCallBackMask|GUICtrlListView_SetColumn|GUICtrlListView_SetColumnOrder|GUICtrlListView_SetColumnOrderArray|GUICtrlListView_SetColumnWidth|GUICtrlListView_SetExtendedListViewStyle|GUICtrlListView_SetGroupInfo|GUICtrlListView_SetHotItem|GUICtrlListView_SetHoverTime|GUICtrlListView_SetIconSpacing|GUICtrlListView_SetImageList|GUICtrlListView_SetItem|GUICtrlListView_SetItemChecked|GUICtrlListView_SetItemCount|GUICtrlListView_SetItemCut|GUICtrlListView_SetItemDropHilited|GUICtrlListView_SetItemEx|GUICtrlListView_SetItemFocused|GUICtrlListView_SetItemGroupID|GUICtrlListView_SetItemImage|GUICtrlListView_SetItemIndent|GUICtrlListView_SetItemParam|GUICtrlListView_SetItemPosition|GUICtrlListView_SetItemPosition32|GUICtrlListView_SetItemSelected|GUICtrlListView_SetItemState|GUICtrlListView_SetItemStateImage|GUICtrlListView_SetItemText|GUICtrlListView_SetOutlineColor|GUICtrlListView_SetSelectedColumn|GUICtrlListView_SetSelectionMark|GUICtrlListView_SetTextBkColor|GUICtrlListView_SetTextColor|GUICtrlListView_SetToolTips|GUICtrlListView_SetUnicodeFormat|GUICtrlListView_SetView|GUICtrlListView_SetWorkAreas|GUICtrlListView_SimpleSort|GUICtrlListView_SortItems|GUICtrlListView_SubItemHitTest|GUICtrlListView_UnRegisterSortCallBack|GUICtrlMenu_AddMenuItem|GUICtrlMenu_AppendMenu|GUICtrlMenu_CheckMenuItem|GUICtrlMenu_CheckRadioItem|GUICtrlMenu_CreateMenu|GUICtrlMenu_CreatePopup|GUICtrlMenu_DeleteMenu|GUICtrlMenu_DestroyMenu|GUICtrlMenu_DrawMenuBar|GUICtrlMenu_EnableMenuItem|GUICtrlMenu_FindItem|GUICtrlMenu_FindParent|GUICtrlMenu_GetItemBmp|GUICtrlMenu_GetItemBmpChecked|GUICtrlMenu_GetItemBmpUnchecked|GUICtrlMenu_GetItemChecked|GUICtrlMenu_GetItemCount|GUICtrlMenu_GetItemData|GUICtrlMenu_GetItemDefault|GUICtrlMenu_GetItemDisabled|GUICtrlMenu_GetItemEnabled|GUICtrlMenu_GetItemGrayed|GUICtrlMenu_GetItemHighlighted|GUICtrlMenu_GetItemID|GUICtrlMenu_GetItemInfo|GUICtrlMenu_GetItemRect|GUICtrlMenu_GetItemRectEx|GUICtrlMenu_GetItemState|GUICtrlMenu_GetItemStateEx|GUICtrlMenu_GetItemSubMenu|GUICtrlMenu_GetItemText|GUICtrlMenu_GetItemType|GUICtrlMenu_GetMenu|GUICtrlMenu_GetMenuBackground|GUICtrlMenu_GetMenuBarInfo|GUICtrlMenu_GetMenuContextHelpID|GUICtrlMenu_GetMenuData|GUICtrlMenu_GetMenuDefaultItem|GUICtrlMenu_GetMenuHeight|GUICtrlMenu_GetMenuInfo|GUICtrlMenu_GetMenuStyle|GUICtrlMenu_GetSystemMenu|GUICtrlMenu_InsertMenuItem|GUICtrlMenu_InsertMenuItemEx|GUICtrlMenu_IsMenu|GUICtrlMenu_LoadMenu|GUICtrlMenu_MapAccelerator|GUICtrlMenu_MenuItemFromPoint|GUICtrlMenu_RemoveMenu|GUICtrlMenu_SetItemBitmaps|GUICtrlMenu_SetItemBmp|GUICtrlMenu_SetItemBmpChecked|GUICtrlMenu_SetItemBmpUnchecked|GUICtrlMenu_SetItemChecked|GUICtrlMenu_SetItemData|GUICtrlMenu_SetItemDefault|GUICtrlMenu_SetItemDisabled|GUICtrlMenu_SetItemEnabled|GUICtrlMenu_SetItemGrayed|GUICtrlMenu_SetItemHighlighted|GUICtrlMenu_SetItemID|GUICtrlMenu_SetItemInfo|GUICtrlMenu_SetItemState|GUICtrlMenu_SetItemSubMenu|GUICtrlMenu_SetItemText|GUICtrlMenu_SetItemType|GUICtrlMenu_SetMenu|GUICtrlMenu_SetMenuBackground|GUICtrlMenu_SetMenuContextHelpID|GUICtrlMenu_SetMenuData|GUICtrlMenu_SetMenuDefaultItem|GUICtrlMenu_SetMenuHeight|GUICtrlMenu_SetMenuInfo|GUICtrlMenu_SetMenuStyle|GUICtrlMenu_TrackPopupMenu|GUICtrlMonthCal_Create|GUICtrlMonthCal_Destroy|GUICtrlMonthCal_GetColor|GUICtrlMonthCal_GetColorArray|GUICtrlMonthCal_GetCurSel|GUICtrlMonthCal_GetCurSelStr|GUICtrlMonthCal_GetFirstDOW|GUICtrlMonthCal_GetFirstDOWStr|GUICtrlMonthCal_GetMaxSelCount|GUICtrlMonthCal_GetMaxTodayWidth|GUICtrlMonthCal_GetMinReqHeight|GUICtrlMonthCal_GetMinReqRect|GUICtrlMonthCal_GetMinReqRectArray|GUICtrlMonthCal_GetMinReqWidth|GUICtrlMonthCal_GetMonthDelta|GUICtrlMonthCal_GetMonthRange|GUICtrlMonthCal_GetMonthRangeMax|GUICtrlMonthCal_GetMonthRangeMaxStr|GUICtrlMonthCal_GetMonthRangeMin|GUICtrlMonthCal_GetMonthRangeMinStr|GUICtrlMonthCal_GetMonthRangeSpan|GUICtrlMonthCal_GetRange|GUICtrlMonthCal_GetRangeMax|GUICtrlMonthCal_GetRangeMaxStr|GUICtrlMonthCal_GetRangeMin|GUICtrlMonthCal_GetRangeMinStr|GUICtrlMonthCal_GetSelRange|GUICtrlMonthCal_GetSelRangeMax|GUICtrlMonthCal_GetSelRangeMaxStr|GUICtrlMonthCal_GetSelRangeMin|GUICtrlMonthCal_GetSelRangeMinStr|GUICtrlMonthCal_GetToday|GUICtrlMonthCal_GetTodayStr|GUICtrlMonthCal_GetUnicodeFormat|GUICtrlMonthCal_HitTest|GUICtrlMonthCal_SetColor|GUICtrlMonthCal_SetCurSel|GUICtrlMonthCal_SetDayState|GUICtrlMonthCal_SetFirstDOW|GUICtrlMonthCal_SetMaxSelCount|GUICtrlMonthCal_SetMonthDelta|GUICtrlMonthCal_SetRange|GUICtrlMonthCal_SetSelRange|GUICtrlMonthCal_SetToday|GUICtrlMonthCal_SetUnicodeFormat|GUICtrlRebar_AddBand|GUICtrlRebar_AddToolBarBand|GUICtrlRebar_BeginDrag|GUICtrlRebar_Create|GUICtrlRebar_DeleteBand|GUICtrlRebar_Destroy|GUICtrlRebar_DragMove|GUICtrlRebar_EndDrag|GUICtrlRebar_GetBandBackColor|GUICtrlRebar_GetBandBorders|GUICtrlRebar_GetBandBordersEx|GUICtrlRebar_GetBandChildHandle|GUICtrlRebar_GetBandChildSize|GUICtrlRebar_GetBandCount|GUICtrlRebar_GetBandForeColor|GUICtrlRebar_GetBandHeaderSize|GUICtrlRebar_GetBandID|GUICtrlRebar_GetBandIdealSize|GUICtrlRebar_GetBandLength|GUICtrlRebar_GetBandLParam|GUICtrlRebar_GetBandMargins|GUICtrlRebar_GetBandMarginsEx|GUICtrlRebar_GetBandRect|GUICtrlRebar_GetBandRectEx|GUICtrlRebar_GetBandStyle|GUICtrlRebar_GetBandStyleBreak|GUICtrlRebar_GetBandStyleChildEdge|GUICtrlRebar_GetBandStyleFixedBMP|GUICtrlRebar_GetBandStyleFixedSize|GUICtrlRebar_GetBandStyleGripperAlways|GUICtrlRebar_GetBandStyleHidden|GUICtrlRebar_GetBandStyleHideTitle|GUICtrlRebar_GetBandStyleNoGripper|GUICtrlRebar_GetBandStyleTopAlign|GUICtrlRebar_GetBandStyleUseChevron|GUICtrlRebar_GetBandStyleVariableHeight|GUICtrlRebar_GetBandText|GUICtrlRebar_GetBarHeight|GUICtrlRebar_GetBKColor|GUICtrlRebar_GetColorScheme|GUICtrlRebar_GetRowCount|GUICtrlRebar_GetRowHeight|GUICtrlRebar_GetTextColor|GUICtrlRebar_GetToolTips|GUICtrlRebar_GetUnicodeFormat|GUICtrlRebar_HitTest|GUICtrlRebar_IDToIndex|GUICtrlRebar_MaximizeBand|GUICtrlRebar_MinimizeBand|GUICtrlRebar_MoveBand|GUICtrlRebar_SetBandBackColor|GUICtrlRebar_SetBandForeColor|GUICtrlRebar_SetBandHeaderSize|GUICtrlRebar_SetBandID|GUICtrlRebar_SetBandIdealSize|GUICtrlRebar_SetBandLength|GUICtrlRebar_SetBandLParam|GUICtrlRebar_SetBandStyle|GUICtrlRebar_SetBandStyleBreak|GUICtrlRebar_SetBandStyleChildEdge|GUICtrlRebar_SetBandStyleFixedBMP|GUICtrlRebar_SetBandStyleFixedSize|GUICtrlRebar_SetBandStyleGripperAlways|GUICtrlRebar_SetBandStyleHidden|GUICtrlRebar_SetBandStyleHideTitle|GUICtrlRebar_SetBandStyleNoGripper|GUICtrlRebar_SetBandStyleTopAlign|GUICtrlRebar_SetBandStyleUseChevron|GUICtrlRebar_SetBandStyleVariableHeight|GUICtrlRebar_SetBandText|GUICtrlRebar_SetBKColor|GUICtrlRebar_SetColorScheme|GUICtrlRebar_SetTextColor|GUICtrlRebar_SetToolTips|GUICtrlRebar_SetUnicodeFormat|GUICtrlRebar_ShowBand|GUICtrlSlider_ClearSel|GUICtrlSlider_ClearTics|GUICtrlSlider_Create|GUICtrlSlider_Destroy|GUICtrlSlider_GetBuddy|GUICtrlSlider_GetChannelRect|GUICtrlSlider_GetLineSize|GUICtrlSlider_GetNumTics|GUICtrlSlider_GetPageSize|GUICtrlSlider_GetPos|GUICtrlSlider_GetPTics|GUICtrlSlider_GetRange|GUICtrlSlider_GetRangeMax|GUICtrlSlider_GetRangeMin|GUICtrlSlider_GetSel|GUICtrlSlider_GetSelEnd|GUICtrlSlider_GetSelStart|GUICtrlSlider_GetThumbLength|GUICtrlSlider_GetThumbRect|GUICtrlSlider_GetThumbRectEx|GUICtrlSlider_GetTic|GUICtrlSlider_GetTicPos|GUICtrlSlider_GetToolTips|GUICtrlSlider_GetUnicodeFormat|GUICtrlSlider_SetBuddy|GUICtrlSlider_SetLineSize|GUICtrlSlider_SetPageSize|GUICtrlSlider_SetPos|GUICtrlSlider_SetRange|GUICtrlSlider_SetRangeMax|GUICtrlSlider_SetRangeMin|GUICtrlSlider_SetSel|GUICtrlSlider_SetSelEnd|GUICtrlSlider_SetSelStart|GUICtrlSlider_SetThumbLength|GUICtrlSlider_SetTic|GUICtrlSlider_SetTicFreq|GUICtrlSlider_SetTipSide|GUICtrlSlider_SetToolTips|GUICtrlSlider_SetUnicodeFormat|GUICtrlStatusBar_Create|GUICtrlStatusBar_Destroy|GUICtrlStatusBar_EmbedControl|GUICtrlStatusBar_GetBorders|GUICtrlStatusBar_GetBordersHorz|GUICtrlStatusBar_GetBordersRect|GUICtrlStatusBar_GetBordersVert|GUICtrlStatusBar_GetCount|GUICtrlStatusBar_GetHeight|GUICtrlStatusBar_GetIcon|GUICtrlStatusBar_GetParts|GUICtrlStatusBar_GetRect|GUICtrlStatusBar_GetRectEx|GUICtrlStatusBar_GetText|GUICtrlStatusBar_GetTextFlags|GUICtrlStatusBar_GetTextLength|GUICtrlStatusBar_GetTextLengthEx|GUICtrlStatusBar_GetTipText|GUICtrlStatusBar_GetUnicodeFormat|GUICtrlStatusBar_GetWidth|GUICtrlStatusBar_IsSimple|GUICtrlStatusBar_Resize|GUICtrlStatusBar_SetBkColor|GUICtrlStatusBar_SetIcon|GUICtrlStatusBar_SetMinHeight|GUICtrlStatusBar_SetParts|GUICtrlStatusBar_SetSimple|GUICtrlStatusBar_SetText|GUICtrlStatusBar_SetTipText|GUICtrlStatusBar_SetUnicodeFormat|GUICtrlStatusBar_ShowHide|GUICtrlTab_Create|GUICtrlTab_DeleteAllItems|GUICtrlTab_DeleteItem|GUICtrlTab_DeselectAll|GUICtrlTab_Destroy|GUICtrlTab_FindTab|GUICtrlTab_GetCurFocus|GUICtrlTab_GetCurSel|GUICtrlTab_GetDisplayRect|GUICtrlTab_GetDisplayRectEx|GUICtrlTab_GetExtendedStyle|GUICtrlTab_GetImageList|GUICtrlTab_GetItem|GUICtrlTab_GetItemCount|GUICtrlTab_GetItemImage|GUICtrlTab_GetItemParam|GUICtrlTab_GetItemRect|GUICtrlTab_GetItemRectEx|GUICtrlTab_GetItemState|GUICtrlTab_GetItemText|GUICtrlTab_GetRowCount|GUICtrlTab_GetToolTips|GUICtrlTab_GetUnicodeFormat|GUICtrlTab_HighlightItem|GUICtrlTab_HitTest|GUICtrlTab_InsertItem|GUICtrlTab_RemoveImage|GUICtrlTab_SetCurFocus|GUICtrlTab_SetCurSel|GUICtrlTab_SetExtendedStyle|GUICtrlTab_SetImageList|GUICtrlTab_SetItem|GUICtrlTab_SetItemImage|GUICtrlTab_SetItemParam|GUICtrlTab_SetItemSize|GUICtrlTab_SetItemState|GUICtrlTab_SetItemText|GUICtrlTab_SetMinTabWidth|GUICtrlTab_SetPadding|GUICtrlTab_SetToolTips|GUICtrlTab_SetUnicodeFormat|GUICtrlToolbar_AddBitmap|GUICtrlToolbar_AddButton|GUICtrlToolbar_AddButtonSep|GUICtrlToolbar_AddString|GUICtrlToolbar_ButtonCount|GUICtrlToolbar_CheckButton|GUICtrlToolbar_ClickAccel|GUICtrlToolbar_ClickButton|GUICtrlToolbar_ClickIndex|GUICtrlToolbar_CommandToIndex|GUICtrlToolbar_Create|GUICtrlToolbar_Customize|GUICtrlToolbar_DeleteButton|GUICtrlToolbar_Destroy|GUICtrlToolbar_EnableButton|GUICtrlToolbar_FindToolbar|GUICtrlToolbar_GetAnchorHighlight|GUICtrlToolbar_GetBitmapFlags|GUICtrlToolbar_GetButtonBitmap|GUICtrlToolbar_GetButtonInfo|GUICtrlToolbar_GetButtonInfoEx|GUICtrlToolbar_GetButtonParam|GUICtrlToolbar_GetButtonRect|GUICtrlToolbar_GetButtonRectEx|GUICtrlToolbar_GetButtonSize|GUICtrlToolbar_GetButtonState|GUICtrlToolbar_GetButtonStyle|GUICtrlToolbar_GetButtonText|GUICtrlToolbar_GetColorScheme|GUICtrlToolbar_GetDisabledImageList|GUICtrlToolbar_GetExtendedStyle|GUICtrlToolbar_GetHotImageList|GUICtrlToolbar_GetHotItem|GUICtrlToolbar_GetImageList|GUICtrlToolbar_GetInsertMark|GUICtrlToolbar_GetInsertMarkColor|GUICtrlToolbar_GetMaxSize|GUICtrlToolbar_GetMetrics|GUICtrlToolbar_GetPadding|GUICtrlToolbar_GetRows|GUICtrlToolbar_GetString|GUICtrlToolbar_GetStyle|GUICtrlToolbar_GetStyleAltDrag|GUICtrlToolbar_GetStyleCustomErase|GUICtrlToolbar_GetStyleFlat|GUICtrlToolbar_GetStyleList|GUICtrlToolbar_GetStyleRegisterDrop|GUICtrlToolbar_GetStyleToolTips|GUICtrlToolbar_GetStyleTransparent|GUICtrlToolbar_GetStyleWrapable|GUICtrlToolbar_GetTextRows|GUICtrlToolbar_GetToolTips|GUICtrlToolbar_GetUnicodeFormat|GUICtrlToolbar_HideButton|GUICtrlToolbar_HighlightButton|GUICtrlToolbar_HitTest|GUICtrlToolbar_IndexToCommand|GUICtrlToolbar_InsertButton|GUICtrlToolbar_InsertMarkHitTest|GUICtrlToolbar_IsButtonChecked|GUICtrlToolbar_IsButtonEnabled|GUICtrlToolbar_IsButtonHidden|GUICtrlToolbar_IsButtonHighlighted|GUICtrlToolbar_IsButtonIndeterminate|GUICtrlToolbar_IsButtonPressed|GUICtrlToolbar_LoadBitmap|GUICtrlToolbar_LoadImages|GUICtrlToolbar_MapAccelerator|GUICtrlToolbar_MoveButton|GUICtrlToolbar_PressButton|GUICtrlToolbar_SetAnchorHighlight|GUICtrlToolbar_SetBitmapSize|GUICtrlToolbar_SetButtonBitMap|GUICtrlToolbar_SetButtonInfo|GUICtrlToolbar_SetButtonInfoEx|GUICtrlToolbar_SetButtonParam|GUICtrlToolbar_SetButtonSize|GUICtrlToolbar_SetButtonState|GUICtrlToolbar_SetButtonStyle|GUICtrlToolbar_SetButtonText|GUICtrlToolbar_SetButtonWidth|GUICtrlToolbar_SetCmdID|GUICtrlToolbar_SetColorScheme|GUICtrlToolbar_SetDisabledImageList|GUICtrlToolbar_SetDrawTextFlags|GUICtrlToolbar_SetExtendedStyle|GUICtrlToolbar_SetHotImageList|GUICtrlToolbar_SetHotItem|GUICtrlToolbar_SetImageList|GUICtrlToolbar_SetIndent|GUICtrlToolbar_SetIndeterminate|GUICtrlToolbar_SetInsertMark|GUICtrlToolbar_SetInsertMarkColor|GUICtrlToolbar_SetMaxTextRows|GUICtrlToolbar_SetMetrics|GUICtrlToolbar_SetPadding|GUICtrlToolbar_SetParent|GUICtrlToolbar_SetRows|GUICtrlToolbar_SetStyle|GUICtrlToolbar_SetStyleAltDrag|GUICtrlToolbar_SetStyleCustomErase|GUICtrlToolbar_SetStyleFlat|GUICtrlToolbar_SetStyleList|GUICtrlToolbar_SetStyleRegisterDrop|GUICtrlToolbar_SetStyleToolTips|GUICtrlToolbar_SetStyleTransparent|GUICtrlToolbar_SetStyleWrapable|GUICtrlToolbar_SetToolTips|GUICtrlToolbar_SetUnicodeFormat|GUICtrlToolbar_SetWindowTheme|GUICtrlTreeView_Add|GUICtrlTreeView_AddChild|GUICtrlTreeView_AddChildFirst|GUICtrlTreeView_AddFirst|GUICtrlTreeView_BeginUpdate|GUICtrlTreeView_ClickItem|GUICtrlTreeView_Create|GUICtrlTreeView_CreateDragImage|GUICtrlTreeView_CreateSolidBitMap|GUICtrlTreeView_Delete|GUICtrlTreeView_DeleteAll|GUICtrlTreeView_DeleteChildren|GUICtrlTreeView_Destroy|GUICtrlTreeView_DisplayRect|GUICtrlTreeView_DisplayRectEx|GUICtrlTreeView_EditText|GUICtrlTreeView_EndEdit|GUICtrlTreeView_EndUpdate|GUICtrlTreeView_EnsureVisible|GUICtrlTreeView_Expand|GUICtrlTreeView_ExpandedOnce|GUICtrlTreeView_FindItem|GUICtrlTreeView_FindItemEx|GUICtrlTreeView_GetBkColor|GUICtrlTreeView_GetBold|GUICtrlTreeView_GetChecked|GUICtrlTreeView_GetChildCount|GUICtrlTreeView_GetChildren|GUICtrlTreeView_GetCount|GUICtrlTreeView_GetCut|GUICtrlTreeView_GetDropTarget|GUICtrlTreeView_GetEditControl|GUICtrlTreeView_GetExpanded|GUICtrlTreeView_GetFirstChild|GUICtrlTreeView_GetFirstItem|GUICtrlTreeView_GetFirstVisible|GUICtrlTreeView_GetFocused|GUICtrlTreeView_GetHeight|GUICtrlTreeView_GetImageIndex|GUICtrlTreeView_GetImageListIconHandle|GUICtrlTreeView_GetIndent|GUICtrlTreeView_GetInsertMarkColor|GUICtrlTreeView_GetISearchString|GUICtrlTreeView_GetItemByIndex|GUICtrlTreeView_GetItemHandle|GUICtrlTreeView_GetItemParam|GUICtrlTreeView_GetLastChild|GUICtrlTreeView_GetLineColor|GUICtrlTreeView_GetNext|GUICtrlTreeView_GetNextChild|GUICtrlTreeView_GetNextSibling|GUICtrlTreeView_GetNextVisible|GUICtrlTreeView_GetNormalImageList|GUICtrlTreeView_GetParentHandle|GUICtrlTreeView_GetParentParam|GUICtrlTreeView_GetPrev|GUICtrlTreeView_GetPrevChild|GUICtrlTreeView_GetPrevSibling|GUICtrlTreeView_GetPrevVisible|GUICtrlTreeView_GetScrollTime|GUICtrlTreeView_GetSelected|GUICtrlTreeView_GetSelectedImageIndex|GUICtrlTreeView_GetSelection|GUICtrlTreeView_GetSiblingCount|GUICtrlTreeView_GetState|GUICtrlTreeView_GetStateImageIndex|GUICtrlTreeView_GetStateImageList|GUICtrlTreeView_GetText|GUICtrlTreeView_GetTextColor|GUICtrlTreeView_GetToolTips|GUICtrlTreeView_GetTree|GUICtrlTreeView_GetUnicodeFormat|GUICtrlTreeView_GetVisible|GUICtrlTreeView_GetVisibleCount|GUICtrlTreeView_HitTest|GUICtrlTreeView_HitTestEx|GUICtrlTreeView_HitTestItem|GUICtrlTreeView_Index|GUICtrlTreeView_InsertItem|GUICtrlTreeView_IsFirstItem|GUICtrlTreeView_IsParent|GUICtrlTreeView_Level|GUICtrlTreeView_SelectItem|GUICtrlTreeView_SelectItemByIndex|GUICtrlTreeView_SetBkColor|GUICtrlTreeView_SetBold|GUICtrlTreeView_SetChecked|GUICtrlTreeView_SetCheckedByIndex|GUICtrlTreeView_SetChildren|GUICtrlTreeView_SetCut|GUICtrlTreeView_SetDropTarget|GUICtrlTreeView_SetFocused|GUICtrlTreeView_SetHeight|GUICtrlTreeView_SetIcon|GUICtrlTreeView_SetImageIndex|GUICtrlTreeView_SetIndent|GUICtrlTreeView_SetInsertMark|GUICtrlTreeView_SetInsertMarkColor|GUICtrlTreeView_SetItemHeight|GUICtrlTreeView_SetItemParam|GUICtrlTreeView_SetLineColor|GUICtrlTreeView_SetNormalImageList|GUICtrlTreeView_SetScrollTime|GUICtrlTreeView_SetSelected|GUICtrlTreeView_SetSelectedImageIndex|GUICtrlTreeView_SetState|GUICtrlTreeView_SetStateImageIndex|GUICtrlTreeView_SetStateImageList|GUICtrlTreeView_SetText|GUICtrlTreeView_SetTextColor|GUICtrlTreeView_SetToolTips|GUICtrlTreeView_SetUnicodeFormat|GUICtrlTreeView_Sort|GUIImageList_Add|GUIImageList_AddBitmap|GUIImageList_AddIcon|GUIImageList_AddMasked|GUIImageList_BeginDrag|GUIImageList_Copy|GUIImageList_Create|GUIImageList_Destroy|GUIImageList_DestroyIcon|GUIImageList_DragEnter|GUIImageList_DragLeave|GUIImageList_DragMove|GUIImageList_Draw|GUIImageList_DrawEx|GUIImageList_Duplicate|GUIImageList_EndDrag|GUIImageList_GetBkColor|GUIImageList_GetIcon|GUIImageList_GetIconHeight|GUIImageList_GetIconSize|GUIImageList_GetIconSizeEx|GUIImageList_GetIconWidth|GUIImageList_GetImageCount|GUIImageList_GetImageInfoEx|GUIImageList_Remove|GUIImageList_ReplaceIcon|GUIImageList_SetBkColor|GUIImageList_SetIconSize|GUIImageList_SetImageCount|GUIImageList_Swap|GUIScrollBars_EnableScrollBar|GUIScrollBars_GetScrollBarInfoEx|GUIScrollBars_GetScrollBarRect|GUIScrollBars_GetScrollBarRGState|GUIScrollBars_GetScrollBarXYLineButton|GUIScrollBars_GetScrollBarXYThumbBottom|GUIScrollBars_GetScrollBarXYThumbTop|GUIScrollBars_GetScrollInfo|GUIScrollBars_GetScrollInfoEx|GUIScrollBars_GetScrollInfoMax|GUIScrollBars_GetScrollInfoMin|GUIScrollBars_GetScrollInfoPage|GUIScrollBars_GetScrollInfoPos|GUIScrollBars_GetScrollInfoTrackPos|GUIScrollBars_GetScrollPos|GUIScrollBars_GetScrollRange|GUIScrollBars_Init|GUIScrollBars_ScrollWindow|GUIScrollBars_SetScrollInfo|GUIScrollBars_SetScrollInfoMax|GUIScrollBars_SetScrollInfoMin|GUIScrollBars_SetScrollInfoPage|GUIScrollBars_SetScrollInfoPos|GUIScrollBars_SetScrollRange|GUIScrollBars_ShowScrollBar|GUIToolTip_Activate|GUIToolTip_AddTool|GUIToolTip_AdjustRect|GUIToolTip_BitsToTTF|GUIToolTip_Create|GUIToolTip_DelTool|GUIToolTip_Destroy|GUIToolTip_EnumTools|GUIToolTip_GetBubbleHeight|GUIToolTip_GetBubbleSize|GUIToolTip_GetBubbleWidth|GUIToolTip_GetCurrentTool|GUIToolTip_GetDelayTime|GUIToolTip_GetMargin|GUIToolTip_GetMarginEx|GUIToolTip_GetMaxTipWidth|GUIToolTip_GetText|GUIToolTip_GetTipBkColor|GUIToolTip_GetTipTextColor|GUIToolTip_GetTitleBitMap|GUIToolTip_GetTitleText|GUIToolTip_GetToolCount|GUIToolTip_GetToolInfo|GUIToolTip_HitTest|GUIToolTip_NewToolRect|GUIToolTip_Pop|GUIToolTip_PopUp|GUIToolTip_SetDelayTime|GUIToolTip_SetMargin|GUIToolTip_SetMaxTipWidth|GUIToolTip_SetTipBkColor|GUIToolTip_SetTipTextColor|GUIToolTip_SetTitle|GUIToolTip_SetToolInfo|GUIToolTip_SetWindowTheme|GUIToolTip_ToolExists|GUIToolTip_ToolToArray|GUIToolTip_TrackActivate|GUIToolTip_TrackPosition|GUIToolTip_TTFToBits|GUIToolTip_Update|GUIToolTip_UpdateTipText|HexToString|IE_Example|IE_Introduction|IE_VersionInfo|IEAction|IEAttach|IEBodyReadHTML|IEBodyReadText|IEBodyWriteHTML|IECreate|IECreateEmbedded|IEDocGetObj|IEDocInsertHTML|IEDocInsertText|IEDocReadHTML|IEDocWriteHTML|IEErrorHandlerDeRegister|IEErrorHandlerRegister|IEErrorNotify|IEFormElementCheckBoxSelect|IEFormElementGetCollection|IEFormElementGetObjByName|IEFormElementGetValue|IEFormElementOptionSelect|IEFormElementRadioSelect|IEFormElementSetValue|IEFormGetCollection|IEFormGetObjByName|IEFormImageClick|IEFormReset|IEFormSubmit|IEFrameGetCollection|IEFrameGetObjByName|IEGetObjById|IEGetObjByName|IEHeadInsertEventScript|IEImgClick|IEImgGetCollection|IEIsFrameSet|IELinkClickByIndex|IELinkClickByText|IELinkGetCollection|IELoadWait|IELoadWaitTimeout|IENavigate|IEPropertyGet|IEPropertySet|IEQuit|IETableGetCollection|IETableWriteToArray|IETagNameAllGetCollection|IETagNameGetCollection|Iif|INetExplorerCapable|INetGetSource|INetMail|INetSmtpMail|IsPressed|MathCheckDiv|Max|MemGlobalAlloc|MemGlobalFree|MemGlobalLock|MemGlobalSize|MemGlobalUnlock|MemMoveMemory|MemMsgBox|MemShowError|MemVirtualAlloc|MemVirtualAllocEx|MemVirtualFree|MemVirtualFreeEx|Min|MouseTrap|NamedPipes_CallNamedPipe|NamedPipes_ConnectNamedPipe|NamedPipes_CreateNamedPipe|NamedPipes_CreatePipe|NamedPipes_DisconnectNamedPipe|NamedPipes_GetNamedPipeHandleState|NamedPipes_GetNamedPipeInfo|NamedPipes_PeekNamedPipe|NamedPipes_SetNamedPipeHandleState|NamedPipes_TransactNamedPipe|NamedPipes_WaitNamedPipe|Net_Share_ConnectionEnum|Net_Share_FileClose|Net_Share_FileEnum|Net_Share_FileGetInfo|Net_Share_PermStr|Net_Share_ResourceStr|Net_Share_SessionDel|Net_Share_SessionEnum|Net_Share_SessionGetInfo|Net_Share_ShareAdd|Net_Share_ShareCheck|Net_Share_ShareDel|Net_Share_ShareEnum|Net_Share_ShareGetInfo|Net_Share_ShareSetInfo|Net_Share_StatisticsGetSvr|Net_Share_StatisticsGetWrk|Now|NowCalc|NowCalcDate|NowDate|NowTime|PathFull|PathMake|PathSplit|ProcessGetName|ProcessGetPriority|Radian|ReplaceStringInFile|RunDOS|ScreenCapture_Capture|ScreenCapture_CaptureWnd|ScreenCapture_SaveImage|ScreenCapture_SetBMPFormat|ScreenCapture_SetJPGQuality|ScreenCapture_SetTIFColorDepth|ScreenCapture_SetTIFCompression|Security__AdjustTokenPrivileges|Security__GetAccountSid|Security__GetLengthSid|Security__GetTokenInformation|Security__ImpersonateSelf|Security__IsValidSid|Security__LookupAccountName|Security__LookupAccountSid|Security__LookupPrivilegeValue|Security__OpenProcessToken|Security__OpenThreadToken|Security__OpenThreadTokenEx|Security__SetPrivilege|Security__SidToStringSid|Security__SidTypeStr|Security__StringSidToSid|SendMessage|SendMessageA|SetDate|SetTime|Singleton|SoundClose|SoundLength|SoundOpen|SoundPause|SoundPlay|SoundPos|SoundResume|SoundSeek|SoundStatus|SoundStop|SQLite_Changes|SQLite_Close|SQLite_Display2DResult|SQLite_Encode|SQLite_ErrCode|SQLite_ErrMsg|SQLite_Escape|SQLite_Exec|SQLite_FetchData|SQLite_FetchNames|SQLite_GetTable|SQLite_GetTable2d|SQLite_LastInsertRowID|SQLite_LibVersion|SQLite_Open|SQLite_Query|SQLite_QueryFinalize|SQLite_QueryReset|SQLite_QuerySingleRow|SQLite_SaveMode|SQLite_SetTimeout|SQLite_Shutdown|SQLite_SQLiteExe|SQLite_Startup|SQLite_TotalChanges|StringAddComma|StringBetween|StringEncrypt|StringInsert|StringProper|StringRepeat|StringReverse|StringSplit|StringToHex|TCPIpToName|TempFile|TicksToTime|Timer_Diff|Timer_GetTimerID|Timer_Init|Timer_KillAllTimers|Timer_KillTimer|Timer_SetTimer|TimeToTicks|VersionCompare|viClose|viExecCommand|viFindGpib|viGpibBusReset|viGTL|viOpen|viSetAttribute|viSetTimeout|WeekNumberISO|WinAPI_AttachConsole|WinAPI_AttachThreadInput|WinAPI_Beep|WinAPI_BitBlt|WinAPI_CallNextHookEx|WinAPI_Check|WinAPI_ClientToScreen|WinAPI_CloseHandle|WinAPI_CommDlgExtendedError|WinAPI_CopyIcon|WinAPI_CreateBitmap|WinAPI_CreateCompatibleBitmap|WinAPI_CreateCompatibleDC|WinAPI_CreateEvent|WinAPI_CreateFile|WinAPI_CreateFont|WinAPI_CreateFontIndirect|WinAPI_CreateProcess|WinAPI_CreateSolidBitmap|WinAPI_CreateSolidBrush|WinAPI_CreateWindowEx|WinAPI_DefWindowProc|WinAPI_DeleteDC|WinAPI_DeleteObject|WinAPI_DestroyIcon|WinAPI_DestroyWindow|WinAPI_DrawEdge|WinAPI_DrawFrameControl|WinAPI_DrawIcon|WinAPI_DrawIconEx|WinAPI_DrawText|WinAPI_EnableWindow|WinAPI_EnumDisplayDevices|WinAPI_EnumWindows|WinAPI_EnumWindowsPopup|WinAPI_EnumWindowsTop|WinAPI_ExpandEnvironmentStrings|WinAPI_ExtractIconEx|WinAPI_FatalAppExit|WinAPI_FillRect|WinAPI_FindExecutable|WinAPI_FindWindow|WinAPI_FlashWindow|WinAPI_FlashWindowEx|WinAPI_FloatToInt|WinAPI_FlushFileBuffers|WinAPI_FormatMessage|WinAPI_FrameRect|WinAPI_FreeLibrary|WinAPI_GetAncestor|WinAPI_GetAsyncKeyState|WinAPI_GetClassName|WinAPI_GetClientHeight|WinAPI_GetClientRect|WinAPI_GetClientWidth|WinAPI_GetCurrentProcess|WinAPI_GetCurrentProcessID|WinAPI_GetCurrentThread|WinAPI_GetCurrentThreadId|WinAPI_GetCursorInfo|WinAPI_GetDC|WinAPI_GetDesktopWindow|WinAPI_GetDeviceCaps|WinAPI_GetDIBits|WinAPI_GetDlgCtrlID|WinAPI_GetDlgItem|WinAPI_GetFileSizeEx|WinAPI_GetFocus|WinAPI_GetForegroundWindow|WinAPI_GetIconInfo|WinAPI_GetLastError|WinAPI_GetLastErrorMessage|WinAPI_GetModuleHandle|WinAPI_GetMousePos|WinAPI_GetMousePosX|WinAPI_GetMousePosY|WinAPI_GetObject|WinAPI_GetOpenFileName|WinAPI_GetOverlappedResult|WinAPI_GetParent|WinAPI_GetProcessAffinityMask|WinAPI_GetSaveFileName|WinAPI_GetStdHandle|WinAPI_GetStockObject|WinAPI_GetSysColor|WinAPI_GetSysColorBrush|WinAPI_GetSystemMetrics|WinAPI_GetTextExtentPoint32|WinAPI_GetWindow|WinAPI_GetWindowDC|WinAPI_GetWindowHeight|WinAPI_GetWindowLong|WinAPI_GetWindowRect|WinAPI_GetWindowText|WinAPI_GetWindowThreadProcessId|WinAPI_GetWindowWidth|WinAPI_GetXYFromPoint|WinAPI_GlobalMemStatus|WinAPI_GUIDFromString|WinAPI_GUIDFromStringEx|WinAPI_HiWord|WinAPI_InProcess|WinAPI_IntToFloat|WinAPI_InvalidateRect|WinAPI_IsClassName|WinAPI_IsWindow|WinAPI_IsWindowVisible|WinAPI_LoadBitmap|WinAPI_LoadImage|WinAPI_LoadLibrary|WinAPI_LoadLibraryEx|WinAPI_LoadShell32Icon|WinAPI_LoadString|WinAPI_LocalFree|WinAPI_LoWord|WinAPI_MakeDWord|WinAPI_MAKELANGID|WinAPI_MAKELCID|WinAPI_MakeLong|WinAPI_MessageBeep|WinAPI_Mouse_Event|WinAPI_MoveWindow|WinAPI_MsgBox|WinAPI_MulDiv|WinAPI_MultiByteToWideChar|WinAPI_MultiByteToWideCharEx|WinAPI_OpenProcess|WinAPI_PointFromRect|WinAPI_PostMessage|WinAPI_PrimaryLangId|WinAPI_PtInRect|WinAPI_ReadFile|WinAPI_ReadProcessMemory|WinAPI_RectIsEmpty|WinAPI_RedrawWindow|WinAPI_RegisterWindowMessage|WinAPI_ReleaseCapture|WinAPI_ReleaseDC|WinAPI_ScreenToClient|WinAPI_SelectObject|WinAPI_SetBkColor|WinAPI_SetCapture|WinAPI_SetCursor|WinAPI_SetDefaultPrinter|WinAPI_SetDIBits|WinAPI_SetEvent|WinAPI_SetFocus|WinAPI_SetFont|WinAPI_SetHandleInformation|WinAPI_SetLastError|WinAPI_SetParent|WinAPI_SetProcessAffinityMask|WinAPI_SetSysColors|WinAPI_SetTextColor|WinAPI_SetWindowLong|WinAPI_SetWindowPos|WinAPI_SetWindowsHookEx|WinAPI_SetWindowText|WinAPI_ShowCursor|WinAPI_ShowError|WinAPI_ShowMsg|WinAPI_ShowWindow|WinAPI_StringFromGUID|WinAPI_SubLangId|WinAPI_SystemParametersInfo|WinAPI_TwipsPerPixelX|WinAPI_TwipsPerPixelY|WinAPI_UnhookWindowsHookEx|WinAPI_UpdateLayeredWindow|WinAPI_UpdateWindow|WinAPI_ValidateClassName|WinAPI_WaitForInputIdle|WinAPI_WaitForMultipleObjects|WinAPI_WaitForSingleObject|WinAPI_WideCharToMultiByte|WinAPI_WindowFromPoint|WinAPI_WriteConsole|WinAPI_WriteFile|WinAPI_WriteProcessMemory|WinNet_AddConnection|WinNet_AddConnection2|WinNet_AddConnection3|WinNet_CancelConnection|WinNet_CancelConnection2|WinNet_CloseEnum|WinNet_ConnectionDialog|WinNet_ConnectionDialog1|WinNet_DisconnectDialog|WinNet_DisconnectDialog1|WinNet_EnumResource|WinNet_GetConnection|WinNet_GetConnectionPerformance|WinNet_GetLastError|WinNet_GetNetworkInformation|WinNet_GetProviderName|WinNet_GetResourceInformation|WinNet_GetResourceParent|WinNet_GetUniversalName|WinNet_GetUser|WinNet_OpenEnum|WinNet_RestoreConnection|WinNet_UseConnection|Word_VersionInfo|WordAttach|WordCreate|WordDocAdd|WordDocAddLink|WordDocAddPicture|WordDocClose|WordDocFindReplace|WordDocGetCollection|WordDocLinkGetCollection|WordDocOpen|WordDocPrint|WordDocPropertyGet|WordDocPropertySet|WordDocSave|WordDocSaveAs|WordErrorHandlerDeRegister|WordErrorHandlerRegister|WordErrorNotify|WordMacroRun|WordPropertyGet|WordPropertySet|WordQuit|' + + 'ce|comments-end|comments-start|cs|include|include-once|NoTrayIcon|RequireAdmin|' + + 'AutoIt3Wrapper_Au3Check_Parameters|AutoIt3Wrapper_Au3Check_Stop_OnWarning|AutoIt3Wrapper_Change2CUI|AutoIt3Wrapper_Compression|AutoIt3Wrapper_cvsWrapper_Parameters|AutoIt3Wrapper_Icon|AutoIt3Wrapper_Outfile|AutoIt3Wrapper_Outfile_Type|AutoIt3Wrapper_Plugin_Funcs|AutoIt3Wrapper_Res_Comment|AutoIt3Wrapper_Res_Description|AutoIt3Wrapper_Res_Field|AutoIt3Wrapper_Res_File_Add|AutoIt3Wrapper_Res_Fileversion|AutoIt3Wrapper_Res_FileVersion_AutoIncrement|AutoIt3Wrapper_Res_Icon_Add|AutoIt3Wrapper_Res_Language|AutoIt3Wrapper_Res_LegalCopyright|AutoIt3Wrapper_res_requestedExecutionLevel|AutoIt3Wrapper_Res_SaveSource|AutoIt3Wrapper_Run_After|AutoIt3Wrapper_Run_Au3check|AutoIt3Wrapper_Run_Before|AutoIt3Wrapper_Run_cvsWrapper|AutoIt3Wrapper_Run_Debug_Mode|AutoIt3Wrapper_Run_Obfuscator|AutoIt3Wrapper_Run_Tidy|AutoIt3Wrapper_Tidy_Stop_OnError|AutoIt3Wrapper_UseAnsi|AutoIt3Wrapper_UseUpx|AutoIt3Wrapper_UseX64|AutoIt3Wrapper_Version|EndRegion|forceref|Obfuscator_Ignore_Funcs|Obfuscator_Ignore_Variables|Obfuscator_Parameters|Region|Tidy_Parameters' + var atKeywords = 'AppDataCommonDir|AppDataDir|AutoItExe|AutoItPID|AutoItUnicode|AutoItVersion|AutoItX64|COM_EventObj|CommonFilesDir|Compiled|ComputerName|ComSpec|CR|CRLF|DesktopCommonDir|DesktopDepth|DesktopDir|DesktopHeight|DesktopRefresh|DesktopWidth|DocumentsCommonDir|error|exitCode|exitMethod|extended|FavoritesCommonDir|FavoritesDir|GUI_CtrlHandle|GUI_CtrlId|GUI_DragFile|GUI_DragId|GUI_DropId|GUI_WinHandle|HomeDrive|HomePath|HomeShare|HotKeyPressed|HOUR|InetGetActive|InetGetBytesRead|IPAddress1|IPAddress2|IPAddress3|IPAddress4|KBLayout|LF|LogonDNSDomain|LogonDomain|LogonServer|MDAY|MIN|MON|MyDocumentsDir|NumParams|OSBuild|OSLang|OSServicePack|OSTYPE|OSVersion|ProcessorArch|ProgramFilesDir|ProgramsCommonDir|ProgramsDir|ScriptDir|ScriptFullPath|ScriptLineNumber|ScriptName|SEC|StartMenuCommonDir|StartMenuDir|StartupCommonDir|StartupDir|SW_DISABLE|SW_ENABLE|SW_HIDE|SW_LOCK|SW_MAXIMIZE|SW_MINIMIZE|SW_RESTORE|SW_SHOW|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWMINNOACTIVE|SW_SHOWNA|SW_SHOWNOACTIVATE|SW_SHOWNORMAL|SW_UNLOCK|SystemDir|TAB|TempDir|TRAY_ID|TrayIconFlashing|TrayIconVisible|UserName|UserProfileDir|WDAY|WindowsDir|WorkingDir|YDAY|YEAR' + + this.$rules = { start: + [ { token: 'comment.line.ahk', regex: '(?:^| );.*$' }, + { token: 'comment.block.ahk', + regex: '/\\*', push: + [ { token: 'comment.block.ahk', regex: '\\*/', next: 'pop' }, + { defaultToken: 'comment.block.ahk' } ] }, + { token: 'doc.comment.ahk', + regex: '#cs', push: + [ { token: 'doc.comment.ahk', regex: '#ce', next: 'pop' }, + { defaultToken: 'doc.comment.ahk' } ] }, + { token: 'keyword.command.ahk', + regex: '(?:\\b|^)(?:allowsamelinecomments|clipboardtimeout|commentflag|errorstdout|escapechar|hotkeyinterval|hotkeymodifiertimeout|hotstring|include|includeagain|installkeybdhook|installmousehook|keyhistory|ltrim|maxhotkeysperinterval|maxmem|maxthreads|maxthreadsbuffer|maxthreadsperhotkey|noenv|notrayicon|persistent|singleinstance|usehook|winactivateforce|autotrim|blockinput|click|clipwait|continue|control|controlclick|controlfocus|controlget|controlgetfocus|controlgetpos|controlgettext|controlmove|controlsend|controlsendraw|controlsettext|coordmode|critical|detecthiddentext|detecthiddenwindows|drive|driveget|drivespacefree|edit|endrepeat|envadd|envdiv|envget|envmult|envset|envsub|envupdate|exit|exitapp|fileappend|filecopy|filecopydir|filecreatedir|filecreateshortcut|filedelete|filegetattrib|filegetshortcut|filegetsize|filegettime|filegetversion|fileinstall|filemove|filemovedir|fileread|filereadline|filerecycle|filerecycleempty|fileremovedir|fileselectfile|fileselectfolder|filesetattrib|filesettime|formattime|getkeystate|gosub|goto|groupactivate|groupadd|groupclose|groupdeactivate|gui|guicontrol|guicontrolget|hideautoitwin|hotkey|ifequal|ifexist|ifgreater|ifgreaterorequal|ifinstring|ifless|iflessorequal|ifmsgbox|ifnotequal|ifnotexist|ifnotinstring|ifwinactive|ifwinexist|ifwinnotactive|ifwinnotexist|imagesearch|inidelete|iniread|iniwrite|input|inputbox|keyhistory|keywait|listhotkeys|listlines|listvars|menu|mouseclick|mouseclickdrag|mousegetpos|mousemove|msgbox|onexit|outputdebug|pause|pixelgetcolor|pixelsearch|postmessage|process|progress|random|regdelete|regread|regwrite|reload|repeat|run|runas|runwait|send|sendevent|sendinput|sendmode|sendplay|sendmessage|sendraw|setbatchlines|setcapslockstate|setcontroldelay|setdefaultmousespeed|setenv|setformat|setkeydelay|setmousedelay|setnumlockstate|setscrolllockstate|setstorecapslockmode|settimer|settitlematchmode|setwindelay|setworkingdir|shutdown|sleep|sort|soundbeep|soundget|soundgetwavevolume|soundplay|soundset|soundsetwavevolume|splashimage|splashtextoff|splashtexton|splitpath|statusbargettext|statusbarwait|stringcasesense|stringgetpos|stringleft|stringlen|stringlower|stringmid|stringreplace|stringright|stringsplit|stringtrimleft|stringtrimright|stringupper|suspend|sysget|thread|tooltip|transform|traytip|urldownloadtofile|while|winactivate|winactivatebottom|winclose|winget|wingetactivestats|wingetactivetitle|wingetclass|wingetpos|wingettext|wingettitle|winhide|winkill|winmaximize|winmenuselectitem|winminimize|winminimizeall|winminimizeallundo|winmove|winrestore|winset|winsettitle|winshow|winwait|winwaitactive|winwaitclose|winwaitnotactive)\\b', + caseInsensitive: true }, + { token: 'keyword.control.ahk', + regex: '(?:\\b|^)(?:if|else|return|loop|break|for|while|global|local|byref)\\b', + caseInsensitive: true }, + { token: 'support.function.ahk', + regex: '(?:\\b|^)(?:abs|acos|asc|asin|atan|ceil|chr|cos|dllcall|exp|fileexist|floor|getkeystate|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist)\\b', + caseInsensitive: true }, + { token: 'variable.predefined.ahk', + regex: '(?:\\b|^)(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\\b', + caseInsensitive: true }, + { token: 'support.constant.ahk', + regex: '(?:\\b|^)(?:shift|lshift|rshift|alt|lalt|ralt|control|lcontrol|rcontrol|ctrl|lctrl|rctrl|lwin|rwin|appskey|altdown|altup|shiftdown|shiftup|ctrldown|ctrlup|lwindown|lwinup|rwindown|rwinup|lbutton|rbutton|mbutton|wheelup|wheelleft|wheelright|wheeldown|xbutton1|xbutton2|joy1|joy2|joy3|joy4|joy5|joy6|joy7|joy8|joy9|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy30|joy31|joy32|joyx|joyy|joyz|joyr|joyu|joyv|joypov|joyname|joybuttons|joyaxes|joyinfo|space|tab|enter|escape|esc|backspace|bs|delete|del|insert|ins|pgup|pgdn|home|end|up|down|left|right|printscreen|ctrlbreak|pause|scrolllock|capslock|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadmult|numpadadd|numpadsub|numpaddiv|numpaddot|numpaddel|numpadins|numpadclear|numpadup|numpaddown|numpadleft|numpadright|numpadhome|numpadend|numpadpgup|numpadpgdn|numpadenter|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|browser_back|browser_forward|browser_refresh|browser_stop|browser_search|browser_favorites|browser_home|volume_mute|volume_down|volume_up|media_next|media_prev|media_stop|media_play_pause|launch_mail|launch_media|launch_app1|launch_app2)\\b', + caseInsensitive: true }, + { token: 'variable.parameter', + regex: '(?:\\b|^)(?:pixel|mouse|screen|relative|rgb|ltrim|rtrim|join|low|belownormal|normal|abovenormal|high|realtime|ahk_id|ahk_pid|ahk_class|ahk_group|between|contains|in|is|integer|float|integerfast|floatfast|number|digit|xdigit|alpha|upper|lower|alnum|time|date|not|or|and|alwaysontop|topmost|top|bottom|transparent|transcolor|redraw|region|id|idlast|processname|minmax|controllist|count|list|capacity|statuscd|eject|lock|unlock|label|filesystem|label|setlabel|serial|type|status|static|seconds|minutes|hours|days|read|parse|logoff|close|error|single|tray|add|rename|check|uncheck|togglecheck|enable|disable|toggleenable|default|nodefault|standard|nostandard|color|delete|deleteall|icon|noicon|tip|click|show|mainwindow|nomainwindow|useerrorlevel|text|picture|pic|groupbox|button|checkbox|radio|dropdownlist|ddl|combobox|listbox|listview|datetime|monthcal|updown|slider|tab|tab2|statusbar|treeview|iconsmall|tile|report|sortdesc|nosort|nosorthdr|grid|hdr|autosize|range|xm|ym|ys|xs|xp|yp|font|resize|owner|submit|nohide|minimize|maximize|restore|noactivate|na|cancel|destroy|center|margin|maxsize|minsize|owndialogs|guiescape|guiclose|guisize|guicontextmenu|guidropfiles|tabstop|section|altsubmit|wrap|hscroll|vscroll|border|top|bottom|buttons|expand|first|imagelist|lines|wantctrla|wantf2|vis|visfirst|number|uppercase|lowercase|limit|password|multi|wantreturn|group|background|bold|italic|strike|underline|norm|backgroundtrans|theme|caption|delimiter|minimizebox|maximizebox|sysmenu|toolwindow|flash|style|exstyle|check3|checked|checkedgray|readonly|password|hidden|left|right|center|notab|section|move|focus|hide|choose|choosestring|text|pos|enabled|disabled|visible|lastfound|lastfoundexist|alttab|shiftalttab|alttabmenu|alttabandmenu|alttabmenudismiss|notimers|interrupt|priority|waitclose|blind|raw|unicode|deref|pow|bitnot|bitand|bitor|bitxor|bitshiftleft|bitshiftright|yes|no|ok|cancel|abort|retry|ignore|tryagain|on|off|all|hkey_local_machine|hkey_users|hkey_current_user|hkey_classes_root|hkey_current_config|hklm|hku|hkcu|hkcr|hkcc|reg_sz|reg_expand_sz|reg_multi_sz|reg_dword|reg_qword|reg_binary|reg_link|reg_resource_list|reg_full_resource_descriptor|reg_resource_requirements_list|reg_dword_big_endian)\\b', + caseInsensitive: true }, + { keywordMap: {"constant.language": autoItKeywords}, regex: '\\w+\\b'}, + { keywordMap: {"variable.function": atKeywords}, regex: '@\\w+\\b'}, + { token : "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, + { token: 'keyword.operator.ahk', + regex: '=|==|<>|:=|<|>|\\*|\\/|\\+|:|\\?|\\-' }, + { token: 'punctuation.ahk', + regex: '#|`|::|,|\\{|\\}|\\(|\\)|\\%' }, + { token: + [ 'punctuation.quote.double', + 'string.quoted.ahk', + 'punctuation.quote.double' ], + regex: '(")((?:[^"]|"")*)(")' }, + { token: [ 'label.ahk', 'punctuation.definition.label.ahk' ], + regex: '^([^: ]+)(:)(?!:)' } ] } + + this.normalizeRules(); +}; + +AutoHotKeyHighlightRules.metaData = { name: 'AutoHotKey', + scopeName: 'source.ahk', + fileTypes: [ 'ahk' ], + foldingStartMarker: '^\\s*/\\*|^(?![^{]*?;|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|;|/\\*(?!.*?\\*/.*\\S))', + foldingStopMarker: '^\\s*\\*/|^\\s*\\}' } + + +oop.inherits(AutoHotKeyHighlightRules, TextHighlightRules); + +exports.AutoHotKeyHighlightRules = AutoHotKeyHighlightRules; +}); \ No newline at end of file diff --git a/lib/ace/mode/text_highlight_rules.js b/lib/ace/mode/text_highlight_rules.js index 5ece4e00..e3d7163f 100644 --- a/lib/ace/mode/text_highlight_rules.js +++ b/lib/ace/mode/text_highlight_rules.js @@ -178,9 +178,16 @@ var TextHighlightRules = function() { i--; toInsert = null } + + if (rule.keywordMap) { + rule.token = this.createKeywordMapper( + rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive + ); + delete rule.defaultToken; + } } }; - Object.keys(rules).forEach(processState); + Object.keys(rules).forEach(processState, this); }; this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) { From f40cc1c31d6e8c098a9d4fa7fd02a8ac1b6fc899 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 6 Apr 2013 15:00:06 +0400 Subject: [PATCH 09/20] fix #510 #{} highlighting for CoffeeScript --- lib/ace/mode/_test/tokens_coffee.json | 56 +++++++++++++++++++++----- lib/ace/mode/coffee_highlight_rules.js | 17 ++++++++ 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/lib/ace/mode/_test/tokens_coffee.json b/lib/ace/mode/_test/tokens_coffee.json index e0e745fe..9c3967e4 100644 --- a/lib/ace/mode/_test/tokens_coffee.json +++ b/lib/ace/mode/_test/tokens_coffee.json @@ -100,10 +100,12 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], + ["paren.lparen","("], + ["paren","{"], ["keyword.operator","/"], ["identifier","abc"], - ["paren.rparen","})"], + ["paren","}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","=>"] ],[ @@ -113,10 +115,12 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], + ["paren.lparen","("], + ["paren","{"], ["identifier","abc"], ["keyword.operator","/"], - ["paren.rparen","})"], + ["paren","}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -150,10 +154,12 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], + ["paren.lparen","("], + ["paren","{"], ["paren.rparen",")"], ["identifier","abc"], - ["paren.rparen","})"], + ["paren","}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -163,9 +169,12 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], + ["paren.lparen","("], + ["paren","{"], ["identifier","abc"], - ["paren.rparen",")})"], + ["paren.rparen",")"], + ["paren","}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -427,9 +436,36 @@ ["keyword.operator","="], ["text"," "], ["string.start","\""], - ["string","#{ 22 / 7 + {x: "], + ["paren.string","#{"], + ["text"," "], + ["constant.numeric","22"], + ["text"," "], + ["keyword.operator","/"], + ["text"," "], + ["constant.numeric","7"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["paren","{"], + ["identifier","x"], + ["keyword.operator",":"], + ["text"," "], + ["string.start","\""], + ["paren.string","#{"], + ["identifier","a"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["identifier","b"], + ["paren.string","}"], ["string.end","\""], - ["comment","#{a + b}\"} + 2}\""] + ["paren","}"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric","2"], + ["paren.string","}"], + ["string.end","\""] ],[ "qqdoc", ["string","\"\"\"heredoc"] diff --git a/lib/ace/mode/coffee_highlight_rules.js b/lib/ace/mode/coffee_highlight_rules.js index 11bbbb53..c050f78a 100644 --- a/lib/ace/mode/coffee_highlight_rules.js +++ b/lib/ace/mode/coffee_highlight_rules.js @@ -107,6 +107,7 @@ define(function(require, exports, module) { regex : '"""', next : [ {token : "string", regex : '"""', next : "start"}, + {token : "paren.string", regex : '#{', push : "start"}, {token : "constant.language.escape", regex : stringEscape}, {defaultToken: "string"} ] @@ -121,6 +122,7 @@ define(function(require, exports, module) { stateName: "qqstring", token : "string.start", regex : '"', next : [ {token : "string.end", regex : '"', next : "start"}, + {token : "paren.string", regex : '#{', push : "start"}, {token : "constant.language.escape", regex : stringEscape}, {defaultToken: "string"} ] @@ -131,6 +133,21 @@ define(function(require, exports, module) { {token : "constant.language.escape", regex : stringEscape}, {defaultToken: "string"} ] + }, { + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + return "paren"; + } + if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1) + return "paren.string"; + } + return "paren"; + } }, { token : "string.regex", regex : "///", From 2868df4b280960e20c50a17a6643988f6fed2b58 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 6 Apr 2013 15:17:41 +0400 Subject: [PATCH 10/20] cleanup and fix tests --- demo/kitchen-sink/doclist.js | 2 +- lib/ace/mode/_test/tokens_actionscript.json | 272 ++++++++++++++++ lib/ace/mode/_test/tokens_erlang.json | 169 ++++++++++ lib/ace/mode/_test/tokens_forth.json | 219 +++++++++++++ lib/ace/mode/_test/tokens_ftl.json | 337 ++++++++++++++++++++ lib/ace/mode/_test/tokens_haskell.json | 162 ++++++++++ lib/ace/mode/_test/tokens_julia.json | 105 ++++++ lib/ace/mode/_test/tokens_livescript.json | 6 + lib/ace/mode/_test/tokens_pascal.json | 6 +- lib/ace/mode/_test/tokens_prolog.json | 265 +++++++++++++++ lib/ace/mode/_test/tokens_rust.json | 136 ++++++++ lib/ace/mode/forth_highlight_rules.js | 24 +- lib/ace/mode/logiql_test.js | 2 +- lib/ace/tokenizer.js | 2 +- 14 files changed, 1689 insertions(+), 18 deletions(-) create mode 100644 lib/ace/mode/_test/tokens_actionscript.json create mode 100644 lib/ace/mode/_test/tokens_erlang.json create mode 100644 lib/ace/mode/_test/tokens_forth.json create mode 100644 lib/ace/mode/_test/tokens_ftl.json create mode 100644 lib/ace/mode/_test/tokens_haskell.json create mode 100644 lib/ace/mode/_test/tokens_julia.json create mode 100644 lib/ace/mode/_test/tokens_livescript.json create mode 100644 lib/ace/mode/_test/tokens_prolog.json create mode 100644 lib/ace/mode/_test/tokens_rust.json diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index f025db5f..5416e169 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -102,7 +102,7 @@ var docs = { "docs/luapage.lp": "LuaPage", "docs/Makefile": "Makefile", "docs/markdown.md": {name: "Markdown", wrapped: true}, - "docs/tinymush.mc": {name: "TinyMUSH"}, + "docs/tinymush.mc": {name: "TinyMUSH", wrapped: true}, "docs/objectivec.m": {name: "Objective-C"}, "docs/ocaml.ml": "OCaml", "docs/OpenSCAD.scad": "OpenSCAD", diff --git a/lib/ace/mode/_test/tokens_actionscript.json b/lib/ace/mode/_test/tokens_actionscript.json new file mode 100644 index 00000000..00223583 --- /dev/null +++ b/lib/ace/mode/_test/tokens_actionscript.json @@ -0,0 +1,272 @@ +[[ + "start", + ["text","package code"] +],[ + "start", + ["text","{"] +],[ + "punctuation.definition.comment.actionscript.2", + ["text"," "], + ["punctuation.definition.comment.actionscript.2","/*"], + ["comment.block.actionscript.2","****************************************"] +],[ + "punctuation.definition.comment.actionscript.2", + ["comment.block.actionscript.2","\t * based on textmate actionscript bundle"] +],[ + "start", + ["comment.block.actionscript.2","\t ***************************************"], + ["punctuation.definition.comment.actionscript.2","*/"] +],[ + "start", + ["text","\t "] +],[ + "start", + ["text","\t"], + ["keyword.control.actionscript.2","import"], + ["text"," fl.events.SliderEvent;"] +],[ + "start", + ["text","\t"] +],[ + "start", + ["text","\t"], + ["keyword.control.actionscript.2","public"], + ["text"," "], + ["storage.type.class.actionscript.2","class"], + ["meta.class.actionscript.2"," "], + ["entity.name.type.class.actionscript.2","Foo"], + ["meta.class.actionscript.2"," "], + ["storage.modifier.extends.actionscript.2","extends"], + ["meta.class.actionscript.2"," "], + ["entity.other.inherited-class.actionscript.2","MovieClip"] +],[ + "start", + ["text","\t{"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2","*************************"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Properties:"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\t"], + ["keyword.control.actionscript.2","public"], + ["text"," "], + ["keyword.control.actionscript.2","var"], + ["text"," activeSwatch"], + ["keyword.operator.symbolic.actionscript.2",":"], + ["support.class.actionscript.2","MovieClip"], + ["text",";"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Color offsets"] +],[ + "start", + ["text","\t\t"], + ["keyword.control.actionscript.2","public"], + ["text"," "], + ["keyword.control.actionscript.2","var"], + ["text"," c1"], + ["keyword.operator.symbolic.actionscript.2",":"], + ["storage.type.actionscript.2","Number"], + ["text"," "], + ["keyword.operator.symbolic.actionscript.2","="], + ["text"," "], + ["constant.numeric.actionscript.2","0"], + ["text",";\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," R"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2","*************************"] +],[ + "start", + ["text","\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Constructor:"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\t"], + ["keyword.control.actionscript.2","public"], + ["text"," "], + ["storage.type.function.actionscript.2","function"], + ["meta.function.actionscript.2"," "], + ["entity.name.function.actionscript.2","Foo"], + ["punctuation.definition.parameters.begin.actionscript.2","("], + ["punctuation.definition.parameters.end.actionscript.2",")"] +],[ + "start", + ["text","\t\t{"] +],[ + "start", + ["text","\t\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Respond to mouse events"] +],[ + "start", + ["text","\t\t\tswatch1_btn."], + ["support.function.actionscript.2","addEventListener"], + ["text","(MouseEvent.CLICK,swatchHandler,"], + ["constant.language.actionscript.2","false"], + ["text",","], + ["constant.numeric.actionscript.2","0"], + ["text",","], + ["constant.language.actionscript.2","false"], + ["text",");"] +],[ + "start", + ["text","\t\t\tpreviewBox_btn."], + ["support.function.actionscript.2","addEventListener"], + ["text","(MouseEvent.MOUSE_DOWN,dragPressHandler);"] +],[ + "start", + ["text","\t\t\t"] +],[ + "start", + ["text","\t\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Respond to drag events"] +],[ + "start", + ["text","\t\t\tred_slider."], + ["support.function.actionscript.2","addEventListener"], + ["text","(SliderEvent.THUMB_DRAG,sliderHandler);"] +],[ + "start", + ["text","\t\t\t"] +],[ + "start", + ["text","\t\t\t"], + ["punctuation.definition.comment.actionscript.2","//"], + ["comment.line.double-slash.actionscript.2"," Draw a frame later"] +],[ + "start", + ["text","\t\t\t"], + ["support.function.actionscript.2","addEventListener"], + ["text","(Event.ENTER_FRAME,"], + ["support.function.actionscript.2","draw"], + ["text",");"] +],[ + "start", + ["text","\t\t}"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text","\t\tprotected "], + ["storage.type.function.actionscript.2","function"], + ["meta.function.actionscript.2"," "], + ["entity.name.function.actionscript.2","clickHandler"], + ["punctuation.definition.parameters.begin.actionscript.2","("], + ["variable.parameter.function.actionscript.2","event:MouseEvent"], + ["punctuation.definition.parameters.end.actionscript.2",")"], + ["keyword.operator.symbolic.actionscript.2",":"], + ["support.function.actionscript.2","void"] +],[ + "start", + ["text","\t\t{"] +],[ + "start", + ["text","\t\t\tcar.transform.colorTransform "], + ["keyword.operator.symbolic.actionscript.2","="], + ["text"," "], + ["keyword.control.actionscript.2","new"], + ["text"," ColorTransform("], + ["constant.numeric.actionscript.2","0"], + ["text",","], + ["constant.numeric.actionscript.2","0"], + ["text",","], + ["constant.numeric.actionscript.2","0"], + ["text",","], + ["constant.numeric.actionscript.2","1"], + ["text",",c1,c2,c3);"] +],[ + "start", + ["text","\t\t}"] +],[ + "start", + ["text","\t\t"] +],[ + "start", + ["text","\t\tprotected "], + ["storage.type.function.actionscript.2","function"], + ["meta.function.actionscript.2"," "], + ["entity.name.function.actionscript.2","changeRGBHandler"], + ["punctuation.definition.parameters.begin.actionscript.2","("], + ["variable.parameter.function.actionscript.2","event:Event"], + ["punctuation.definition.parameters.end.actionscript.2",")"], + ["keyword.operator.symbolic.actionscript.2",":"], + ["support.function.actionscript.2","void"] +],[ + "start", + ["text","\t\t{"] +],[ + "start", + ["text","\t\t\tc1 "], + ["keyword.operator.symbolic.actionscript.2","="], + ["text"," "], + ["storage.type.actionscript.2","Number"], + ["text","(c1_txt."], + ["support.function.actionscript.2","text"], + ["text",");"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text","\t\t\t"], + ["keyword.control.actionscript.2","if"], + ["text","("], + ["keyword.operator.symbolic.actionscript.2","!"], + ["text","(c1>"], + ["keyword.operator.symbolic.actionscript.2","="], + ["constant.numeric.actionscript.2","0"], + ["text",")){"] +],[ + "start", + ["text","\t\t\t\tc1 "], + ["keyword.operator.symbolic.actionscript.2","="], + ["text"," "], + ["constant.numeric.actionscript.2","0"], + ["text",";"] +],[ + "start", + ["text","\t\t\t}\t\t\t"] +],[ + "start", + ["text","\t\t\t"] +],[ + "start", + ["text","\t\t\tupdateSliders();"] +],[ + "start", + ["text","\t\t}"] +],[ + "start", + ["text","\t}"] +],[ + "start", + ["text","}"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_erlang.json b/lib/ace/mode/_test/tokens_erlang.json new file mode 100644 index 00000000..5a1fa366 --- /dev/null +++ b/lib/ace/mode/_test/tokens_erlang.json @@ -0,0 +1,169 @@ +[[ + "start", + ["text"," "], + ["punctuation.definition.comment.erlang","%"], + ["comment.line.percentage.erlang","% A process whose only job is to keep a counter."] +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.erlang","%"], + ["comment.line.percentage.erlang","% First version"] +],[ + "start", + ["meta.directive.module.erlang"," "], + ["punctuation.section.directive.begin.erlang","-"], + ["keyword.control.directive.module.erlang","module"], + ["punctuation.definition.parameters.begin.erlang","("], + ["entity.name.type.class.module.definition.erlang","counter"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.section.directive.end.erlang","."] +],[ + "start", + ["meta.directive.export.erlang"," "], + ["punctuation.section.directive.begin.erlang","-"], + ["keyword.control.directive.export.erlang","export"], + ["punctuation.definition.parameters.begin.erlang","("], + ["punctuation.definition.list.begin.erlang","["], + ["entity.name.function.erlang","start"], + ["punctuation.separator.function-arity.erlang","/"], + ["constant.numeric.integer.decimal.erlang","0"], + ["punctuation.separator.list.erlang",","], + ["meta.structure.list.function.erlang"," "], + ["entity.name.function.erlang","codeswitch"], + ["punctuation.separator.function-arity.erlang","/"], + ["constant.numeric.integer.decimal.erlang","1"], + ["punctuation.definition.list.end.erlang","]"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.section.directive.end.erlang","."] +],[ + "start", + ["text"," "] +],[ + "start", + ["meta.function.erlang"," "], + ["entity.name.function.definition.erlang","start"], + ["punctuation.section.expression.begin.erlang","("], + ["punctuation.section.expression.end.erlang",")"], + ["text"," "], + ["keyword.operator.symbolic.erlang","->"], + ["text"," "], + ["entity.name.function.erlang","loop"], + ["punctuation.definition.parameters.begin.erlang","("], + ["constant.numeric.integer.decimal.erlang","0"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.terminator.function.erlang","."] +],[ + "start", + ["text"," "] +],[ + ["text6","meta.function.erlang"], + ["meta.function.erlang"," "], + ["entity.name.function.definition.erlang","loop"], + ["punctuation.section.expression.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.section.expression.end.erlang",")"], + ["text"," "], + ["keyword.operator.symbolic.erlang","->"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["text"," "], + ["keyword.control.receive.erlang","receive"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["punctuation.definition.tuple.begin.erlang","{"], + ["constant.other.symbol.unquoted.erlang","increment"], + ["punctuation.separator.tuple.erlang",","], + ["meta.structure.tuple.erlang"," "], + ["variable.other.erlang","Count"], + ["punctuation.definition.tuple.end.erlang","}"], + ["meta.expression.receive.erlang"," "], + ["punctuation.separator.clause-head-body.erlang","->"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["entity.name.function.erlang","loop"], + ["punctuation.definition.parameters.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["keyword.operator.symbolic.erlang","+"], + ["variable.other.erlang","Count"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.separator.clauses.erlang",";"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["punctuation.definition.tuple.begin.erlang","{"], + ["constant.other.symbol.unquoted.erlang","counter"], + ["punctuation.separator.tuple.erlang",","], + ["meta.structure.tuple.erlang"," "], + ["variable.other.erlang","Pid"], + ["punctuation.definition.tuple.end.erlang","}"], + ["meta.expression.receive.erlang"," "], + ["punctuation.separator.clause-head-body.erlang","->"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["variable.other.erlang","Pid"], + ["meta.expression.receive.erlang"," "], + ["keyword.operator.symbolic.erlang","!"], + ["meta.expression.receive.erlang"," "], + ["punctuation.definition.tuple.begin.erlang","{"], + ["constant.other.symbol.unquoted.erlang","counter"], + ["punctuation.separator.tuple.erlang",","], + ["meta.structure.tuple.erlang"," "], + ["variable.other.erlang","Sum"], + ["punctuation.definition.tuple.end.erlang","}"], + ["punctuation.separator.expressions.erlang",","] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["entity.name.function.erlang","loop"], + ["punctuation.definition.parameters.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.separator.clauses.erlang",";"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["constant.other.symbol.unquoted.erlang","code_switch"], + ["meta.expression.receive.erlang"," "], + ["punctuation.separator.clause-head-body.erlang","->"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["keyword.operator.macro.erlang","?"], + ["entity.name.function.macro.erlang","MODULE"], + ["meta.expression.receive.erlang",":"], + ["entity.name.function.erlang","codeswitch"], + ["punctuation.definition.parameters.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.definition.parameters.end.erlang",")"] +],[ + ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], + ["meta.expression.receive.erlang"," "], + ["punctuation.definition.comment.erlang","%"], + ["comment.line.percentage.erlang"," Force the use of 'codeswitch/1' from the latest MODULE version"] +],[ + "start", + ["meta.expression.receive.erlang"," "], + ["keyword.control.end.erlang","end"], + ["punctuation.terminator.function.erlang","."] +],[ + "start", + ["text"," "] +],[ + "start", + ["meta.function.erlang"," "], + ["entity.name.function.definition.erlang","codeswitch"], + ["punctuation.section.expression.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.section.expression.end.erlang",")"], + ["text"," "], + ["keyword.operator.symbolic.erlang","->"], + ["text"," "], + ["entity.name.function.erlang","loop"], + ["punctuation.definition.parameters.begin.erlang","("], + ["variable.other.erlang","Sum"], + ["punctuation.definition.parameters.end.erlang",")"], + ["punctuation.terminator.function.erlang","."] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_forth.json b/lib/ace/mode/_test/tokens_forth.json new file mode 100644 index 00000000..8c8a007e --- /dev/null +++ b/lib/ace/mode/_test/tokens_forth.json @@ -0,0 +1,219 @@ +[[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","HELLO"], + ["meta.block.forth"," "], + ["comment.line.parentheses.forth"," ( -- )"], + ["meta.block.forth"," CR "], + ["string.quoted.double.forth",".\" Hello, world!\""], + ["meta.block.forth"," "], + ["keyword.other.compile-only.forth",";"], + ["text"," "] +],[ + "start" +],[ + "start", + ["text","HELLO "] +],[ + "start", + ["text","Hello, world!"] +],[ + "start" +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","[CHAR]"], + ["meta.block.forth"," "], + ["keyword.other.non-immediate.forth"," CHAR"], + ["meta.block.forth"," "], + ["keyword.other.compile-only.forth"," POSTPONE"], + ["meta.block.forth"," LITERAL "], + ["keyword.other.compile-only.forth",";"], + ["keyword.other.immediate.forth"," IMMEDIATE"] +],[ + "start" +],[ + "start", + ["constant.numeric.forth","0"], + ["storage.type.forth"," value"], + ["text"," ii "], + ["constant.numeric.forth"," 0"], + ["storage.type.forth"," value"], + ["text"," jj"] +],[ + "start", + ["constant.numeric.forth","0"], + ["storage.type.forth"," value"], + ["text"," KeyAddr "], + ["constant.numeric.forth"," 0"], + ["storage.type.forth"," value"], + ["text"," KeyLen"] +],[ + "start", + ["storage.type.forth","create"], + ["text"," SArray "], + ["constant.numeric.forth"," 256"], + ["text"," allot "], + ["comment.line.backslash.forth"," \\ state array of 256 bytes"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","KeyArray"], + ["meta.block.forth"," KeyLen mod KeyAddr "], + ["keyword.other.compile-only.forth",";"] +],[ + "start" +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","get_byte"], + ["meta.block.forth"," + c@ "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","set_byte"], + ["meta.block.forth"," + c! "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","as_byte"], + ["meta.block.forth"," "], + ["constant.numeric.forth"," 255"], + ["meta.block.forth"," and "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","reset_ij"], + ["meta.block.forth"," "], + ["constant.numeric.forth"," 0"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," ii "], + ["constant.numeric.forth"," 0"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," jj "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","i_update"], + ["meta.block.forth"," "], + ["constant.numeric.forth"," 1"], + ["meta.block.forth"," + as_byte"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," ii "], + ["keyword.other.compile-only.forth",";"] +],[ + "start", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","j_update"], + ["meta.block.forth"," ii SArray get_byte + as_byte"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," jj "], + ["keyword.other.compile-only.forth",";"] +],[ + "keyword.other.compile-only.forth", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","swap_s_ij"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," jj SArray get_byte"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii SArray get_byte jj SArray set_byte"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii SArray set_byte"] +],[ + "start", + ["keyword.other.compile-only.forth",";"] +],[ + "start" +],[ + "keyword.other.compile-only.forth", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","rc4_init"], + ["comment.line.parentheses.forth"," ( KeyAddr KeyLen -- )"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," "], + ["constant.numeric.forth"," 256"], + ["meta.block.forth"," min"], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," KeyLen "], + ["keyword.other.immediate.forth"," TO"], + ["meta.block.forth"," KeyAddr"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," "], + ["constant.numeric.forth"," 256 0"], + ["keyword.control.compile-only.forth"," DO"], + ["meta.block.forth"," "], + ["variable.language.forth","i"], + ["meta.block.forth"," "], + ["variable.language.forth","i"], + ["meta.block.forth"," SArray set_byte "], + ["keyword.control.compile-only.forth"," LOOP"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," reset_ij"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," "], + ["keyword.control.compile-only.forth"," BEGIN"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii KeyArray get_byte jj + j_update"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," swap_s_ij"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii"], + ["constant.numeric.forth"," 255"], + ["meta.block.forth"," <"], + ["keyword.control.compile-only.forth"," WHILE"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii i_update"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," "], + ["keyword.control.compile-only.forth"," REPEAT"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," reset_ij"] +],[ + "start", + ["keyword.other.compile-only.forth",";"] +],[ + "keyword.other.compile-only.forth", + ["keyword.other.compile-only.forth",":"], + ["meta.block.forth"," "], + ["entity.name.function.forth","rc4_byte"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii i_update jj j_update"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," swap_s_ij"] +],[ + "keyword.other.compile-only.forth", + ["meta.block.forth"," ii SArray get_byte jj SArray get_byte + as_byte SArray get_byte xor"] +],[ + "start", + ["keyword.other.compile-only.forth",";"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ftl.json b/lib/ace/mode/_test/tokens_ftl.json new file mode 100644 index 00000000..19773674 --- /dev/null +++ b/lib/ace/mode/_test/tokens_ftl.json @@ -0,0 +1,337 @@ +[[ + "start", + ["keyword.function","<#ftl"], + ["text"," "], + ["entity.other.attribute-name","encoding"], + ["keyword.operator","="], + ["string","\"utf-8\""], + ["text"," "], + ["keyword","/>"] +],[ + "start", + ["keyword.function","<#setting"], + ["text"," "], + ["entity.other.attribute-name","locale"], + ["keyword.operator","="], + ["string","\"en_US\""], + ["text"," "], + ["keyword","/>"] +],[ + "start", + ["keyword.function","<#import"], + ["text"," "], + ["string","\"library\""], + ["text"," "], + ["keyword.operator","as"], + ["text"," "], + ["variable","lib"], + ["text"," "], + ["keyword","/>"] +],[ + "comment", + ["comment","<#--"] +],[ + "comment", + ["comment"," FreeMarker comment"] +],[ + "comment", + ["comment"," ${abc} <#assign a=12 />"] +],[ + "start", + ["comment","-->"] +],[ + "start" +],[ + "start", + ["xml-pe",""] +],[ + "start", + ["meta.tag","<"], + ["meta.tag.tag-name","html"], + ["text"," "], + ["entity.other.attribute-name","lang"], + ["keyword.operator","="], + ["string","\"en-us\""], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","head"], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","meta"], + ["text"," "], + ["entity.other.attribute-name","charset"], + ["keyword.operator","="], + ["string","\"utf-8\""], + ["text"," "], + ["meta.tag.r","/>"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","title"], + ["meta.tag.r",">"], + ["string.interpolated","${"], + ["variable","title"], + ["keyword.operator","!"], + ["string","\"FreeMarker\""], + ["string.interpolated","}"], + ["meta.tag","<"], + ["meta.tag.tag-name","title"], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "], + ["meta.tag",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","body"], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","h1"], + ["meta.tag.r",">"], + ["text","Hello "], + ["string.interpolated","${"], + ["variable","name"], + ["keyword.operator","!"], + ["string","\"\""], + ["string.interpolated","}"], + ["meta.tag",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","p"], + ["meta.tag.r",">"], + ["text","Today is: "], + ["string.interpolated","${"], + ["language.variable",".now"], + ["support.function","?date"], + ["string.interpolated","}"], + ["meta.tag",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.function","<#assign"], + ["text"," "], + ["variable","x"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["constant.numeric","13"], + ["keyword",">"] +],[ + "start", + ["text"," "], + ["keyword.function","<#if"], + ["text"," "], + ["variable","x"], + ["text"," "], + ["constant.character.entity",">"], + ["text"," "], + ["constant.numeric","12"], + ["text"," "], + ["keyword.operator","&&"], + ["text"," "], + ["variable","x"], + ["text"," "], + ["keyword.operator","lt"], + ["text"," "], + ["constant.numeric","14"], + ["keyword",">"], + ["text","x equals 13: "], + ["string.interpolated","${"], + ["variable","x"], + ["string.interpolated","}"], + ["keyword.function",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","ul"], + ["meta.tag.r",">"] +],[ + "start", + ["text"," "], + ["keyword.function","<#list"], + ["text"," "], + ["variable","items"], + ["text"," "], + ["keyword.operator","as"], + ["text"," "], + ["variable","item"], + ["keyword",">"] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name","li"], + ["meta.tag.r",">"], + ["string.interpolated","${"], + ["variable","item_index"], + ["string.interpolated","}"], + ["text",": "], + ["string.interpolated","${"], + ["variable","item.name"], + ["keyword.operator","!"], + ["support.function","?split"], + ["paren.lparen","("], + ["string","\""], + ["constant.character.escape","\\n"], + ["string","\""], + ["paren.rparen",")"], + ["paren.lparen","["], + ["constant.numeric","0"], + ["paren.rparen","]"], + ["string.interpolated","}"], + ["meta.tag",""] +],[ + "start", + ["text"," "], + ["keyword.function",""] +],[ + "start", + ["text"," "], + ["meta.tag",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," User directive: "], + ["keyword.other","<@lib.function"], + ["text"," "], + ["variable","attr1"], + ["keyword.operator","="], + ["constant.language","true"], + ["text"," "], + ["variable","attr2"], + ["keyword.operator","="], + ["string","'value'"], + ["text"," "], + ["variable","attr3"], + ["keyword.operator","="], + ["constant.numeric","-42.12"], + ["keyword",">"], + ["text","Test"], + ["keyword.other",""] +],[ + "start", + ["text"," "], + ["keyword.other","<@anotherOne"], + ["text"," "], + ["keyword","/>"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.function","<#if"], + ["text"," "], + ["variable","variable"], + ["support.function.deprecated","?exists"], + ["keyword",">"] +],[ + "start", + ["text"," Deprecated"] +],[ + "start", + ["text"," "], + ["keyword.function","<#elseif"], + ["text"," "], + ["variable","variable"], + ["support.function","??"], + ["keyword",">"] +],[ + "start", + ["text"," Better"] +],[ + "start", + ["text"," "], + ["keyword.function","<#else"], + ["keyword",">"] +],[ + "start", + ["text"," Default"] +],[ + "start", + ["text"," "], + ["keyword.function",""] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag","<"], + ["meta.tag.tag-name.image","img"], + ["text"," "], + ["entity.other.attribute-name","src"], + ["keyword.operator","="], + ["string","\"images/"], + ["string.interpolated","${"], + ["variable","user.id"], + ["string.interpolated","}"], + ["string",".png\""], + ["text"," "], + ["meta.tag.r","/>"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["meta.tag",""] +],[ + "start", + ["meta.tag",""] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_haskell.json b/lib/ace/mode/_test/tokens_haskell.json new file mode 100644 index 00000000..2d2d3b6e --- /dev/null +++ b/lib/ace/mode/_test/tokens_haskell.json @@ -0,0 +1,162 @@ +[[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," Type annotation (optional)"] +],[ + "start", + ["entity.name.function.haskell","fib"], + ["meta.function.type-declaration.haskell"," "], + ["keyword.other.double-colon.haskell","::"], + ["meta.function.type-declaration.haskell"," "], + ["support.type.prelude.haskell","Int"], + ["meta.function.type-declaration.haskell"," "], + ["keyword.other.arrow.haskell","->"], + ["meta.function.type-declaration.haskell"," "], + ["support.type.prelude.haskell","Integer"] +],[ + "start", + ["text"," "] +],[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," With self-referencing data"] +],[ + "start", + ["text","fib n "], + ["keyword.operator.haskell","="], + ["text"," fibs "], + ["keyword.operator.haskell","!!"], + ["text"," n"] +],[ + "start", + ["text"," "], + ["keyword.other.haskell","where"], + ["text"," fibs "], + ["keyword.operator.haskell","="], + ["text"," "], + ["constant.numeric.haskell","0"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," "], + ["support.function.prelude.haskell","scanl"], + ["text"," "], + ["entity.name.function.infix.haskell","(+)"], + ["text"," "], + ["constant.numeric.haskell","1"], + ["text"," fibs"] +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," 0,1,1,2,3,5,..."] +],[ + "start", + ["text"," "] +],[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," Same, coded directly"] +],[ + "start", + ["text","fib n "], + ["keyword.operator.haskell","="], + ["text"," fibs "], + ["keyword.operator.haskell","!!"], + ["text"," n"] +],[ + "start", + ["text"," "], + ["keyword.other.haskell","where"], + ["text"," fibs "], + ["keyword.operator.haskell","="], + ["text"," "], + ["constant.numeric.haskell","0"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," "], + ["constant.numeric.haskell","1"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," next fibs"] +],[ + "start", + ["text"," next (a "], + ["keyword.operator.haskell",":"], + ["text"," t@(b"], + ["keyword.operator.haskell",":"], + ["text","_)) "], + ["keyword.operator.haskell","="], + ["text"," (a"], + ["keyword.operator.haskell","+"], + ["text","b) "], + ["keyword.operator.haskell",":"], + ["text"," next t"] +],[ + "start", + ["text"," "] +],[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," Similar idea, using zipWith"] +],[ + "start", + ["text","fib n "], + ["keyword.operator.haskell","="], + ["text"," fibs "], + ["keyword.operator.haskell","!!"], + ["text"," n"] +],[ + "start", + ["text"," "], + ["keyword.other.haskell","where"], + ["text"," fibs "], + ["keyword.operator.haskell","="], + ["text"," "], + ["constant.numeric.haskell","0"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," "], + ["constant.numeric.haskell","1"], + ["text"," "], + ["keyword.operator.haskell",":"], + ["text"," "], + ["support.function.prelude.haskell","zipWith"], + ["text"," "], + ["entity.name.function.infix.haskell","(+)"], + ["text"," fibs ("], + ["support.function.prelude.haskell","tail"], + ["text"," fibs)"] +],[ + "start", + ["text"," "] +],[ + "start", + ["punctuation.definition.comment.haskell","--"], + ["comment.line.double-dash.haskell"," Using a generator function"] +],[ + "start", + ["text","fib n "], + ["keyword.operator.haskell","="], + ["text"," fibs ("], + ["constant.numeric.haskell","0"], + ["punctuation.separator.comma.haskell",","], + ["constant.numeric.haskell","1"], + ["text",") "], + ["keyword.operator.haskell","!!"], + ["text"," n"] +],[ + "start", + ["text"," "], + ["keyword.other.haskell","where"], + ["text"," fibs (a"], + ["punctuation.separator.comma.haskell",","], + ["text","b) "], + ["keyword.operator.haskell","="], + ["text"," a "], + ["keyword.operator.haskell",":"], + ["text"," fibs (b"], + ["punctuation.separator.comma.haskell",","], + ["text","a"], + ["keyword.operator.haskell","+"], + ["text","b)"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_julia.json b/lib/ace/mode/_test/tokens_julia.json new file mode 100644 index 00000000..f4ce4eab --- /dev/null +++ b/lib/ace/mode/_test/tokens_julia.json @@ -0,0 +1,105 @@ +[[ + "start", + ["keyword.control.julia","for"], + ["text"," op "], + ["keyword.operator.update.julia","="], + ["text"," ("], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.arithmetic.julia","+"], + ["text",", "], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.arithmetic.julia","*"], + ["text",", "], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.bitwise.julia","&"], + ["text",", "], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.bitwise.julia","|"], + ["text",", "], + ["keyword.operator.ternary.julia",":"], + ["keyword.operator.interpolation.julia","$"], + ["text",")"] +],[ + "start", + ["text"," "], + ["variable.macro.julia","@eval"], + ["text"," ("], + ["keyword.operator.interpolation.julia","$"], + ["text","op)(a,b,c) "], + ["keyword.operator.update.julia","="], + ["text"," ("], + ["keyword.operator.interpolation.julia","$"], + ["text","op)(("], + ["keyword.operator.interpolation.julia","$"], + ["text","op)(a,b),c)"] +],[ + "start", + ["keyword.control.julia","end"] +],[ + "start" +],[ + "start" +],[ + "start", + ["keyword.other.julia","function"], + ["meta.function.julia"," "], + ["entity.name.function.julia","g"], + ["text","("], + ["text","x,y)"] +],[ + "start", + ["text"," "], + ["keyword.control.julia","return"], + ["text"," x "], + ["keyword.operator.arithmetic.julia","*"], + ["text"," y"] +],[ + "start", + ["text"," x "], + ["keyword.operator.arithmetic.julia","+"], + ["text"," y"] +],[ + "start", + ["keyword.control.julia","end"] +],[ + "start" +],[ + "start", + ["support.function.julia","cd"], + ["text","("], + ["punctuation.definition.string.begin.julia","\""], + ["string.quoted.double.julia","data"], + ["punctuation.definition.string.end.julia","\""], + ["text",") "], + ["keyword.control.julia","do"] +],[ + "start", + ["text"," "], + ["support.function.julia","open"], + ["text","("], + ["punctuation.definition.string.begin.julia","\""], + ["string.quoted.double.julia","outfile"], + ["punctuation.definition.string.end.julia","\""], + ["text",", "], + ["punctuation.definition.string.begin.julia","\""], + ["string.quoted.double.julia","w"], + ["punctuation.definition.string.end.julia","\""], + ["text",") "], + ["keyword.control.julia","do"], + ["text"," f"] +],[ + "start", + ["text"," "], + ["support.function.julia","write"], + ["text","("], + ["text","f, data)"] +],[ + "start", + ["text"," "], + ["keyword.control.julia","end"] +],[ + "start", + ["keyword.control.julia","end"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_livescript.json b/lib/ace/mode/_test/tokens_livescript.json new file mode 100644 index 00000000..c2bd83df --- /dev/null +++ b/lib/ace/mode/_test/tokens_livescript.json @@ -0,0 +1,6 @@ +[[ + "start", + ["comment","# comment"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_pascal.json b/lib/ace/mode/_test/tokens_pascal.json index 0797ca0b..85f47a64 100644 --- a/lib/ace/mode/_test/tokens_pascal.json +++ b/lib/ace/mode/_test/tokens_pascal.json @@ -1,12 +1,12 @@ [[ - "punctuation.definition.comment.pascal2", + "punctuation.definition.comment.pascal1", ["punctuation.definition.comment.pascal","(*"], ["comment.block.pascal.one","****************************************************************************"] ],[ - "punctuation.definition.comment.pascal2", + "punctuation.definition.comment.pascal1", ["comment.block.pascal.one"," * A simple bubble sort program. Reads integers, one per line, and prints *"] ],[ - "punctuation.definition.comment.pascal2", + "punctuation.definition.comment.pascal1", ["comment.block.pascal.one"," * them out in sorted order. Blows up if there are more than 49. *"] ],[ "start", diff --git a/lib/ace/mode/_test/tokens_prolog.json b/lib/ace/mode/_test/tokens_prolog.json new file mode 100644 index 00000000..e42b65b5 --- /dev/null +++ b/lib/ace/mode/_test/tokens_prolog.json @@ -0,0 +1,265 @@ +[[ + "start", + ["entity.name.function.fact.prolog","partition"], + ["punctuation.begin.fact.parameters.prolog","("], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["variable.language.anonymous.prolog","_"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["punctuation.end.fact.parameters.prolog",")"], + ["punctuation.end.fact.prolog","."] +],[ + ["keyword.operator.definition.prolog","meta.rule.prolog"], + ["entity.name.function.rule.prolog","partition"], + ["punctuation.rule.parameters.begin.prolog","("], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.concat.list.prolog","|"], + ["variable.other.prolog","Xs"], + ["punctuation.end.list.prolog","]"], + ["punctuation.separator.parameters.prolog",","], + ["meta.rule.parameters.prolog"," "], + ["variable.parameter.prolog","Pivot"], + ["punctuation.separator.parameters.prolog",","], + ["meta.rule.parameters.prolog"," "], + ["variable.parameter.prolog","Smalls"], + ["punctuation.separator.parameters.prolog",","], + ["meta.rule.parameters.prolog"," "], + ["variable.parameter.prolog","Bigs"], + ["punctuation.rule.parameters.end.prolog",")"], + ["meta.rule.signature.prolog"," "], + ["keyword.operator.definition.prolog",":-"] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.rule.definition.prolog"," "], + ["meta.expression.prolog","( "], + ["variable.other.prolog","X"], + ["meta.expression.prolog"," @"], + ["keyword.operator.prolog","<"], + ["meta.expression.prolog"," "], + ["variable.other.prolog","Pivot"], + ["meta.expression.prolog"," "], + ["keyword.operator.prolog","->"] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.expression.prolog"," "], + ["variable.other.prolog","Smalls"], + ["meta.expression.prolog"," "], + ["keyword.operator.prolog","="], + ["meta.expression.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.concat.list.prolog","|"], + ["variable.other.prolog","Rest"], + ["punctuation.end.list.prolog","]"], + ["punctuation.control.and.prolog",","] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.expression.prolog"," "], + ["constant.other.atom.prolog","partition"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Xs"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Pivot"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Rest"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Bigs"], + ["punctuation.end.statement.parameters.prolog",")"] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.expression.prolog"," "], + ["punctuation.control.or.prolog",";"], + ["meta.expression.prolog"," "], + ["variable.other.prolog","Bigs"], + ["meta.expression.prolog"," "], + ["keyword.operator.prolog","="], + ["meta.expression.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.concat.list.prolog","|"], + ["variable.other.prolog","Rest"], + ["punctuation.end.list.prolog","]"], + ["punctuation.control.and.prolog",","] +],[ + ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], + ["meta.expression.prolog"," "], + ["constant.other.atom.prolog","partition"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Xs"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Pivot"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Smalls"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Rest"], + ["punctuation.end.statement.parameters.prolog",")"] +],[ + "start", + ["meta.expression.prolog"," )"], + ["punctuation.rule.end.prolog","."] +],[ + "start", + ["text"," "] +],[ + "entity.name.function.fact.prolog", + ["entity.name.function.fact.prolog","quicksort"], + ["punctuation.begin.fact.parameters.prolog","("], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["invalid.illegal.invalidchar.prolog",")"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","-"], + ["keyword.operator.prolog","->"], + ["meta.fact.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["punctuation.end.list.prolog","]"], + ["invalid.illegal.invalidchar.prolog","."] +],[ + "entity.name.function.fact.prolog", + ["constant.other.atom.prolog","quicksort"], + ["punctuation.begin.statement.parameters.prolog","("], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.concat.list.prolog","|"], + ["variable.other.prolog","Xs"], + ["punctuation.end.list.prolog","]"], + ["punctuation.end.statement.parameters.prolog",")"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","-"], + ["keyword.operator.prolog","->"] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","{"], + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","partition"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Xs"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","X"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Smaller"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","Bigger"], + ["punctuation.end.statement.parameters.prolog",")"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","}"], + ["punctuation.separator.parameters.prolog",","] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","quicksort"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Smaller"], + ["punctuation.end.statement.parameters.prolog",")"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["punctuation.begin.list.prolog","["], + ["variable.other.prolog","X"], + ["punctuation.end.list.prolog","]"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","quicksort"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Bigger"], + ["punctuation.end.statement.parameters.prolog",")"], + ["invalid.illegal.invalidchar.prolog","."] +],[ + "entity.name.function.fact.prolog" +],[ + "entity.name.function.fact.prolog", + ["constant.other.atom.prolog","perfect"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","N"], + ["punctuation.end.statement.parameters.prolog",")"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog",":-"] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","between"], + ["punctuation.begin.statement.parameters.prolog","("], + ["constant.numeric.prolog","1"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["constant.other.atom.prolog","inf"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","N"], + ["punctuation.end.statement.parameters.prolog",")"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["variable.parameter.prolog","U"], + ["meta.fact.prolog"," "], + ["keyword.operator.prolog","is"], + ["meta.fact.prolog"," "], + ["variable.parameter.prolog","N"], + ["meta.fact.prolog"," "], + ["invalid.illegal.invalidchar.prolog","//"], + ["meta.fact.prolog"," "], + ["constant.numeric.prolog","2"], + ["punctuation.separator.parameters.prolog",","] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","findall"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","D"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," ("], + ["constant.other.atom.prolog","between"], + ["punctuation.begin.statement.parameters.prolog","("], + ["constant.numeric.prolog","1"], + ["punctuation.separator.statement.prolog",","], + ["variable.other.prolog","U"], + ["punctuation.separator.statement.prolog",","], + ["variable.other.prolog","D"], + ["punctuation.end.statement.parameters.prolog",")"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","N"], + ["meta.statement.parameters.prolog"," "], + ["constant.other.atom.prolog","mod"], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","D"], + ["meta.statement.parameters.prolog"," "], + ["keyword.operator.prolog","=:="], + ["meta.statement.parameters.prolog"," "], + ["constant.numeric.prolog","0"], + ["punctuation.end.statement.parameters.prolog",")"], + ["punctuation.separator.parameters.prolog",","], + ["meta.fact.prolog"," "], + ["variable.parameter.prolog","Ds"], + ["invalid.illegal.invalidchar.prolog",")"], + ["punctuation.separator.parameters.prolog",","] +],[ + "entity.name.function.fact.prolog", + ["meta.fact.prolog"," "], + ["constant.other.atom.prolog","sumlist"], + ["punctuation.begin.statement.parameters.prolog","("], + ["variable.other.prolog","Ds"], + ["punctuation.separator.statement.prolog",","], + ["meta.statement.parameters.prolog"," "], + ["variable.other.prolog","N"], + ["punctuation.end.statement.parameters.prolog",")"], + ["invalid.illegal.invalidchar.prolog","."] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_rust.json b/lib/ace/mode/_test/tokens_rust.json new file mode 100644 index 00000000..6592575b --- /dev/null +++ b/lib/ace/mode/_test/tokens_rust.json @@ -0,0 +1,136 @@ +[[ + "start", + ["keyword.source.rust","use"], + ["text"," "], + ["support.constant","core::rand::"], + ["text","RngUtil"], + ["keyword.operator",";"] +],[ + "start" +],[ + "start", + ["keyword.source.rust","fn"], + ["meta.function.source.rust"," "], + ["entity.name.function.source.rust","main"], + ["meta.function.source.rust","("], + ["text",") {"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","for"], + ["text"," ["], + ["string.quoted.double.source.rust","\"Alice\""], + ["keyword.operator",","], + ["text"," "], + ["string.quoted.double.source.rust","\"Bob\""], + ["keyword.operator",","], + ["text"," "], + ["string.quoted.double.source.rust","\"Carol\""], + ["text","].each |&name| {"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","do"], + ["text"," spawn {"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","let"], + ["text"," v "], + ["keyword.operator","="], + ["text"," "], + ["support.constant","rand::"], + ["text","Rng().shuffle(["], + ["constant.numeric.integer.source.rust","1"], + ["keyword.operator",","], + ["text"," "], + ["constant.numeric.integer.source.rust","2"], + ["keyword.operator",","], + ["text"," "], + ["constant.numeric.integer.source.rust","3"], + ["text","])"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","for"], + ["text"," v.each |&num| {"] +],[ + "start", + ["text"," print(fmt"], + ["keyword.operator","!"], + ["text","("], + ["string.quoted.double.source.rust","\"%s says: '%d'"], + ["constant.character.escape.source.rust","\\n"], + ["string.quoted.double.source.rust","\""], + ["keyword.operator",","], + ["text"," name"], + ["keyword.operator",","], + ["text"," num "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric.integer.source.rust","1"], + ["text","))"] +],[ + "start", + ["text"," }"] +],[ + "start", + ["text"," }"] +],[ + "start", + ["text"," }"] +],[ + "start", + ["text","}"] +],[ + "start" +],[ + "start", + ["keyword.source.rust","fn"], + ["meta.function.source.rust"," "], + ["entity.name.function.source.rust","map"], + ["meta.function.source.rust","("], + ["text","vector: &[T]"], + ["keyword.operator",","], + ["text"," function: &fn(v: &T) "], + ["keyword.operator","->"], + ["text"," U) "], + ["keyword.operator","->"], + ["text"," ~[U] {"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","let"], + ["text"," "], + ["keyword.source.rust","mut"], + ["text"," accumulator "], + ["keyword.operator","="], + ["text"," ~[]"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","for"], + ["text"," "], + ["support.constant","vec::"], + ["text","each(vector) |element| {"] +],[ + "start", + ["text"," accumulator.push(function(element))"], + ["keyword.operator",";"] +],[ + "start", + ["text"," }"] +],[ + "start", + ["text"," "], + ["keyword.source.rust","return"], + ["text"," accumulator"], + ["keyword.operator",";"] +],[ + "start", + ["text","}"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/forth_highlight_rules.js b/lib/ace/mode/forth_highlight_rules.js index 31ced17b..2fbe76d5 100644 --- a/lib/ace/mode/forth_highlight_rules.js +++ b/lib/ace/mode/forth_highlight_rules.js @@ -79,11 +79,11 @@ var ForthHighlightRules = function() { '#constant': [ { token: 'constant.language.forth', regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'constant.numeric.forth', - regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)', + regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)'}, { token: 'constant.character.forth', - regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)', + regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)'}], '#forth': [ { include: '#constant' }, { include: '#comment' }, @@ -95,14 +95,14 @@ var ForthHighlightRules = function() { '#storage': [ { token: 'storage.type.forth', regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}], '#string': [ { token: 'string.quoted.double.forth', regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")', - caseInsensitive: true, + caseInsensitive: true}, { token: 'string.unquoted.forth', regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}], '#variable': [ { token: 'variable.language.forth', regex: '\\b(?:I|J)\\b', @@ -110,22 +110,22 @@ var ForthHighlightRules = function() { '#word': [ { token: 'keyword.control.immediate.forth', regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.other.immediate.forth', regex: '(?:^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.control.compile-only.forth', regex: '(?:^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.other.compile-only.forth', regex: '(?:^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.other.non-immediate.forth', regex: '(?:^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}, { token: 'keyword.other.warning.forth', regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)', - caseInsensitive: true, + caseInsensitive: true}], '#word-def': [ { token: [ 'keyword.other.compile-only.forth', diff --git a/lib/ace/mode/logiql_test.js b/lib/ace/mode/logiql_test.js index 02e2d4d1..a37b7da2 100644 --- a/lib/ace/mode/logiql_test.js +++ b/lib/ace/mode/logiql_test.js @@ -63,7 +63,7 @@ module.exports = { "test: no auto indent in multi line comment" : function() { assert.equal("", this.mode.getNextLineIndent("start", "/* -->", " ")); assert.equal(" ", this.mode.getNextLineIndent("start", " /* ->", " ")); - assert.equal(" ", this.mode.getNextLineIndent("comment.block0", " abcd", " ")); + assert.equal(" ", this.mode.getNextLineIndent("comment.block", " abcd", " ")); }, "test: no auto indent after -> in single line comment" : function() { diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 8c6417fd..3b683fa5 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -272,7 +272,7 @@ var Tokenizer = function(rules) { if (value) { if (typeof type == "string") { - if ((!rule || rule.merge) && token.type === type) { + if ((!rule || rule.merge !== false) && token.type === type) { token.value += value; } else { if (token.type) From 73ad918a6bf3c0c32d88623151da8387f7eb5620 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 12 Apr 2013 15:09:41 +0400 Subject: [PATCH 11/20] add batch_file highlighting --- demo/kitchen-sink/doclist.js | 1 + demo/kitchen-sink/docs/batch_file.bat | 15 ++++ demo/kitchen-sink/modelist.js | 3 +- lib/ace/mode/batch_file.js | 63 ++++++++++++++ lib/ace/mode/batch_file_highlight_rules.js | 96 ++++++++++++++++++++++ 5 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 demo/kitchen-sink/docs/batch_file.bat create mode 100644 lib/ace/mode/batch_file.js create mode 100644 lib/ace/mode/batch_file_highlight_rules.js diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index 5416e169..893730bc 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -139,6 +139,7 @@ var docs = { "docs/actionscript.as": "ActionScript", "docs/autohotkey.ahk": "AutoHotKey", + "docs/batch_file.bat": "BatchFile", "docs/erlang/erl": "Erlang", "docs/forth.frt": "Forth", "docs/haskell.hs": "Haskell", diff --git a/demo/kitchen-sink/docs/batch_file.bat b/demo/kitchen-sink/docs/batch_file.bat new file mode 100644 index 00000000..c066a9e9 --- /dev/null +++ b/demo/kitchen-sink/docs/batch_file.bat @@ -0,0 +1,15 @@ +:: batch file highlighting in Ace! +@echo off + +CALL set var1=%cd% +echo unhide everything in %var1%! + +:: FOR loop in bat is super strange! +FOR /f "tokens=*" %%G IN ('dir /A:D /b') DO ( +echo %var1%%%G +attrib -r -a -h -s "%var1%%%G" /D /S +) + +pause + +REM that's all diff --git a/demo/kitchen-sink/modelist.js b/demo/kitchen-sink/modelist.js index 2159f531..bc65943e 100644 --- a/demo/kitchen-sink/modelist.js +++ b/demo/kitchen-sink/modelist.js @@ -90,7 +90,7 @@ var modesByName = { scala: ["Scala" , "scala"], scss: ["SCSS" , "scss"], sass: ["SASS" , "sass"], - sh: ["SH" , "sh|bash|bat"], + sh: ["SH" , "sh|bash"], sql: ["SQL" , "sql"], stylus: ["Stylus" , "styl|stylus"], svg: ["SVG" , "svg"], @@ -109,6 +109,7 @@ var modesByName = { abap: ["ABAP" , "abap"], actionscript: ["ActionScript" ,"as"], autohotkey: ["AutoHotKey" , "ahk"], + batch_file: ["BatchFile" , "bat|cmd"], erlang: ["Erlang" ,"erl|hrl"], forth: ["Forth", ,"frt|fs|ldr"], haskell: ["Haskell", "hs"], diff --git a/lib/ace/mode/batch_file.js b/lib/ace/mode/batch_file.js new file mode 100644 index 00000000..b992b9c8 --- /dev/null +++ b/lib/ace/mode/batch_file.js @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var BatchFileHighlightRules = require("./batch_file_highlight_rules").BatchFileHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new BatchFileHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "::"; + this.blockComment = ""; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/batch_file_highlight_rules.js b/lib/ace/mode/batch_file_highlight_rules.js new file mode 100644 index 00000000..488edbb9 --- /dev/null +++ b/lib/ace/mode/batch_file_highlight_rules.js @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from C:\Users\LED\AppData\Roaming\Sublime Text 2\Packages\Batch File\Batch File.tmLanguage (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var BatchFileHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { token: 'keyword.command.dosbatch', + regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b', + caseInsensitive: true }, + { token: 'keyword.control.statement.dosbatch', + regex: '\\b(?:goto|call|exit)\\b', + caseInsensitive: true }, + { token: 'keyword.control.conditional.if.dosbatch', + regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b', + caseInsensitive: true }, + { token: 'keyword.control.conditional.dosbatch', + regex: '\\b(?:if|else)\\b', + caseInsensitive: true }, + { token: 'keyword.control.repeat.dosbatch', + regex: '\\bfor\\b', + caseInsensitive: true }, + { token: 'keyword.operator.dosbatch', + regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' }, + { token: ['doc.comment', 'comment'], + regex: '(?:^|\\b)(rem)($|\\s.*$)', + caseInsensitive: true }, + { token: 'comment.line.colons.dosbatch', + regex: '::.*$' }, + { include: 'variable' }, + { token: 'punctuation.definition.string.begin.shell', + regex: '"', + push: [ + { token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' }, + { include: 'variable' }, + { defaultToken: 'string.quoted.double.dosbatch' } ] }, + { token: 'keyword.operator.pipe.dosbatch', regex: '[|]' }, + { token: 'keyword.operator.redirect.shell', + regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' } ], + variable: [ + { token: 'constant.numeric', regex: '%%\\w+'}, + { token: ['markup.list', 'constant.other', 'markup.list'], + regex: '(%)(\\w+)(%?)' }]} + + this.normalizeRules(); +}; + +BatchFileHighlightRules.metaData = { name: 'Batch File', + scopeName: 'source.dosbatch', + fileTypes: [ 'bat' ] } + + +oop.inherits(BatchFileHighlightRules, TextHighlightRules); + +exports.BatchFileHighlightRules = BatchFileHighlightRules; +}); \ No newline at end of file From cc01912250da7d228d2c7dd3dacf86b8ebe76552 Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 16 Apr 2013 22:23:15 +0400 Subject: [PATCH 12/20] rename snippets syntax highlighter --- ...{tmSnippet.tmSnippet => snippets.snippets} | 50 +++++++++---------- ...ns_tmsnippet.json => tokens_snippets.json} | 0 lib/ace/mode/{tmsnippet.js => snippets.js} | 0 3 files changed, 25 insertions(+), 25 deletions(-) rename demo/kitchen-sink/docs/{tmSnippet.tmSnippet => snippets.snippets} (94%) rename lib/ace/mode/_test/{tokens_tmsnippet.json => tokens_snippets.json} (100%) rename lib/ace/mode/{tmsnippet.js => snippets.js} (100%) diff --git a/demo/kitchen-sink/docs/tmSnippet.tmSnippet b/demo/kitchen-sink/docs/snippets.snippets similarity index 94% rename from demo/kitchen-sink/docs/tmSnippet.tmSnippet rename to demo/kitchen-sink/docs/snippets.snippets index 78282d18..be99f51e 100644 --- a/demo/kitchen-sink/docs/tmSnippet.tmSnippet +++ b/demo/kitchen-sink/docs/snippets.snippets @@ -1,26 +1,26 @@ -# Function -snippet fun - function ${1?:function_name}(${2:argument}) { - ${3:// body...} - } -# Anonymous Function -regex /((=)\s*|(:)\s*|(\()|\b)/f/(\))?/ -name f - function${M1?: ${1:functionName}}($2) { - ${0:$TM_SELECTED_TEXT} - }${M2?;}${M3?,}${M4?)} -# Immediate function -trigger \(?f\( -endTrigger \)? -snippet f( - (function(${1}) { - ${0:${TM_SELECTED_TEXT:/* code */}} - }(${1})); -# if -snippet if - if (${1:true}) { - ${0} - } - - +# Function +snippet fun + function ${1?:function_name}(${2:argument}) { + ${3:// body...} + } +# Anonymous Function +regex /((=)\s*|(:)\s*|(\()|\b)/f/(\))?/ +name f + function${M1?: ${1:functionName}}($2) { + ${0:$TM_SELECTED_TEXT} + }${M2?;}${M3?,}${M4?)} +# Immediate function +trigger \(?f\( +endTrigger \)? +snippet f( + (function(${1}) { + ${0:${TM_SELECTED_TEXT:/* code */}} + }(${1})); +# if +snippet if + if (${1:true}) { + ${0} + } + + \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_tmsnippet.json b/lib/ace/mode/_test/tokens_snippets.json similarity index 100% rename from lib/ace/mode/_test/tokens_tmsnippet.json rename to lib/ace/mode/_test/tokens_snippets.json diff --git a/lib/ace/mode/tmsnippet.js b/lib/ace/mode/snippets.js similarity index 100% rename from lib/ace/mode/tmsnippet.js rename to lib/ace/mode/snippets.js From 689ebf8b480e3bdfd173d18e20a86562e854731f Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 16 Apr 2013 22:24:40 +0400 Subject: [PATCH 13/20] highlight last search result when searchbox is focused --- lib/ace/ext/searchbox.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/ace/ext/searchbox.js b/lib/ace/ext/searchbox.js index a0d8d6da..3eacb580 100644 --- a/lib/ace/ext/searchbox.js +++ b/lib/ace/ext/searchbox.js @@ -122,9 +122,11 @@ var SearchBox = function(editor, range, showReplaceForm) { }); event.addListener(this.searchInput, "focus", function() { _this.activeInput = _this.searchInput; + _this.searchInput.value && _this.highlight(); }); event.addListener(this.replaceInput, "focus", function() { _this.activeInput = _this.replaceInput; + _this.searchInput.value && _this.highlight(); }); }; @@ -199,6 +201,10 @@ var SearchBox = function(editor, range, showReplaceForm) { this.find(false, false); }; + this.highlight = function(re) { + this.editor.session.highlight(re || this.editor.$search.$options.re); + this.editor.renderer.updateBackMarkers() + }; this.find = function(skipCurrent, backwards) { var range = this.editor.find(this.searchInput.value, { skipCurrent: skipCurrent, @@ -209,7 +215,7 @@ var SearchBox = function(editor, range, showReplaceForm) { wholeWord: this.wholeWordOption.checked }); dom.setCssClass(this.searchBox, "ace_nomatch", !range && this.searchInput.value); - this.editor.session.highlight(this.editor.$search.$options.re); + this.highlight(); }; this.findNext = function() { this.find(true, false); From b54a00cb4da3475de1461957a64246fd4738627e Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 17 Apr 2013 15:52:56 +0400 Subject: [PATCH 14/20] add ini mode --- lib/ace/mode/ini.js | 64 +++++++++++++++++++ lib/ace/mode/ini_highlight_rules.js | 98 +++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 lib/ace/mode/ini.js create mode 100644 lib/ace/mode/ini_highlight_rules.js diff --git a/lib/ace/mode/ini.js b/lib/ace/mode/ini.js new file mode 100644 index 00000000..cd21990a --- /dev/null +++ b/lib/ace/mode/ini.js @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Contributor(s): + * + * + * + * ***** END LICENSE BLOCK ***** */ + +/* + THIS FILE WAS AUTOGENERATED BY mode.tmpl.js +*/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var IniHighlightRules = require("./ini_highlight_rules").IniHighlightRules; +// TODO: pick appropriate fold mode +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + var highlighter = new IniHighlightRules(); + this.foldingRules = new FoldMode(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = ";"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. +}).call(Mode.prototype); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/ini_highlight_rules.js b/lib/ace/mode/ini_highlight_rules.js new file mode 100644 index 00000000..75d28c4f --- /dev/null +++ b/lib/ace/mode/ini_highlight_rules.js @@ -0,0 +1,98 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +/* This file was autogenerated from tool\tm bundles\ini.tmbundle\Syntaxes\Ini.plist (uuid: ) */ +/**************************************************************************************** + * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * + * fileTypes * + ****************************************************************************************/ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var IniHighlightRules = function() { + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { start: + [ { token: 'punctuation.definition.comment.ini', + regex: '#', + push: + [ { token: 'comment.line.number-sign.ini', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.number-sign.ini' } ] }, + { token: 'punctuation.definition.comment.ini', + regex: ';', + push: + [ { token: 'comment.line.semicolon.ini', regex: '$', next: 'pop' }, + { defaultToken: 'comment.line.semicolon.ini' } ] }, + { token: + [ 'keyword.other.definition.ini', + 'text', + 'punctuation.separator.key-value.ini' ], + regex: '\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)' }, + { token: + [ 'punctuation.definition.entity.ini', + 'constant.section.group-title.ini', + 'punctuation.definition.entity.ini' ], + regex: '^(\\[)(.*?)(\\])' }, + { token: 'punctuation.definition.string.begin.ini', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.ini', + regex: '\'', + next: 'pop' }, + { token: 'constant.character.escape.ini', regex: '\\\\.' }, + { defaultToken: 'string.quoted.single.ini' } ] }, + { token: 'punctuation.definition.string.begin.ini', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.ini', + regex: '"', + next: 'pop' }, + { defaultToken: 'string.quoted.double.ini' } ] } ] } + + this.normalizeRules(); +}; + +IniHighlightRules.metaData = { fileTypes: [ 'ini', 'conf' ], + keyEquivalent: '^~I', + name: 'Ini', + scopeName: 'source.ini' } + + +oop.inherits(IniHighlightRules, TextHighlightRules); + +exports.IniHighlightRules = IniHighlightRules; +}); \ No newline at end of file From 635da1f2ea5c37ef9ca69bb3bf134921510c9db8 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 17 Apr 2013 16:12:44 +0400 Subject: [PATCH 15/20] temporary workaround for tokenizer not working for rules ending with $ --- lib/ace/mode/actionscript_highlight_rules.js | 4 ++-- lib/ace/mode/clojure_highlight_rules.js | 2 +- lib/ace/mode/erlang_highlight_rules.js | 4 ++-- lib/ace/mode/haskell_highlight_rules.js | 4 ++-- lib/ace/mode/ini_highlight_rules.js | 8 ++++---- lib/ace/mode/pascal_highlight_rules.js | 8 ++++---- lib/ace/mode/rust_highlight_rules.js | 8 ++++---- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/ace/mode/actionscript_highlight_rules.js b/lib/ace/mode/actionscript_highlight_rules.js index 52a80391..1f30d9c2 100644 --- a/lib/ace/mode/actionscript_highlight_rules.js +++ b/lib/ace/mode/actionscript_highlight_rules.js @@ -87,8 +87,8 @@ var ActionScriptHighlightRules = function() { next: 'pop' }, { defaultToken: 'comment.block.actionscript.2' } ] }, { token: 'punctuation.definition.comment.actionscript.2', - regex: '//', - push: + regex: '//.*$', + push_: [ { token: 'comment.line.double-slash.actionscript.2', regex: '$', next: 'pop' }, diff --git a/lib/ace/mode/clojure_highlight_rules.js b/lib/ace/mode/clojure_highlight_rules.js index 08d64425..cd0e38ca 100644 --- a/lib/ace/mode/clojure_highlight_rules.js +++ b/lib/ace/mode/clojure_highlight_rules.js @@ -170,7 +170,7 @@ var ClojureHighlightRules = function() { regex : '"', next: "string" }, { - token : "string", // symbol + token : "constant", // symbol regex : /:[\w*+!\-_?:\/]+/ }, { token : "string.regexp", //Regular Expressions diff --git a/lib/ace/mode/erlang_highlight_rules.js b/lib/ace/mode/erlang_highlight_rules.js index c225431c..5ee7bfb5 100644 --- a/lib/ace/mode/erlang_highlight_rules.js +++ b/lib/ace/mode/erlang_highlight_rules.js @@ -119,8 +119,8 @@ var ErlangHighlightRules = function() { { token: 'invalid.illegal.character.erlang', regex: '\\$.?' } ], '#comment': [ { token: 'punctuation.definition.comment.erlang', - regex: '%', - push: + regex: '%.*$', + push_: [ { token: 'comment.line.percentage.erlang', regex: '$', next: 'pop' }, diff --git a/lib/ace/mode/haskell_highlight_rules.js b/lib/ace/mode/haskell_highlight_rules.js index 9ecf68ad..fdfaa53e 100644 --- a/lib/ace/mode/haskell_highlight_rules.js +++ b/lib/ace/mode/haskell_highlight_rules.js @@ -171,8 +171,8 @@ var HaskellHighlightRules = function() { { defaultToken: 'comment.block.haskell' } ] } ], '#comments': [ { token: 'punctuation.definition.comment.haskell', - regex: '--', - push: + regex: '--.*', + push_: [ { token: 'comment.line.double-dash.haskell', regex: '$', next: 'pop' }, diff --git a/lib/ace/mode/ini_highlight_rules.js b/lib/ace/mode/ini_highlight_rules.js index 75d28c4f..b4c152a4 100644 --- a/lib/ace/mode/ini_highlight_rules.js +++ b/lib/ace/mode/ini_highlight_rules.js @@ -46,15 +46,15 @@ var IniHighlightRules = function() { this.$rules = { start: [ { token: 'punctuation.definition.comment.ini', - regex: '#', - push: + regex: '#.*', + push_: [ { token: 'comment.line.number-sign.ini', regex: '$', next: 'pop' }, { defaultToken: 'comment.line.number-sign.ini' } ] }, { token: 'punctuation.definition.comment.ini', - regex: ';', - push: + regex: ';.*', + push_: [ { token: 'comment.line.semicolon.ini', regex: '$', next: 'pop' }, { defaultToken: 'comment.line.semicolon.ini' } ] }, { token: diff --git a/lib/ace/mode/pascal_highlight_rules.js b/lib/ace/mode/pascal_highlight_rules.js index 527bc1a8..ac8a4180 100644 --- a/lib/ace/mode/pascal_highlight_rules.js +++ b/lib/ace/mode/pascal_highlight_rules.js @@ -69,15 +69,15 @@ var PascalHighlightRules = function() { { token: 'constant.numeric.pascal', regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b' }, { token: 'punctuation.definition.comment.pascal', - regex: '--', - push: + regex: '--.*$', + push_: [ { token: 'comment.line.double-dash.pascal.one', regex: '$', next: 'pop' }, { defaultToken: 'comment.line.double-dash.pascal.one' } ] }, { token: 'punctuation.definition.comment.pascal', - regex: '//', - push: + regex: '//.*$', + push_: [ { token: 'comment.line.double-slash.pascal.two', regex: '$', next: 'pop' }, diff --git a/lib/ace/mode/rust_highlight_rules.js b/lib/ace/mode/rust_highlight_rules.js index 817cb65e..acb6c92a 100644 --- a/lib/ace/mode/rust_highlight_rules.js +++ b/lib/ace/mode/rust_highlight_rules.js @@ -89,15 +89,15 @@ var RustHighlightRules = function() { { token: 'constant.numeric.float.source.rust', regex: '[0-9][0-9_]*(?:f32|f64|f)|[0-9][0-9_]*[eE][+-]=[0-9_]+|[0-9][0-9_]*[eE][+-]=[0-9_]+(?:f32|f64|f)|[0-9][0-9_]*\\.[0-9_]+|[0-9][0-9_]*\\.[0-9_]+(?:f32|f64|f)|[0-9][0-9_]*\\.[0-9_]+%[eE][+-]=[0-9_]+|[0-9][0-9_]*\\.[0-9_]+%[eE][+-]=[0-9_]+(?:f32|f64|f)' }, { token: 'comment.line.documentation.source.rust', - regex: '//!', - push: + regex: '//!.*$', + push_: [ { token: 'comment.line.documentation.source.rust', regex: '$', next: 'pop' }, { defaultToken: 'comment.line.documentation.source.rust' } ] }, { token: 'comment.line.double-dash.source.rust', - regex: '//', - push: + regex: '//.*$', + push_: [ { token: 'comment.line.double-dash.source.rust', regex: '$', next: 'pop' }, From 35563c5e84617677c81b3be37117681f8bb2528b Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 17 Apr 2013 16:15:58 +0400 Subject: [PATCH 16/20] update modelist extension --- demo/kitchen-sink/demo.js | 2 +- demo/kitchen-sink/doclist.js | 2 +- demo/kitchen-sink/modelist.js | 138 ------------- demo/kitchen-sink/util.js | 4 +- lib/ace/ext/modelist.js | 195 ++++++++++-------- lib/ace/mode/{batch_file.js => batchfile.js} | 2 +- ..._rules.js => batchfile_highlight_rules.js} | 0 7 files changed, 110 insertions(+), 233 deletions(-) delete mode 100644 demo/kitchen-sink/modelist.js rename lib/ace/mode/{batch_file.js => batchfile.js} (96%) rename lib/ace/mode/{batch_file_highlight_rules.js => batchfile_highlight_rules.js} (100%) diff --git a/demo/kitchen-sink/demo.js b/demo/kitchen-sink/demo.js index e624541a..9465dc60 100644 --- a/demo/kitchen-sink/demo.js +++ b/demo/kitchen-sink/demo.js @@ -451,7 +451,7 @@ event.addListener(container, "drop", function(e) { if (window.FileReader) { var reader = new FileReader(); reader.onload = function() { - var mode = modelist.getModeFromPath(file.name); + var mode = modelist.getModeForPath(file.name); env.editor.session.doc.setValue(reader.result); modeEl.value = mode.name; diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index 64c388eb..2f634549 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -51,7 +51,7 @@ function initDoc(file, path, doc) { session.setUseWrapMode(true); session.setWrapLimitRange(80, 80); } - var mode = modelist.getModeFromPath(path); + var mode = modelist.getModeForPath(path); session.modeName = mode.name; session.setMode(mode.mode); return session; diff --git a/demo/kitchen-sink/modelist.js b/demo/kitchen-sink/modelist.js deleted file mode 100644 index 380e72dc..00000000 --- a/demo/kitchen-sink/modelist.js +++ /dev/null @@ -1,138 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -/************** modes ***********************/ -var modes = []; -function getModeFromPath(path) { - var mode = modesByName.text; - var fileName = path.split(/[\/\\]/).pop(); - for (var i = 0; i < modes.length; i++) { - if (modes[i].supportsFile(fileName)) { - mode = modes[i]; - break; - } - } - return mode; -} - -var Mode = function(name, desc, extensions) { - this.name = name; - this.desc = desc; - this.mode = "ace/mode/" + name; - if (/\^/.test(extensions)) { - var re = extensions.replace(/\|(\^)?/g, function(a, b){ - return "$|" + (b ? "^" : "^.*\\."); - }) + "$"; - } else { - var re = "^.*\\.(" + extensions + ")$"; - } - - this.extRe = new RegExp(re, "gi"); -}; - -Mode.prototype.supportsFile = function(filename) { - return filename.match(this.extRe); -}; - -var modesByName = { - asciidoc: ["AsciiDoc" , "asciidoc"], - c9search: ["C9Search" , "c9search_results"], - coffee: ["CoffeeScript" , "^Cakefile|coffee|cf|cson"], - coldfusion: ["ColdFusion" , "cfm"], - csharp: ["C#" , "cs"], - css: ["CSS" , "css"], - curly: ["Curly" , "curly"], - dart: ["Dart" , "dart"], - diff: ["Diff" , "diff|patch"], - dot: ["Dot" , "dot"], - ftl: ["FreeMarker" , "ftl"], - glsl: ["Glsl" , "glsl|frag|vert"], - golang: ["Go" , "go"], - groovy: ["Groovy" , "groovy"], - haxe: ["haXe" , "hx"], - haml: ["HAML" , "haml"], - html: ["HTML" , "htm|html|xhtml"], - c_cpp: ["C/C++" , "c|cc|cpp|cxx|h|hh|hpp"], - clojure: ["Clojure" , "clj"], - jade: ["Jade" , "jade"], - java: ["Java" , "java"], - jsp: ["JSP" , "jsp"], - javascript: ["JavaScript" , "js"], - json: ["JSON" , "json"], - jsx: ["JSX" , "jsx"], - latex: ["LaTeX" , "latex|tex|ltx|bib"], - less: ["LESS" , "less"], - lisp: ["Lisp" , "lisp"], - scheme: ["Scheme" , "scm|rkt"], - liquid: ["Liquid" , "liquid"], - livescript: ["LiveScript" , "ls"], - logiql: ["LogiQL" , "logic|lql"], - lua: ["Lua" , "lua"], - luapage: ["LuaPage" , "lp"], // http://keplerproject.github.com/cgilua/manual.html#templates - lucene: ["Lucene" , "lucene"], - lsl: ["LSL" , "lsl"], - makefile: ["Makefile" , "^GNUmakefile|^makefile|^Makefile|^OCamlMakefile|make"], - markdown: ["Markdown" , "md|markdown"], - mushcode: ["TinyMUSH" , "mc|mush"], - objectivec: ["Objective-C" , "m"], - ocaml: ["OCaml" , "ml|mli"], - pascal: ["Pascal" , "pas|p"], - perl: ["Perl" , "pl|pm"], - pgsql: ["pgSQL" , "pgsql"], - php: ["PHP" , "php|phtml"], - powershell: ["Powershell" , "ps1"], - properties: ["Properties" , "properties"], - python: ["Python" , "py"], - r: ["R" , "r"], - rdoc: ["RDoc" , "Rd"], - rhtml: ["RHTML" , "Rhtml"], - ruby: ["Ruby" , "ru|gemspec|rake|rb"], - scad: ["OpenSCAD" , "scad"], - scala: ["Scala" , "scala"], - scss: ["SCSS" , "scss"], - sass: ["SASS" , "sass"], - sh: ["SH" , "sh|bash"], - sql: ["SQL" , "sql"], - stylus: ["Stylus" , "styl|stylus"], - svg: ["SVG" , "svg"], - tcl: ["Tcl" , "tcl"], - tex: ["Tex" , "tex"], - text: ["Text" , "txt"], - textile: ["Textile" , "textile"], - tmsnippet: ["tmSnippet" , "tmSnippet"], - toml: ["Toml" , "toml"], - typescript: ["Typescript" , "typescript|ts|str"], - vbscript: ["VBScript" , "vbs"], - velocity: ["Velocity" , "vm"], - xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], - xquery: ["XQuery" , "xq"], - jsoniq: ["JSONiq" , "jq"], - yaml: ["YAML" , "yaml"], - - abap: ["ABAP" , "abap"], - actionscript: ["ActionScript" ,"as"], - autohotkey: ["AutoHotKey" , "ahk"], - batch_file: ["BatchFile" , "bat|cmd"], - erlang: ["Erlang" ,"erl|hrl"], - forth: ["Forth", ,"frt|fs|ldr"], - haskell: ["Haskell", "hs"], - julia: ["Julia", "jl"], - prolog: ["Prolog", "plg|prolog"], - rust: ["Rust", "rs"] -}; - -for (var name in modesByName) { - var mode = modesByName[name]; - mode = new Mode(name, mode[0], mode[1]); - modesByName[name] = mode; - modes.push(mode); -} - -module.exports = { - getModeFromPath: getModeFromPath, - modes: modes, - modesByName: modesByName -}; - -}); - diff --git a/demo/kitchen-sink/util.js b/demo/kitchen-sink/util.js index 752e79ba..337eaeb6 100644 --- a/demo/kitchen-sink/util.js +++ b/demo/kitchen-sink/util.js @@ -220,8 +220,8 @@ function elt(tag, attributes, content) { function optgroup(values) { return values.map(function(item) { if (typeof item == "string") - item = {name: item, desc: item}; - return elt("option", {value: item.name}, item.desc); + item = {name: item, caption: item}; + return elt("option", {value: item.name}, item.caption || item.desc); }); } diff --git a/lib/ace/ext/modelist.js b/lib/ace/ext/modelist.js index 27f8bb6e..a008a6d8 100644 --- a/lib/ace/ext/modelist.js +++ b/lib/ace/ext/modelist.js @@ -1,10 +1,6 @@ define(function(require, exports, module) { "use strict"; -/************** modes ***********************/ -/** - * An array containing information about rendering modes. - */ var modes = []; /** * Suggests a mode based on the file extension present in the given path @@ -12,7 +8,7 @@ var modes = []; * @returns {object} Returns an object containing information about the * suggested mode. */ -function getModeFromPath(path) { +function getModeForPath(path) { var mode = modesByName.text; var fileName = path.split(/[\/\\]/).pop(); for (var i = 0; i < modes.length; i++) { @@ -24,10 +20,11 @@ function getModeFromPath(path) { return mode; } -var Mode = function(name, desc, extensions) { +var Mode = function(name, caption, extensions) { this.name = name; - this.desc = desc; + this.caption = caption; this.mode = "ace/mode/" + name; + this.extensions = extensions; if (/\^/.test(extensions)) { var re = extensions.replace(/\|(\^)?/g, function(a, b){ return "$|" + (b ? "^" : "^.*\\."); @@ -43,95 +40,113 @@ Mode.prototype.supportsFile = function(filename) { return filename.match(this.extRe); }; -/** - * An object containing properties that map to rendering modes. Each property - * contains an array where element 0 is the name of the mode and element 1 - * contains information about the file extensions where this mode is - * applicable. - */ -var modesByName = { - abap: ["ABAP" , "abap"], - asciidoc: ["AsciiDoc" , "asciidoc"], - c9search: ["C9Search" , "c9search_results"], - coffee: ["CoffeeScript" , "^Cakefile|coffee|cf|cson"], - coldfusion: ["ColdFusion" , "cfm"], - csharp: ["C#" , "cs"], - css: ["CSS" , "css"], - curly: ["Curly" , "curly"], - dart: ["Dart" , "dart"], - diff: ["Diff" , "diff|patch"], - dot: ["Dot" , "dot"], - ftl: ["FreeMarker" , "ftl"], - glsl: ["Glsl" , "glsl|frag|vert"], - golang: ["Go" , "go"], - groovy: ["Groovy" , "groovy"], - haxe: ["haXe" , "hx"], - haml: ["HAML" , "haml"], - html: ["HTML" , "htm|html|xhtml"], - c_cpp: ["C/C++" , "c|cc|cpp|cxx|h|hh|hpp"], - clojure: ["Clojure" , "clj"], - jade: ["Jade" , "jade"], - java: ["Java" , "java"], - jsp: ["JSP" , "jsp"], - javascript: ["JavaScript" , "js"], - json: ["JSON" , "json"], - jsx: ["JSX" , "jsx"], - latex: ["LaTeX" , "latex|tex|ltx|bib"], - less: ["LESS" , "less"], - lisp: ["Lisp" , "lisp"], - scheme: ["Scheme" , "scm|rkt"], - liquid: ["Liquid" , "liquid"], - livescript: ["LiveScript" , "ls"], - logiql: ["LogiQL" , "logic|lql"], - lua: ["Lua" , "lua"], - luapage: ["LuaPage" , "lp"], // http://keplerproject.github.com/cgilua/manual.html#templates - lucene: ["Lucene" , "lucene"], - lsl: ["LSL" , "lsl"], - makefile: ["Makefile" , "^GNUmakefile|^makefile|^Makefile|^OCamlMakefile|make"], - markdown: ["Markdown" , "md|markdown"], - mushcode: ["TinyMUSH" , "mc|mush"], - objectivec: ["Objective-C" , "m"], - ocaml: ["OCaml" , "ml|mli"], - pascal: ["Pascal" , "pas|p"], - perl: ["Perl" , "pl|pm"], - pgsql: ["pgSQL" , "pgsql"], - php: ["PHP" , "php|phtml"], - powershell: ["Powershell" , "ps1"], - python: ["Python" , "py"], - r: ["R" , "r"], - rdoc: ["RDoc" , "Rd"], - rhtml: ["RHTML" , "Rhtml"], - ruby: ["Ruby" , "ru|gemspec|rake|rb"], - scad: ["OpenSCAD" , "scad"], - scala: ["Scala" , "scala"], - scss: ["SCSS" , "scss"], - sass: ["SASS" , "sass"], - sh: ["SH" , "sh|bash|bat"], - sql: ["SQL" , "sql"], - stylus: ["Stylus" , "styl|stylus"], - svg: ["SVG" , "svg"], - tcl: ["Tcl" , "tcl"], - tex: ["Tex" , "tex"], - text: ["Text" , "txt"], - textile: ["Textile" , "textile"], - tmsnippet: ["tmSnippet" , "tmSnippet"], - toml: ["toml" , "toml"], - typescript: ["Typescript" , "typescript|ts|str"], - vbscript: ["VBScript" , "vbs"], - xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], - xquery: ["XQuery" , "xq"], - yaml: ["YAML" , "yaml"] +// todo firstlinematch +var supportedModes = { + ABAP: ["abap"], + ActionScript:["as"], + AsciiDoc: ["asciidoc"], + AutoHotKey: ["ahk"], + BatchFile: ["bat|cmd"], + C9Search: ["c9search_results"], + C_Cpp: ["c|cc|cpp|cxx|h|hh|hpp"], + Clojure: ["clj"], + coffee: ["^Cakefile|coffee|cf|cson"], + ColdFusion: ["cfm"], + CSharp: ["cs"], + CSS: ["css"], + Curly: ["curly"], + Dart: ["dart"], + Diff: ["diff|patch"], + Dot: ["dot"], + Erlang: ["erl|hrl"], + Forth: ["frt|fs|ldr"], + FreeMarker: ["ftl"], + Glsl: ["glsl|frag|vert"], + golang: ["go"], + Groovy: ["groovy"], + HAML: ["haml"], + Haskell: ["hs"], + haXe: ["hx"], + HTML: ["htm|html|xhtml"], + Ini: ["Ini|conf"], + Jade: ["jade"], + Java: ["java"], + JavaScript: ["js"], + JSON: ["json"], + JSONiq: ["jq"], + JSP: ["jsp"], + JSX: ["jsx"], + Julia: ["jl"], + LaTeX: ["latex|tex|ltx|bib"], + LESS: ["less"], + Liquid: ["liquid"], + Lisp: ["lisp"], + LiveScript: ["ls"], + LogiQL: ["logic|lql"], + LSL: ["lsl"], + Lua: ["lua"], + LuaPage: ["lp"], + Lucene: ["lucene"], + Makefile: ["^GNUmakefile|^makefile|^Makefile|^OCamlMakefile|make"], + Markdown: ["md|markdown"], + MUSHCode: ["mc|mush"], + ObjectiveC: ["m"], + OCaml: ["ml|mli"], + Pascal: ["pas|p"], + Perl: ["pl|pm"], + pgSQL: ["pgsql"], + PHP: ["php|phtml"], + Powershell: ["ps1"], + Prolog: ["plg|prolog"], + Properties: ["properties"], + Python: ["py"], + R: ["r"], + RDoc: ["Rd"], + RHTML: ["Rhtml"], + Ruby: ["ru|gemspec|rake|rb"], + Rust: ["rs"], + SASS: ["sass"], + SCAD: ["scad"], + Scala: ["scala"], + Scheme: ["scm|rkt"], + SCSS: ["scss"], + SH: ["sh|bash"], + snippets: ["snippets"], + SQL: ["sql"], + Stylus: ["styl|stylus"], + SVG: ["svg"], + Tcl: ["tcl"], + Tex: ["tex"], + Text: ["txt"], + Textile: ["textile"], + Toml: ["toml"], + Typescript: ["typescript|ts|str"], + VBScript: ["vbs"], + Velocity: ["vm"], + XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], + XQuery: ["xq"], + YAML: ["yaml"] }; -for (var name in modesByName) { - var mode = modesByName[name]; - mode = new Mode(name, mode[0], mode[1]); - modesByName[name] = mode; +var nameOverrides = { + ObjectiveC: "Objective-C", + CSharp: "C#", + golang: "Go", + C_Cpp: "C/C++", + coffee: "CoffeeScript" +}; +var modesByName = {}; +for (var name in supportedModes) { + var data = supportedModes[name]; + var displayName = nameOverrides[name] || name; + var filename = name.toLowerCase(); + mode = new Mode(filename, displayName, data[0]); + modesByName[filename] = mode; modes.push(mode); } module.exports = { - getModeFromPath: getModeFromPath, + getModeForPath: getModeForPath, modes: modes, modesByName: modesByName }; diff --git a/lib/ace/mode/batch_file.js b/lib/ace/mode/batchfile.js similarity index 96% rename from lib/ace/mode/batch_file.js rename to lib/ace/mode/batchfile.js index b992b9c8..5b293c0b 100644 --- a/lib/ace/mode/batch_file.js +++ b/lib/ace/mode/batchfile.js @@ -43,7 +43,7 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; var Tokenizer = require("../tokenizer").Tokenizer; -var BatchFileHighlightRules = require("./batch_file_highlight_rules").BatchFileHighlightRules; +var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules; var FoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { diff --git a/lib/ace/mode/batch_file_highlight_rules.js b/lib/ace/mode/batchfile_highlight_rules.js similarity index 100% rename from lib/ace/mode/batch_file_highlight_rules.js rename to lib/ace/mode/batchfile_highlight_rules.js From 834d0aee9fbe9626fde8db5cc1a71b0da7aa54c4 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 17 Apr 2013 16:28:59 +0400 Subject: [PATCH 17/20] update tests --- demo/kitchen-sink/doclist.js | 8 +++--- .../docs/{batch_file.bat => batchfile.bat} | 0 demo/kitchen-sink/docs/dart.dart | 4 +-- .../docs/{tinymush.mc => mushcode.mc} | 0 lib/ace/mode/_test/tokens_actionscript.json | 27 +++++++------------ lib/ace/mode/_test/tokens_erlang.json | 9 +++---- lib/ace/mode/_test/tokens_haskell.json | 18 +++++-------- lib/ace/mode/_test/tokens_pascal.json | 6 ++--- 8 files changed, 27 insertions(+), 45 deletions(-) rename demo/kitchen-sink/docs/{batch_file.bat => batchfile.bat} (100%) rename demo/kitchen-sink/docs/{tinymush.mc => mushcode.mc} (100%) diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index 2f634549..93d5a321 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -65,8 +65,8 @@ function makeHuge(txt) { } var docs = { - "docs/AsciiDoc.asciidoc": "AsciiDoc", "docs/javascript.js": "JavaScript", + "docs/AsciiDoc.asciidoc": "AsciiDoc", "docs/clojure.clj": "Clojure", "docs/coffeescript.coffee": "CoffeeScript", "docs/coldfusion.cfm": "ColdFusion", @@ -102,7 +102,7 @@ var docs = { "docs/luapage.lp": "LuaPage", "docs/Makefile": "Makefile", "docs/markdown.md": {name: "Markdown", wrapped: true}, - "docs/tinymush.mc": {name: "TinyMUSH", wrapped: true}, + "docs/mushcode.mc": {name: "MUSHCode", wrapped: true}, "docs/objectivec.m": {name: "Objective-C"}, "docs/ocaml.ml": "OCaml", "docs/OpenSCAD.scad": "OpenSCAD", @@ -129,7 +129,7 @@ var docs = { "docs/tcl.tcl": "Tcl", "docs/tex.tex": "Tex", "docs/textile.textile": {name: "Textile", wrapped: true}, - "docs/tmSnippet.tmSnippet": "tmSnippet", + "docs/snippets.snippets": "snippets", "docs/toml.toml": "TOML", "docs/typescript.ts": "Typescript", "docs/vbscript.vbs": "VBScript", @@ -141,7 +141,7 @@ var docs = { "docs/actionscript.as": "ActionScript", "docs/autohotkey.ahk": "AutoHotKey", - "docs/batch_file.bat": "BatchFile", + "docs/batchfile.bat": "BatchFile", "docs/erlang/erl": "Erlang", "docs/forth.frt": "Forth", "docs/haskell.hs": "Haskell", diff --git a/demo/kitchen-sink/docs/batch_file.bat b/demo/kitchen-sink/docs/batchfile.bat similarity index 100% rename from demo/kitchen-sink/docs/batch_file.bat rename to demo/kitchen-sink/docs/batchfile.bat diff --git a/demo/kitchen-sink/docs/dart.dart b/demo/kitchen-sink/docs/dart.dart index 8700c8cd..cdb43c38 100644 --- a/demo/kitchen-sink/docs/dart.dart +++ b/demo/kitchen-sink/docs/dart.dart @@ -14,8 +14,8 @@ asdad 77 .86 -#import("http://dartwatch.com/myOtherLibrary.dart"); -#import("myOtherLibrary.dart", prefix:"lib1"); +import("http://dartwatch.com/myOtherLibrary.dart"); +import("myOtherLibrary.dart", prefix:"lib1"); """asdasdads asdadsadsasd diff --git a/demo/kitchen-sink/docs/tinymush.mc b/demo/kitchen-sink/docs/mushcode.mc similarity index 100% rename from demo/kitchen-sink/docs/tinymush.mc rename to demo/kitchen-sink/docs/mushcode.mc diff --git a/lib/ace/mode/_test/tokens_actionscript.json b/lib/ace/mode/_test/tokens_actionscript.json index 00223583..e3fad38f 100644 --- a/lib/ace/mode/_test/tokens_actionscript.json +++ b/lib/ace/mode/_test/tokens_actionscript.json @@ -45,13 +45,11 @@ ],[ "start", ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2","*************************"] + ["punctuation.definition.comment.actionscript.2","//*************************"] ],[ "start", ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2"," Properties:"] + ["punctuation.definition.comment.actionscript.2","// Properties:"] ],[ "start", ["text","\t\t"] @@ -71,8 +69,7 @@ ],[ "start", ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2"," Color offsets"] + ["punctuation.definition.comment.actionscript.2","// Color offsets"] ],[ "start", ["text","\t\t"], @@ -87,21 +84,18 @@ ["text"," "], ["constant.numeric.actionscript.2","0"], ["text",";\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2"," R"] + ["punctuation.definition.comment.actionscript.2","// R"] ],[ "start", ["text","\t\t"] ],[ "start", ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2","*************************"] + ["punctuation.definition.comment.actionscript.2","//*************************"] ],[ "start", ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2"," Constructor:"] + ["punctuation.definition.comment.actionscript.2","// Constructor:"] ],[ "start", ["text","\t\t"] @@ -121,8 +115,7 @@ ],[ "start", ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2"," Respond to mouse events"] + ["punctuation.definition.comment.actionscript.2","// Respond to mouse events"] ],[ "start", ["text","\t\t\tswatch1_btn."], @@ -145,8 +138,7 @@ ],[ "start", ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2"," Respond to drag events"] + ["punctuation.definition.comment.actionscript.2","// Respond to drag events"] ],[ "start", ["text","\t\t\tred_slider."], @@ -158,8 +150,7 @@ ],[ "start", ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","//"], - ["comment.line.double-slash.actionscript.2"," Draw a frame later"] + ["punctuation.definition.comment.actionscript.2","// Draw a frame later"] ],[ "start", ["text","\t\t\t"], diff --git a/lib/ace/mode/_test/tokens_erlang.json b/lib/ace/mode/_test/tokens_erlang.json index 5a1fa366..8a828976 100644 --- a/lib/ace/mode/_test/tokens_erlang.json +++ b/lib/ace/mode/_test/tokens_erlang.json @@ -1,13 +1,11 @@ [[ "start", ["text"," "], - ["punctuation.definition.comment.erlang","%"], - ["comment.line.percentage.erlang","% A process whose only job is to keep a counter."] + ["punctuation.definition.comment.erlang","%% A process whose only job is to keep a counter."] ],[ "start", ["text"," "], - ["punctuation.definition.comment.erlang","%"], - ["comment.line.percentage.erlang","% First version"] + ["punctuation.definition.comment.erlang","%% First version"] ],[ "start", ["meta.directive.module.erlang"," "], @@ -141,8 +139,7 @@ ],[ ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], ["meta.expression.receive.erlang"," "], - ["punctuation.definition.comment.erlang","%"], - ["comment.line.percentage.erlang"," Force the use of 'codeswitch/1' from the latest MODULE version"] + ["punctuation.definition.comment.erlang","% Force the use of 'codeswitch/1' from the latest MODULE version"] ],[ "start", ["meta.expression.receive.erlang"," "], diff --git a/lib/ace/mode/_test/tokens_haskell.json b/lib/ace/mode/_test/tokens_haskell.json index 2d2d3b6e..8f9a2b38 100644 --- a/lib/ace/mode/_test/tokens_haskell.json +++ b/lib/ace/mode/_test/tokens_haskell.json @@ -1,7 +1,6 @@ [[ "start", - ["punctuation.definition.comment.haskell","--"], - ["comment.line.double-dash.haskell"," Type annotation (optional)"] + ["punctuation.definition.comment.haskell","-- Type annotation (optional)"] ],[ "start", ["entity.name.function.haskell","fib"], @@ -18,8 +17,7 @@ ["text"," "] ],[ "start", - ["punctuation.definition.comment.haskell","--"], - ["comment.line.double-dash.haskell"," With self-referencing data"] + ["punctuation.definition.comment.haskell","-- With self-referencing data"] ],[ "start", ["text","fib n "], @@ -47,15 +45,13 @@ ],[ "start", ["text"," "], - ["punctuation.definition.comment.haskell","--"], - ["comment.line.double-dash.haskell"," 0,1,1,2,3,5,..."] + ["punctuation.definition.comment.haskell","-- 0,1,1,2,3,5,..."] ],[ "start", ["text"," "] ],[ "start", - ["punctuation.definition.comment.haskell","--"], - ["comment.line.double-dash.haskell"," Same, coded directly"] + ["punctuation.definition.comment.haskell","-- Same, coded directly"] ],[ "start", ["text","fib n "], @@ -96,8 +92,7 @@ ["text"," "] ],[ "start", - ["punctuation.definition.comment.haskell","--"], - ["comment.line.double-dash.haskell"," Similar idea, using zipWith"] + ["punctuation.definition.comment.haskell","-- Similar idea, using zipWith"] ],[ "start", ["text","fib n "], @@ -131,8 +126,7 @@ ["text"," "] ],[ "start", - ["punctuation.definition.comment.haskell","--"], - ["comment.line.double-dash.haskell"," Using a generator function"] + ["punctuation.definition.comment.haskell","-- Using a generator function"] ],[ "start", ["text","fib n "], diff --git a/lib/ace/mode/_test/tokens_pascal.json b/lib/ace/mode/_test/tokens_pascal.json index 85f47a64..22c1f0c4 100644 --- a/lib/ace/mode/_test/tokens_pascal.json +++ b/lib/ace/mode/_test/tokens_pascal.json @@ -1,12 +1,12 @@ [[ - "punctuation.definition.comment.pascal1", + "punctuation.definition.comment.pascal", ["punctuation.definition.comment.pascal","(*"], ["comment.block.pascal.one","****************************************************************************"] ],[ - "punctuation.definition.comment.pascal1", + "punctuation.definition.comment.pascal", ["comment.block.pascal.one"," * A simple bubble sort program. Reads integers, one per line, and prints *"] ],[ - "punctuation.definition.comment.pascal1", + "punctuation.definition.comment.pascal", ["comment.block.pascal.one"," * them out in sorted order. Blows up if there are more than 49. *"] ],[ "start", From 94e919ad82feccde6417105d58fcc48bbc90bbbd Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 17 Apr 2013 22:20:50 +0400 Subject: [PATCH 18/20] fix #1372 . in clojure symbols isn't highlighted --- lib/ace/mode/clojure_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/clojure_highlight_rules.js b/lib/ace/mode/clojure_highlight_rules.js index cd0e38ca..5197f426 100644 --- a/lib/ace/mode/clojure_highlight_rules.js +++ b/lib/ace/mode/clojure_highlight_rules.js @@ -171,7 +171,7 @@ var ClojureHighlightRules = function() { next: "string" }, { token : "constant", // symbol - regex : /:[\w*+!\-_?:\/]+/ + regex : /:[\w*+!\-_?:\/#$%*.<=>]+/ }, { token : "string.regexp", //Regular Expressions regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g' From 03f6c8fda8e47bbffdd753c769eba2d8be8db07a Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 18 Apr 2013 10:20:41 +0400 Subject: [PATCH 19/20] tweak clojure symbol highlighting --- lib/ace/mode/clojure_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/clojure_highlight_rules.js b/lib/ace/mode/clojure_highlight_rules.js index 5197f426..6d69c035 100644 --- a/lib/ace/mode/clojure_highlight_rules.js +++ b/lib/ace/mode/clojure_highlight_rules.js @@ -171,7 +171,7 @@ var ClojureHighlightRules = function() { next: "string" }, { token : "constant", // symbol - regex : /:[\w*+!\-_?:\/#$%*.<=>]+/ + regex : /:[^()\[\]{}'"\^%`,;]+/ }, { token : "string.regexp", //Regular Expressions regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g' From b85c89975565ac48148d4444a894eb2205cb5187 Mon Sep 17 00:00:00 2001 From: Harutyun Amirjanyan Date: Fri, 19 Apr 2013 19:10:56 +0400 Subject: [PATCH 20/20] do not include spaces in clojure symbols --- lib/ace/mode/clojure_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/clojure_highlight_rules.js b/lib/ace/mode/clojure_highlight_rules.js index 6d69c035..f7e28d87 100644 --- a/lib/ace/mode/clojure_highlight_rules.js +++ b/lib/ace/mode/clojure_highlight_rules.js @@ -171,7 +171,7 @@ var ClojureHighlightRules = function() { next: "string" }, { token : "constant", // symbol - regex : /:[^()\[\]{}'"\^%`,;]+/ + regex : /:[^()\[\]{}'"\^%`,;\s]+/ }, { token : "string.regexp", //Regular Expressions regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g'