wagn 1.14.4 → 1.14.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/controllers/card_controller.rb +4 -3
- data/db/bootstrap/card_actions.yml +597 -583
- data/db/bootstrap/card_acts.yml +2 -2
- data/db/bootstrap/card_changes.yml +297 -248
- data/db/bootstrap/card_references.yml +3111 -1284
- data/db/bootstrap/cards.yml +1067 -1022
- data/db/migrate_core_cards/20141208132416_partial_reference_type.rb +7 -0
- data/db/migrate_core_cards/20141208162106_add_ace_script.rb +12 -0
- data/db/migrate_core_cards/20141230204340_uri_codename.rb +13 -0
- data/db/version_core_cards.txt +1 -1
- data/features/history.feature +2 -1
- data/features/layouts.feature +4 -0
- data/features/navbox.feature +1 -0
- data/features/step_definitions/wagn_steps.rb +6 -1
- data/features/support/env.rb +1 -1
- data/lib/card/env.rb +1 -1
- data/lib/card/format.rb +35 -48
- data/lib/card/loader.rb +9 -9
- data/lib/card/mailer.rb +0 -2
- data/lib/card/query.rb +8 -8
- data/lib/card/query/{card_spec.rb → card_clause.rb} +42 -42
- data/lib/card/query/{spec.rb → clause.rb} +3 -3
- data/lib/card/query/ref_clause.rb +47 -0
- data/lib/card/query/value_clause.rb +65 -0
- data/lib/card/reference.rb +11 -20
- data/lib/card/set.rb +6 -6
- data/lib/card/set_pattern.rb +5 -1
- data/lib/wagn/commands.rb +28 -14
- data/lib/wagn/config/environments/test.rb +3 -0
- data/lib/wagn/generators/wagn/templates/Gemfile +6 -0
- data/lib/wagn/generators/wagn/templates/Rakefile +1 -0
- data/lib/wagn/generators/wagn/templates/config/application.rb +1 -0
- data/lib/wagn/generators/wagn/templates/spec/javascripts/support/deck_jasmine.yml +56 -0
- data/lib/wagn/generators/wagn/templates/spec/javascripts/support/wagn_jasmine.yml +69 -0
- data/lib/wagn/generators/wagn/wagn_generator.rb +19 -2
- data/lib/wagn/migration.rb +10 -0
- data/lib/wagn/spec_helper.rb +2 -0
- data/lib/wagn/tasks/wagn.rake +9 -16
- data/mod/01_core/chunk/link.rb +2 -2
- data/mod/01_core/chunk/uri.rb +4 -4
- data/mod/01_core/format/html_format.rb +43 -280
- data/mod/01_core/set/all/active_card.rb +2 -0
- data/mod/01_core/set/all/collection.rb +19 -1
- data/mod/01_core/set/all/fetch.rb +5 -0
- data/mod/01_core/set/all/initialize.rb +1 -1
- data/mod/01_core/set/all/references.rb +25 -8
- data/mod/01_core/set/all/templating.rb +1 -1
- data/mod/01_core/set/all/tracked_attributes.rb +1 -1
- data/mod/01_core/set/all/type.rb +1 -1
- data/mod/01_core/set/all/utils.rb +1 -0
- data/mod/01_core/set_pattern/07_type_plus_right.rb +2 -1
- data/mod/01_core/spec/format/html_format_spec.rb +0 -2
- data/mod/01_core/spec/set/all/initialize_spec.rb +4 -4
- data/mod/01_core/spec/set/all/notify_spec.rb +9 -9
- data/mod/02_basic_types/set/type/pointer.rb +19 -8
- data/mod/03_machines/lib/javascript/ace.js +18204 -0
- data/mod/03_machines/lib/javascript/jquery-ui.js +13109 -11440
- data/mod/03_machines/lib/javascript/jquery.autosize.js +52 -33
- data/mod/03_machines/lib/javascript/jquery.fileupload.js +10 -8
- data/mod/03_machines/lib/javascript/jquery.iframe-transport.js +44 -16
- data/mod/03_machines/lib/javascript/jquery.js +4 -9473
- data/mod/03_machines/lib/javascript/jquery_ujs.js +156 -116
- data/mod/03_machines/lib/javascript/jquerymobile.js +14890 -8236
- data/mod/03_machines/lib/javascript/theme-textmate.js +130 -0
- data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +50 -10
- data/mod/03_machines/set/self/script_ace.rb +8 -0
- data/mod/03_machines/set/type/coffee_script.rb +1 -1
- data/mod/03_machines/set/type/css.rb +0 -2
- data/mod/03_machines/set/type/java_script.rb +1 -1
- data/mod/03_machines/spec/lib/{machine_spec.rb → shared_machine_examples.rb} +0 -0
- data/mod/03_machines/spec/lib/{machine_input_spec.rb → shared_machine_input_examples.rb} +0 -0
- data/mod/03_machines/spec/set/type/scss_spec.rb +2 -2
- data/mod/04_settings/set/right/comment.rb +2 -2
- data/mod/04_settings/set/type/setting.rb +2 -2
- data/mod/04_settings/spec/set/right/structure_spec.rb +2 -2
- data/mod/04_settings/spec/set/right/style_spec.rb +1 -1
- data/mod/05_email/set/type/email_template.rb +3 -2
- data/mod/05_standard/set/all/all_css.rb +1 -1
- data/mod/05_standard/set/all/all_js.rb +1 -1
- data/mod/05_standard/set/all/attach.rb +8 -7
- data/mod/05_standard/set/all/base.rb +6 -34
- data/mod/05_standard/set/all/editing.rb +145 -0
- data/mod/05_standard/set/all/error.rb +203 -0
- data/mod/05_standard/set/all/follow.rb +2 -2
- data/mod/05_standard/set/all/form.rb +211 -0
- data/mod/05_standard/set/all/header.rb +60 -0
- data/mod/05_standard/set/all/history.rb +3 -3
- data/mod/05_standard/set/all/links.rb +101 -0
- data/mod/05_standard/set/all/rich_html.rb +14 -392
- data/mod/05_standard/set/all/wrapper.rb +74 -0
- data/mod/05_standard/set/right/account.rb +1 -2
- data/mod/05_standard/set/rstar/rules.rb +5 -5
- data/mod/05_standard/set/self/account_links.rb +8 -4
- data/mod/05_standard/set/self/head.rb +3 -3
- data/mod/05_standard/set/self/signin.rb +5 -3
- data/mod/05_standard/set/type/search_type.rb +25 -25
- data/mod/05_standard/set/type/set.rb +2 -2
- data/mod/05_standard/set/type/signup.rb +0 -2
- data/mod/05_standard/set/type/uri.rb +11 -0
- data/mod/05_standard/spec/set/all/rich_html_spec.rb +6 -6
- data/mod/05_standard/spec/set/all/rss_spec.rb +1 -1
- data/mod/05_standard/spec/set/type/signup_spec.rb +0 -1
- data/mod/05_standard/spec/set/type/uri_spec.rb +41 -0
- data/public/assets/ace/mode-coffee.js +1 -0
- data/public/assets/ace/mode-css.js +1 -0
- data/public/assets/ace/mode-html.js +1 -0
- data/public/assets/ace/mode-javascript.js +1 -0
- data/public/assets/ace/mode-json.js +1 -0
- data/public/assets/ace/mode-scss.js +922 -0
- data/public/assets/ace/theme-github.js +98 -0
- data/public/assets/ace/theme-textmate.js +1 -0
- data/public/assets/ace/worker-coffee.js +1 -0
- data/public/assets/ace/worker-css.js +1 -0
- data/public/assets/ace/worker-html.js +1 -0
- data/public/assets/ace/worker-javascript.js +1 -0
- data/public/assets/ace/worker-json.js +1 -0
- data/spec/controllers/card_controller_spec.rb +0 -1
- data/spec/controllers/location_spec.rb +0 -2
- data/spec/javascripts/helpers/jasmine-jquery.js +812 -0
- data/spec/javascripts/support/jasmine.yml +8 -6
- data/spec/javascripts/support/jasmine_config.rb +1 -1
- data/spec/javascripts/support/jasmine_runner.rb +1 -1
- data/spec/javascripts/wagn_spec.coffee +2 -0
- data/spec/lib/card/content_spec.rb +28 -6
- data/spec/lib/card/format_spec.rb +62 -15
- data/spec/lib/card/reference_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -2
- data/test/fixtures/card_actions.yml +1260 -1239
- data/test/fixtures/card_acts.yml +347 -341
- data/test/fixtures/card_changes.yml +2345 -2276
- data/test/fixtures/card_references.yml +4098 -1606
- data/test/fixtures/cards.yml +1950 -1887
- metadata +39 -13
- data/lib/card/query/ref_spec.rb +0 -37
- data/lib/card/query/value_spec.rb +0 -65
- data/lib/wagn/location.rb +0 -93
- data/spec/javascripts/helpers/jasmine-config.js +0 -2
- data/spec/javascripts/helpers/jasmine-jquery-1.3.1.js +0 -295
@@ -0,0 +1 @@
|
|
1
|
+
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[{token:"comment",regex:"\\/\\/",next:"line_comment"},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+r+")(\\.)(prototype)(\\.)("+r+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+r+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:r},{token:"keyword.operator",regex:/--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],start:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/",next:"line_comment_regex_allowed"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:r},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],comment:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],line_comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"$|^",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],line_comment:[i.getTagRule(),{token:"comment",regex:"$|^",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!e||!e.noES6)&&this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)return n.unshift("start",t),"paren";if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(o,s),t.JavaScriptHighlightRules=o}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var p=r.getTokens(o.start.row),d=0,v,m=-1;for(var g=0;g<p.length;g++){v=p[g],v.type=="string"?m=-1:m<0&&(m=v.value.indexOf(s));if(v.value.length+d>o.start.column)break;d+=p[g].value.length}if(!v||m<0&&v.type!=="comment"&&(v.type!=="string"||o.start.column!==v.value.length+d-1&&v.value.lastIndexOf(s)===v.value.length-1)){if(!h.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(v&&v.type==="string"){var y=f.substring(a.column,a.column+1);if(y==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n),s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)}}.call(o.prototype)}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../range").Range,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(c.prototype),t.Mode=c})
|
@@ -0,0 +1 @@
|
|
1
|
+
define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"invalid.illegal",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'[^"\\\\]+'},{token:"string",regex:'"',next:"start"},{token:"string",regex:"",next:"start"}]}};r.inherits(s,i),t.JsonHighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var p=r.getTokens(o.start.row),d=0,v,m=-1;for(var g=0;g<p.length;g++){v=p[g],v.type=="string"?m=-1:m<0&&(m=v.value.indexOf(s));if(v.value.length+d>o.start.column)break;d+=p[g].value.length}if(!v||m<0&&v.type!=="comment"&&(v.type!=="string"||o.start.column!==v.value.length+d-1&&v.value.lastIndexOf(s)===v.value.length-1)){if(!h.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(v&&v.type==="string"){var y=f.substring(a.column,a.column+1);if(y==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n),s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)}}.call(o.prototype)}),define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./behaviour/cstyle").CstyleBehaviour,a=e("./folding/cstyle").FoldMode,f=e("../worker/worker_client").WorkerClient,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(l,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);if(e=="start"){var i=t.match(/^.*[\{\(\[]\s*$/);i&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations([t.data])}),t.on("ok",function(){e.clearAnnotations()}),t},this.$id="ace/mode/json"}.call(l.prototype),t.Mode=l})
|
@@ -0,0 +1,922 @@
|
|
1
|
+
define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var oop = require("../lib/oop");
|
5
|
+
var lang = require("../lib/lang");
|
6
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
7
|
+
|
8
|
+
var ScssHighlightRules = function() {
|
9
|
+
|
10
|
+
var properties = lang.arrayToMap( (function () {
|
11
|
+
|
12
|
+
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
|
13
|
+
|
14
|
+
var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
|
15
|
+
"background-size|binding|border-bottom-colors|border-left-colors|" +
|
16
|
+
"border-right-colors|border-top-colors|border-end|border-end-color|" +
|
17
|
+
"border-end-style|border-end-width|border-image|border-start|" +
|
18
|
+
"border-start-color|border-start-style|border-start-width|box-align|" +
|
19
|
+
"box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
|
20
|
+
"box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
|
21
|
+
"column-rule-width|column-rule-style|column-rule-color|float-edge|" +
|
22
|
+
"font-feature-settings|font-language-override|force-broken-image-icon|" +
|
23
|
+
"image-region|margin-end|margin-start|opacity|outline|outline-color|" +
|
24
|
+
"outline-offset|outline-radius|outline-radius-bottomleft|" +
|
25
|
+
"outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
|
26
|
+
"outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
|
27
|
+
"tab-size|text-blink|text-decoration-color|text-decoration-line|" +
|
28
|
+
"text-decoration-style|transform|transform-origin|transition|" +
|
29
|
+
"transition-delay|transition-duration|transition-property|" +
|
30
|
+
"transition-timing-function|user-focus|user-input|user-modify|user-select|" +
|
31
|
+
"window-shadow|border-radius").split("|");
|
32
|
+
|
33
|
+
var properties = ("azimuth|background-attachment|background-color|background-image|" +
|
34
|
+
"background-position|background-repeat|background|border-bottom-color|" +
|
35
|
+
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
|
36
|
+
"border-color|border-left-color|border-left-style|border-left-width|" +
|
37
|
+
"border-left|border-right-color|border-right-style|border-right-width|" +
|
38
|
+
"border-right|border-spacing|border-style|border-top-color|" +
|
39
|
+
"border-top-style|border-top-width|border-top|border-width|border|bottom|" +
|
40
|
+
"box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
|
41
|
+
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
|
42
|
+
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
|
43
|
+
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
|
44
|
+
"letter-spacing|line-height|list-style-image|list-style-position|" +
|
45
|
+
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
|
46
|
+
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
|
47
|
+
"min-width|opacity|orphans|outline-color|" +
|
48
|
+
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
|
49
|
+
"padding-left|padding-right|padding-top|padding|page-break-after|" +
|
50
|
+
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
|
51
|
+
"pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
|
52
|
+
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
|
53
|
+
"stress|table-layout|text-align|text-decoration|text-indent|" +
|
54
|
+
"text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
|
55
|
+
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
|
56
|
+
"z-index").split("|");
|
57
|
+
var ret = [];
|
58
|
+
for (var i=0, ln=browserPrefix.length; i<ln; i++) {
|
59
|
+
Array.prototype.push.apply(
|
60
|
+
ret,
|
61
|
+
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
|
62
|
+
);
|
63
|
+
}
|
64
|
+
Array.prototype.push.apply(ret, prefixProperties);
|
65
|
+
Array.prototype.push.apply(ret, properties);
|
66
|
+
|
67
|
+
return ret;
|
68
|
+
|
69
|
+
})() );
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
var functions = lang.arrayToMap(
|
74
|
+
("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" +
|
75
|
+
"alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" +
|
76
|
+
"floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" +
|
77
|
+
"nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" +
|
78
|
+
"scale_color|transparentize|type_of|unit|unitless|unqoute").split("|")
|
79
|
+
);
|
80
|
+
|
81
|
+
var constants = lang.arrayToMap(
|
82
|
+
("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
|
83
|
+
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
|
84
|
+
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
|
85
|
+
"decimal-leading-zero|decimal|default|disabled|disc|" +
|
86
|
+
"distribute-all-lines|distribute-letter|distribute-space|" +
|
87
|
+
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
|
88
|
+
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
|
89
|
+
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
|
90
|
+
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
|
91
|
+
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
|
92
|
+
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
|
93
|
+
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
|
94
|
+
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
|
95
|
+
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
|
96
|
+
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
|
97
|
+
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
|
98
|
+
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
|
99
|
+
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
|
100
|
+
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
|
101
|
+
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
|
102
|
+
"zero").split("|")
|
103
|
+
);
|
104
|
+
|
105
|
+
var colors = lang.arrayToMap(
|
106
|
+
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
|
107
|
+
"purple|red|silver|teal|white|yellow").split("|")
|
108
|
+
);
|
109
|
+
|
110
|
+
var keywords = lang.arrayToMap(
|
111
|
+
("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|")
|
112
|
+
)
|
113
|
+
|
114
|
+
var tags = lang.arrayToMap(
|
115
|
+
("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
|
116
|
+
"big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
|
117
|
+
"command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
|
118
|
+
"figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
|
119
|
+
"header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
|
120
|
+
"link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
|
121
|
+
"option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
|
122
|
+
"small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
|
123
|
+
"textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
|
124
|
+
);
|
125
|
+
|
126
|
+
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
|
127
|
+
|
128
|
+
this.$rules = {
|
129
|
+
"start" : [
|
130
|
+
{
|
131
|
+
token : "comment",
|
132
|
+
regex : "\\/\\/.*$"
|
133
|
+
},
|
134
|
+
{
|
135
|
+
token : "comment", // multi line comment
|
136
|
+
regex : "\\/\\*",
|
137
|
+
next : "comment"
|
138
|
+
}, {
|
139
|
+
token : "string", // single line
|
140
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
141
|
+
}, {
|
142
|
+
token : "string", // multi line string start
|
143
|
+
regex : '["].*\\\\$',
|
144
|
+
next : "qqstring"
|
145
|
+
}, {
|
146
|
+
token : "string", // single line
|
147
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
148
|
+
}, {
|
149
|
+
token : "string", // multi line string start
|
150
|
+
regex : "['].*\\\\$",
|
151
|
+
next : "qstring"
|
152
|
+
}, {
|
153
|
+
token : "constant.numeric",
|
154
|
+
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
|
155
|
+
}, {
|
156
|
+
token : "constant.numeric", // hex6 color
|
157
|
+
regex : "#[a-f0-9]{6}"
|
158
|
+
}, {
|
159
|
+
token : "constant.numeric", // hex3 color
|
160
|
+
regex : "#[a-f0-9]{3}"
|
161
|
+
}, {
|
162
|
+
token : "constant.numeric",
|
163
|
+
regex : numRe
|
164
|
+
}, {
|
165
|
+
token : ["support.function", "string", "support.function"],
|
166
|
+
regex : "(url\\()(.*)(\\))"
|
167
|
+
}, {
|
168
|
+
token : function(value) {
|
169
|
+
if (properties.hasOwnProperty(value.toLowerCase()))
|
170
|
+
return "support.type";
|
171
|
+
if (keywords.hasOwnProperty(value))
|
172
|
+
return "keyword";
|
173
|
+
else if (constants.hasOwnProperty(value))
|
174
|
+
return "constant.language";
|
175
|
+
else if (functions.hasOwnProperty(value))
|
176
|
+
return "support.function";
|
177
|
+
else if (colors.hasOwnProperty(value.toLowerCase()))
|
178
|
+
return "support.constant.color";
|
179
|
+
else if (tags.hasOwnProperty(value.toLowerCase()))
|
180
|
+
return "variable.language";
|
181
|
+
else
|
182
|
+
return "text";
|
183
|
+
},
|
184
|
+
regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
|
185
|
+
}, {
|
186
|
+
token : "variable",
|
187
|
+
regex : "[a-z_\\-$][a-z0-9_\\-$]*\\b"
|
188
|
+
}, {
|
189
|
+
token: "variable.language",
|
190
|
+
regex: "#[a-z0-9-_]+"
|
191
|
+
}, {
|
192
|
+
token: "variable.language",
|
193
|
+
regex: "\\.[a-z0-9-_]+"
|
194
|
+
}, {
|
195
|
+
token: "variable.language",
|
196
|
+
regex: ":[a-z0-9-_]+"
|
197
|
+
}, {
|
198
|
+
token: "constant",
|
199
|
+
regex: "[a-z0-9-_]+"
|
200
|
+
}, {
|
201
|
+
token : "keyword.operator",
|
202
|
+
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
|
203
|
+
}, {
|
204
|
+
token : "paren.lparen",
|
205
|
+
regex : "[[({]"
|
206
|
+
}, {
|
207
|
+
token : "paren.rparen",
|
208
|
+
regex : "[\\])}]"
|
209
|
+
}, {
|
210
|
+
token : "text",
|
211
|
+
regex : "\\s+"
|
212
|
+
}, {
|
213
|
+
caseInsensitive: true
|
214
|
+
}
|
215
|
+
],
|
216
|
+
"comment" : [
|
217
|
+
{
|
218
|
+
token : "comment", // closing comment
|
219
|
+
regex : ".*?\\*\\/",
|
220
|
+
next : "start"
|
221
|
+
}, {
|
222
|
+
token : "comment", // comment spanning whole line
|
223
|
+
regex : ".+"
|
224
|
+
}
|
225
|
+
],
|
226
|
+
"qqstring" : [
|
227
|
+
{
|
228
|
+
token : "string",
|
229
|
+
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
230
|
+
next : "start"
|
231
|
+
}, {
|
232
|
+
token : "string",
|
233
|
+
regex : '.+'
|
234
|
+
}
|
235
|
+
],
|
236
|
+
"qstring" : [
|
237
|
+
{
|
238
|
+
token : "string",
|
239
|
+
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
|
240
|
+
next : "start"
|
241
|
+
}, {
|
242
|
+
token : "string",
|
243
|
+
regex : '.+'
|
244
|
+
}
|
245
|
+
]
|
246
|
+
};
|
247
|
+
};
|
248
|
+
|
249
|
+
oop.inherits(ScssHighlightRules, TextHighlightRules);
|
250
|
+
|
251
|
+
exports.ScssHighlightRules = ScssHighlightRules;
|
252
|
+
|
253
|
+
});
|
254
|
+
|
255
|
+
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
|
256
|
+
"use strict";
|
257
|
+
|
258
|
+
var Range = require("../range").Range;
|
259
|
+
|
260
|
+
var MatchingBraceOutdent = function() {};
|
261
|
+
|
262
|
+
(function() {
|
263
|
+
|
264
|
+
this.checkOutdent = function(line, input) {
|
265
|
+
if (! /^\s+$/.test(line))
|
266
|
+
return false;
|
267
|
+
|
268
|
+
return /^\s*\}/.test(input);
|
269
|
+
};
|
270
|
+
|
271
|
+
this.autoOutdent = function(doc, row) {
|
272
|
+
var line = doc.getLine(row);
|
273
|
+
var match = line.match(/^(\s*\})/);
|
274
|
+
|
275
|
+
if (!match) return 0;
|
276
|
+
|
277
|
+
var column = match[1].length;
|
278
|
+
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
279
|
+
|
280
|
+
if (!openBracePos || openBracePos.row == row) return 0;
|
281
|
+
|
282
|
+
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
283
|
+
doc.replace(new Range(row, 0, row, column-1), indent);
|
284
|
+
};
|
285
|
+
|
286
|
+
this.$getIndent = function(line) {
|
287
|
+
return line.match(/^\s*/)[0];
|
288
|
+
};
|
289
|
+
|
290
|
+
}).call(MatchingBraceOutdent.prototype);
|
291
|
+
|
292
|
+
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
293
|
+
});
|
294
|
+
|
295
|
+
define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
|
296
|
+
"use strict";
|
297
|
+
|
298
|
+
var oop = require("../../lib/oop");
|
299
|
+
var Behaviour = require("../behaviour").Behaviour;
|
300
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
301
|
+
var lang = require("../../lib/lang");
|
302
|
+
|
303
|
+
var SAFE_INSERT_IN_TOKENS =
|
304
|
+
["text", "paren.rparen", "punctuation.operator"];
|
305
|
+
var SAFE_INSERT_BEFORE_TOKENS =
|
306
|
+
["text", "paren.rparen", "punctuation.operator", "comment"];
|
307
|
+
|
308
|
+
var context;
|
309
|
+
var contextCache = {};
|
310
|
+
var initContext = function(editor) {
|
311
|
+
var id = -1;
|
312
|
+
if (editor.multiSelect) {
|
313
|
+
id = editor.selection.index;
|
314
|
+
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
315
|
+
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
316
|
+
}
|
317
|
+
if (contextCache[id])
|
318
|
+
return context = contextCache[id];
|
319
|
+
context = contextCache[id] = {
|
320
|
+
autoInsertedBrackets: 0,
|
321
|
+
autoInsertedRow: -1,
|
322
|
+
autoInsertedLineEnd: "",
|
323
|
+
maybeInsertedBrackets: 0,
|
324
|
+
maybeInsertedRow: -1,
|
325
|
+
maybeInsertedLineStart: "",
|
326
|
+
maybeInsertedLineEnd: ""
|
327
|
+
};
|
328
|
+
};
|
329
|
+
|
330
|
+
var CstyleBehaviour = function() {
|
331
|
+
this.add("braces", "insertion", function(state, action, editor, session, text) {
|
332
|
+
var cursor = editor.getCursorPosition();
|
333
|
+
var line = session.doc.getLine(cursor.row);
|
334
|
+
if (text == '{') {
|
335
|
+
initContext(editor);
|
336
|
+
var selection = editor.getSelectionRange();
|
337
|
+
var selected = session.doc.getTextRange(selection);
|
338
|
+
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
|
339
|
+
return {
|
340
|
+
text: '{' + selected + '}',
|
341
|
+
selection: false
|
342
|
+
};
|
343
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
344
|
+
if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
|
345
|
+
CstyleBehaviour.recordAutoInsert(editor, session, "}");
|
346
|
+
return {
|
347
|
+
text: '{}',
|
348
|
+
selection: [1, 1]
|
349
|
+
};
|
350
|
+
} else {
|
351
|
+
CstyleBehaviour.recordMaybeInsert(editor, session, "{");
|
352
|
+
return {
|
353
|
+
text: '{',
|
354
|
+
selection: [1, 1]
|
355
|
+
};
|
356
|
+
}
|
357
|
+
}
|
358
|
+
} else if (text == '}') {
|
359
|
+
initContext(editor);
|
360
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
361
|
+
if (rightChar == '}') {
|
362
|
+
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
363
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
364
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
365
|
+
return {
|
366
|
+
text: '',
|
367
|
+
selection: [1, 1]
|
368
|
+
};
|
369
|
+
}
|
370
|
+
}
|
371
|
+
} else if (text == "\n" || text == "\r\n") {
|
372
|
+
initContext(editor);
|
373
|
+
var closing = "";
|
374
|
+
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
|
375
|
+
closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
|
376
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
377
|
+
}
|
378
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
379
|
+
if (rightChar === '}') {
|
380
|
+
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}');
|
381
|
+
if (!openBracePos)
|
382
|
+
return null;
|
383
|
+
var next_indent = this.$getIndent(session.getLine(openBracePos.row));
|
384
|
+
} else if (closing) {
|
385
|
+
var next_indent = this.$getIndent(line);
|
386
|
+
} else {
|
387
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
388
|
+
return;
|
389
|
+
}
|
390
|
+
var indent = next_indent + session.getTabString();
|
391
|
+
|
392
|
+
return {
|
393
|
+
text: '\n' + indent + '\n' + next_indent + closing,
|
394
|
+
selection: [1, indent.length, 1, indent.length]
|
395
|
+
};
|
396
|
+
} else {
|
397
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
398
|
+
}
|
399
|
+
});
|
400
|
+
|
401
|
+
this.add("braces", "deletion", function(state, action, editor, session, range) {
|
402
|
+
var selected = session.doc.getTextRange(range);
|
403
|
+
if (!range.isMultiLine() && selected == '{') {
|
404
|
+
initContext(editor);
|
405
|
+
var line = session.doc.getLine(range.start.row);
|
406
|
+
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
407
|
+
if (rightChar == '}') {
|
408
|
+
range.end.column++;
|
409
|
+
return range;
|
410
|
+
} else {
|
411
|
+
context.maybeInsertedBrackets--;
|
412
|
+
}
|
413
|
+
}
|
414
|
+
});
|
415
|
+
|
416
|
+
this.add("parens", "insertion", function(state, action, editor, session, text) {
|
417
|
+
if (text == '(') {
|
418
|
+
initContext(editor);
|
419
|
+
var selection = editor.getSelectionRange();
|
420
|
+
var selected = session.doc.getTextRange(selection);
|
421
|
+
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
422
|
+
return {
|
423
|
+
text: '(' + selected + ')',
|
424
|
+
selection: false
|
425
|
+
};
|
426
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
427
|
+
CstyleBehaviour.recordAutoInsert(editor, session, ")");
|
428
|
+
return {
|
429
|
+
text: '()',
|
430
|
+
selection: [1, 1]
|
431
|
+
};
|
432
|
+
}
|
433
|
+
} else if (text == ')') {
|
434
|
+
initContext(editor);
|
435
|
+
var cursor = editor.getCursorPosition();
|
436
|
+
var line = session.doc.getLine(cursor.row);
|
437
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
438
|
+
if (rightChar == ')') {
|
439
|
+
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
440
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
441
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
442
|
+
return {
|
443
|
+
text: '',
|
444
|
+
selection: [1, 1]
|
445
|
+
};
|
446
|
+
}
|
447
|
+
}
|
448
|
+
}
|
449
|
+
});
|
450
|
+
|
451
|
+
this.add("parens", "deletion", function(state, action, editor, session, range) {
|
452
|
+
var selected = session.doc.getTextRange(range);
|
453
|
+
if (!range.isMultiLine() && selected == '(') {
|
454
|
+
initContext(editor);
|
455
|
+
var line = session.doc.getLine(range.start.row);
|
456
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
457
|
+
if (rightChar == ')') {
|
458
|
+
range.end.column++;
|
459
|
+
return range;
|
460
|
+
}
|
461
|
+
}
|
462
|
+
});
|
463
|
+
|
464
|
+
this.add("brackets", "insertion", function(state, action, editor, session, text) {
|
465
|
+
if (text == '[') {
|
466
|
+
initContext(editor);
|
467
|
+
var selection = editor.getSelectionRange();
|
468
|
+
var selected = session.doc.getTextRange(selection);
|
469
|
+
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
470
|
+
return {
|
471
|
+
text: '[' + selected + ']',
|
472
|
+
selection: false
|
473
|
+
};
|
474
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
475
|
+
CstyleBehaviour.recordAutoInsert(editor, session, "]");
|
476
|
+
return {
|
477
|
+
text: '[]',
|
478
|
+
selection: [1, 1]
|
479
|
+
};
|
480
|
+
}
|
481
|
+
} else if (text == ']') {
|
482
|
+
initContext(editor);
|
483
|
+
var cursor = editor.getCursorPosition();
|
484
|
+
var line = session.doc.getLine(cursor.row);
|
485
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
486
|
+
if (rightChar == ']') {
|
487
|
+
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
488
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
489
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
490
|
+
return {
|
491
|
+
text: '',
|
492
|
+
selection: [1, 1]
|
493
|
+
};
|
494
|
+
}
|
495
|
+
}
|
496
|
+
}
|
497
|
+
});
|
498
|
+
|
499
|
+
this.add("brackets", "deletion", function(state, action, editor, session, range) {
|
500
|
+
var selected = session.doc.getTextRange(range);
|
501
|
+
if (!range.isMultiLine() && selected == '[') {
|
502
|
+
initContext(editor);
|
503
|
+
var line = session.doc.getLine(range.start.row);
|
504
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
505
|
+
if (rightChar == ']') {
|
506
|
+
range.end.column++;
|
507
|
+
return range;
|
508
|
+
}
|
509
|
+
}
|
510
|
+
});
|
511
|
+
|
512
|
+
this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
|
513
|
+
if (text == '"' || text == "'") {
|
514
|
+
initContext(editor);
|
515
|
+
var quote = text;
|
516
|
+
var selection = editor.getSelectionRange();
|
517
|
+
var selected = session.doc.getTextRange(selection);
|
518
|
+
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
|
519
|
+
return {
|
520
|
+
text: quote + selected + quote,
|
521
|
+
selection: false
|
522
|
+
};
|
523
|
+
} else {
|
524
|
+
var cursor = editor.getCursorPosition();
|
525
|
+
var line = session.doc.getLine(cursor.row);
|
526
|
+
var leftChar = line.substring(cursor.column-1, cursor.column);
|
527
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
528
|
+
|
529
|
+
var token = session.getTokenAt(cursor.row, cursor.column);
|
530
|
+
var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);
|
531
|
+
if (leftChar == "\\" && token && /escape/.test(token.type))
|
532
|
+
return null;
|
533
|
+
|
534
|
+
var stringBefore = token && /string/.test(token.type);
|
535
|
+
var stringAfter = !rightToken || /string/.test(rightToken.type);
|
536
|
+
|
537
|
+
var pair;
|
538
|
+
if (rightChar == quote) {
|
539
|
+
pair = stringBefore !== stringAfter;
|
540
|
+
} else {
|
541
|
+
if (stringBefore && !stringAfter)
|
542
|
+
return null; // wrap string with different quote
|
543
|
+
if (stringBefore && stringAfter)
|
544
|
+
return null; // do not pair quotes inside strings
|
545
|
+
var wordRe = session.$mode.tokenRe;
|
546
|
+
wordRe.lastIndex = 0;
|
547
|
+
var isWordBefore = wordRe.test(leftChar);
|
548
|
+
wordRe.lastIndex = 0;
|
549
|
+
var isWordAfter = wordRe.test(leftChar);
|
550
|
+
if (isWordBefore || isWordAfter)
|
551
|
+
return null; // before or after alphanumeric
|
552
|
+
if (rightChar && !/[\s;,.})\]\\]/.test(rightChar))
|
553
|
+
return null; // there is rightChar and it isn't closing
|
554
|
+
pair = true;
|
555
|
+
}
|
556
|
+
return {
|
557
|
+
text: pair ? quote + quote : "",
|
558
|
+
selection: [1,1]
|
559
|
+
};
|
560
|
+
}
|
561
|
+
}
|
562
|
+
});
|
563
|
+
|
564
|
+
this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
|
565
|
+
var selected = session.doc.getTextRange(range);
|
566
|
+
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
567
|
+
initContext(editor);
|
568
|
+
var line = session.doc.getLine(range.start.row);
|
569
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
570
|
+
if (rightChar == selected) {
|
571
|
+
range.end.column++;
|
572
|
+
return range;
|
573
|
+
}
|
574
|
+
}
|
575
|
+
});
|
576
|
+
|
577
|
+
};
|
578
|
+
|
579
|
+
|
580
|
+
CstyleBehaviour.isSaneInsertion = function(editor, session) {
|
581
|
+
var cursor = editor.getCursorPosition();
|
582
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
583
|
+
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
|
584
|
+
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
|
585
|
+
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
|
586
|
+
return false;
|
587
|
+
}
|
588
|
+
iterator.stepForward();
|
589
|
+
return iterator.getCurrentTokenRow() !== cursor.row ||
|
590
|
+
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
|
591
|
+
};
|
592
|
+
|
593
|
+
CstyleBehaviour.$matchTokenType = function(token, types) {
|
594
|
+
return types.indexOf(token.type || token) > -1;
|
595
|
+
};
|
596
|
+
|
597
|
+
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
598
|
+
var cursor = editor.getCursorPosition();
|
599
|
+
var line = session.doc.getLine(cursor.row);
|
600
|
+
if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
|
601
|
+
context.autoInsertedBrackets = 0;
|
602
|
+
context.autoInsertedRow = cursor.row;
|
603
|
+
context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
604
|
+
context.autoInsertedBrackets++;
|
605
|
+
};
|
606
|
+
|
607
|
+
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
|
608
|
+
var cursor = editor.getCursorPosition();
|
609
|
+
var line = session.doc.getLine(cursor.row);
|
610
|
+
if (!this.isMaybeInsertedClosing(cursor, line))
|
611
|
+
context.maybeInsertedBrackets = 0;
|
612
|
+
context.maybeInsertedRow = cursor.row;
|
613
|
+
context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
|
614
|
+
context.maybeInsertedLineEnd = line.substr(cursor.column);
|
615
|
+
context.maybeInsertedBrackets++;
|
616
|
+
};
|
617
|
+
|
618
|
+
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
619
|
+
return context.autoInsertedBrackets > 0 &&
|
620
|
+
cursor.row === context.autoInsertedRow &&
|
621
|
+
bracket === context.autoInsertedLineEnd[0] &&
|
622
|
+
line.substr(cursor.column) === context.autoInsertedLineEnd;
|
623
|
+
};
|
624
|
+
|
625
|
+
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
|
626
|
+
return context.maybeInsertedBrackets > 0 &&
|
627
|
+
cursor.row === context.maybeInsertedRow &&
|
628
|
+
line.substr(cursor.column) === context.maybeInsertedLineEnd &&
|
629
|
+
line.substr(0, cursor.column) == context.maybeInsertedLineStart;
|
630
|
+
};
|
631
|
+
|
632
|
+
CstyleBehaviour.popAutoInsertedClosing = function() {
|
633
|
+
context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
|
634
|
+
context.autoInsertedBrackets--;
|
635
|
+
};
|
636
|
+
|
637
|
+
CstyleBehaviour.clearMaybeInsertedClosing = function() {
|
638
|
+
if (context) {
|
639
|
+
context.maybeInsertedBrackets = 0;
|
640
|
+
context.maybeInsertedRow = -1;
|
641
|
+
}
|
642
|
+
};
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
oop.inherits(CstyleBehaviour, Behaviour);
|
647
|
+
|
648
|
+
exports.CstyleBehaviour = CstyleBehaviour;
|
649
|
+
});
|
650
|
+
|
651
|
+
define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
|
652
|
+
"use strict";
|
653
|
+
|
654
|
+
var oop = require("../../lib/oop");
|
655
|
+
var Behaviour = require("../behaviour").Behaviour;
|
656
|
+
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
|
657
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
658
|
+
|
659
|
+
var CssBehaviour = function () {
|
660
|
+
|
661
|
+
this.inherit(CstyleBehaviour);
|
662
|
+
|
663
|
+
this.add("colon", "insertion", function (state, action, editor, session, text) {
|
664
|
+
if (text === ':') {
|
665
|
+
var cursor = editor.getCursorPosition();
|
666
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
667
|
+
var token = iterator.getCurrentToken();
|
668
|
+
if (token && token.value.match(/\s+/)) {
|
669
|
+
token = iterator.stepBackward();
|
670
|
+
}
|
671
|
+
if (token && token.type === 'support.type') {
|
672
|
+
var line = session.doc.getLine(cursor.row);
|
673
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
674
|
+
if (rightChar === ':') {
|
675
|
+
return {
|
676
|
+
text: '',
|
677
|
+
selection: [1, 1]
|
678
|
+
}
|
679
|
+
}
|
680
|
+
if (!line.substring(cursor.column).match(/^\s*;/)) {
|
681
|
+
return {
|
682
|
+
text: ':;',
|
683
|
+
selection: [1, 1]
|
684
|
+
}
|
685
|
+
}
|
686
|
+
}
|
687
|
+
}
|
688
|
+
});
|
689
|
+
|
690
|
+
this.add("colon", "deletion", function (state, action, editor, session, range) {
|
691
|
+
var selected = session.doc.getTextRange(range);
|
692
|
+
if (!range.isMultiLine() && selected === ':') {
|
693
|
+
var cursor = editor.getCursorPosition();
|
694
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
695
|
+
var token = iterator.getCurrentToken();
|
696
|
+
if (token && token.value.match(/\s+/)) {
|
697
|
+
token = iterator.stepBackward();
|
698
|
+
}
|
699
|
+
if (token && token.type === 'support.type') {
|
700
|
+
var line = session.doc.getLine(range.start.row);
|
701
|
+
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
702
|
+
if (rightChar === ';') {
|
703
|
+
range.end.column ++;
|
704
|
+
return range;
|
705
|
+
}
|
706
|
+
}
|
707
|
+
}
|
708
|
+
});
|
709
|
+
|
710
|
+
this.add("semicolon", "insertion", function (state, action, editor, session, text) {
|
711
|
+
if (text === ';') {
|
712
|
+
var cursor = editor.getCursorPosition();
|
713
|
+
var line = session.doc.getLine(cursor.row);
|
714
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
715
|
+
if (rightChar === ';') {
|
716
|
+
return {
|
717
|
+
text: '',
|
718
|
+
selection: [1, 1]
|
719
|
+
}
|
720
|
+
}
|
721
|
+
}
|
722
|
+
});
|
723
|
+
|
724
|
+
}
|
725
|
+
oop.inherits(CssBehaviour, CstyleBehaviour);
|
726
|
+
|
727
|
+
exports.CssBehaviour = CssBehaviour;
|
728
|
+
});
|
729
|
+
|
730
|
+
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
|
731
|
+
"use strict";
|
732
|
+
|
733
|
+
var oop = require("../../lib/oop");
|
734
|
+
var Range = require("../../range").Range;
|
735
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
736
|
+
|
737
|
+
var FoldMode = exports.FoldMode = function(commentRegex) {
|
738
|
+
if (commentRegex) {
|
739
|
+
this.foldingStartMarker = new RegExp(
|
740
|
+
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
|
741
|
+
);
|
742
|
+
this.foldingStopMarker = new RegExp(
|
743
|
+
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
|
744
|
+
);
|
745
|
+
}
|
746
|
+
};
|
747
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
748
|
+
|
749
|
+
(function() {
|
750
|
+
|
751
|
+
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
|
752
|
+
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
753
|
+
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
|
754
|
+
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
|
755
|
+
this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
|
756
|
+
this._getFoldWidgetBase = this.getFoldWidget;
|
757
|
+
this.getFoldWidget = function(session, foldStyle, row) {
|
758
|
+
var line = session.getLine(row);
|
759
|
+
|
760
|
+
if (this.singleLineBlockCommentRe.test(line)) {
|
761
|
+
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
|
762
|
+
return "";
|
763
|
+
}
|
764
|
+
|
765
|
+
var fw = this._getFoldWidgetBase(session, foldStyle, row);
|
766
|
+
|
767
|
+
if (!fw && this.startRegionRe.test(line))
|
768
|
+
return "start"; // lineCommentRegionStart
|
769
|
+
|
770
|
+
return fw;
|
771
|
+
};
|
772
|
+
|
773
|
+
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
774
|
+
var line = session.getLine(row);
|
775
|
+
|
776
|
+
if (this.startRegionRe.test(line))
|
777
|
+
return this.getCommentRegionBlock(session, line, row);
|
778
|
+
|
779
|
+
var match = line.match(this.foldingStartMarker);
|
780
|
+
if (match) {
|
781
|
+
var i = match.index;
|
782
|
+
|
783
|
+
if (match[1])
|
784
|
+
return this.openingBracketBlock(session, match[1], row, i);
|
785
|
+
|
786
|
+
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
787
|
+
|
788
|
+
if (range && !range.isMultiLine()) {
|
789
|
+
if (forceMultiline) {
|
790
|
+
range = this.getSectionRange(session, row);
|
791
|
+
} else if (foldStyle != "all")
|
792
|
+
range = null;
|
793
|
+
}
|
794
|
+
|
795
|
+
return range;
|
796
|
+
}
|
797
|
+
|
798
|
+
if (foldStyle === "markbegin")
|
799
|
+
return;
|
800
|
+
|
801
|
+
var match = line.match(this.foldingStopMarker);
|
802
|
+
if (match) {
|
803
|
+
var i = match.index + match[0].length;
|
804
|
+
|
805
|
+
if (match[1])
|
806
|
+
return this.closingBracketBlock(session, match[1], row, i);
|
807
|
+
|
808
|
+
return session.getCommentFoldRange(row, i, -1);
|
809
|
+
}
|
810
|
+
};
|
811
|
+
|
812
|
+
this.getSectionRange = function(session, row) {
|
813
|
+
var line = session.getLine(row);
|
814
|
+
var startIndent = line.search(/\S/);
|
815
|
+
var startRow = row;
|
816
|
+
var startColumn = line.length;
|
817
|
+
row = row + 1;
|
818
|
+
var endRow = row;
|
819
|
+
var maxRow = session.getLength();
|
820
|
+
while (++row < maxRow) {
|
821
|
+
line = session.getLine(row);
|
822
|
+
var indent = line.search(/\S/);
|
823
|
+
if (indent === -1)
|
824
|
+
continue;
|
825
|
+
if (startIndent > indent)
|
826
|
+
break;
|
827
|
+
var subRange = this.getFoldWidgetRange(session, "all", row);
|
828
|
+
|
829
|
+
if (subRange) {
|
830
|
+
if (subRange.start.row <= startRow) {
|
831
|
+
break;
|
832
|
+
} else if (subRange.isMultiLine()) {
|
833
|
+
row = subRange.end.row;
|
834
|
+
} else if (startIndent == indent) {
|
835
|
+
break;
|
836
|
+
}
|
837
|
+
}
|
838
|
+
endRow = row;
|
839
|
+
}
|
840
|
+
|
841
|
+
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
842
|
+
};
|
843
|
+
|
844
|
+
this.getCommentRegionBlock = function(session, line, row) {
|
845
|
+
var startColumn = line.search(/\s*$/);
|
846
|
+
var maxRow = session.getLength();
|
847
|
+
var startRow = row;
|
848
|
+
|
849
|
+
var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
|
850
|
+
var depth = 1;
|
851
|
+
while (++row < maxRow) {
|
852
|
+
line = session.getLine(row);
|
853
|
+
var m = re.exec(line);
|
854
|
+
if (!m) continue;
|
855
|
+
if (m[1]) depth--;
|
856
|
+
else depth++;
|
857
|
+
|
858
|
+
if (!depth) break;
|
859
|
+
}
|
860
|
+
|
861
|
+
var endRow = row;
|
862
|
+
if (endRow > startRow) {
|
863
|
+
return new Range(startRow, startColumn, endRow, line.length);
|
864
|
+
}
|
865
|
+
};
|
866
|
+
|
867
|
+
}).call(FoldMode.prototype);
|
868
|
+
|
869
|
+
});
|
870
|
+
|
871
|
+
define("ace/mode/scss",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scss_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
|
872
|
+
"use strict";
|
873
|
+
|
874
|
+
var oop = require("../lib/oop");
|
875
|
+
var TextMode = require("./text").Mode;
|
876
|
+
var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
|
877
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
878
|
+
var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
879
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
880
|
+
|
881
|
+
var Mode = function() {
|
882
|
+
this.HighlightRules = ScssHighlightRules;
|
883
|
+
this.$outdent = new MatchingBraceOutdent();
|
884
|
+
this.$behaviour = new CssBehaviour();
|
885
|
+
this.foldingRules = new CStyleFoldMode();
|
886
|
+
};
|
887
|
+
oop.inherits(Mode, TextMode);
|
888
|
+
|
889
|
+
(function() {
|
890
|
+
|
891
|
+
this.lineCommentStart = "//";
|
892
|
+
this.blockComment = {start: "/*", end: "*/"};
|
893
|
+
|
894
|
+
this.getNextLineIndent = function(state, line, tab) {
|
895
|
+
var indent = this.$getIndent(line);
|
896
|
+
var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
|
897
|
+
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
898
|
+
return indent;
|
899
|
+
}
|
900
|
+
|
901
|
+
var match = line.match(/^.*\{\s*$/);
|
902
|
+
if (match) {
|
903
|
+
indent += tab;
|
904
|
+
}
|
905
|
+
|
906
|
+
return indent;
|
907
|
+
};
|
908
|
+
|
909
|
+
this.checkOutdent = function(state, line, input) {
|
910
|
+
return this.$outdent.checkOutdent(line, input);
|
911
|
+
};
|
912
|
+
|
913
|
+
this.autoOutdent = function(state, doc, row) {
|
914
|
+
this.$outdent.autoOutdent(doc, row);
|
915
|
+
};
|
916
|
+
|
917
|
+
this.$id = "ace/mode/scss";
|
918
|
+
}).call(Mode.prototype);
|
919
|
+
|
920
|
+
exports.Mode = Mode;
|
921
|
+
|
922
|
+
});
|