mumuki-laboratory 5.0.1 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mumuki/laboratory/version.rb +1 -1
  3. data/vendor/assets/javascripts/analytics.js +4 -0
  4. data/vendor/assets/javascripts/codemirror-modes/assembly_x86.js +967 -0
  5. data/vendor/assets/javascripts/codemirror-modes/autocomplete.js +44 -0
  6. data/vendor/assets/javascripts/codemirror-modes/clike.min.js +1 -0
  7. data/vendor/assets/javascripts/codemirror-modes/closebrackets.min.js +1 -0
  8. data/vendor/assets/javascripts/codemirror-modes/css-hint.min.js +1 -0
  9. data/vendor/assets/javascripts/codemirror-modes/css.min.js +1 -0
  10. data/vendor/assets/javascripts/codemirror-modes/elixir.js +1284 -0
  11. data/vendor/assets/javascripts/codemirror-modes/gobstones-autocomplete.js +4 -0
  12. data/vendor/assets/javascripts/codemirror-modes/gobstones.js +1046 -0
  13. data/vendor/assets/javascripts/codemirror-modes/haskell-autocomplete.js +1 -0
  14. data/vendor/assets/javascripts/codemirror-modes/haskell.min.js +1 -0
  15. data/vendor/assets/javascripts/codemirror-modes/html-hint.min.js +1 -0
  16. data/vendor/assets/javascripts/codemirror-modes/htmlmixed.min.js +1 -0
  17. data/vendor/assets/javascripts/codemirror-modes/javascript-hint.min.js +1 -0
  18. data/vendor/assets/javascripts/codemirror-modes/javascript.min.js +1 -0
  19. data/vendor/assets/javascripts/codemirror-modes/markdown.min.js +1 -0
  20. data/vendor/assets/javascripts/codemirror-modes/matchbrackets.min.js +1 -0
  21. data/vendor/assets/javascripts/codemirror-modes/placeholder.min.js +1 -0
  22. data/vendor/assets/javascripts/codemirror-modes/prolog-autocomplete.js +1 -0
  23. data/vendor/assets/javascripts/codemirror-modes/prolog.js +1089 -0
  24. data/vendor/assets/javascripts/codemirror-modes/python.min.js +1 -0
  25. data/vendor/assets/javascripts/codemirror-modes/ruby-autocomplete.js +3 -0
  26. data/vendor/assets/javascripts/codemirror-modes/ruby.min.js +1 -0
  27. data/vendor/assets/javascripts/codemirror-modes/shell.min.js +1 -0
  28. data/vendor/assets/javascripts/codemirror-modes/show-hint.min.js +1 -0
  29. data/vendor/assets/javascripts/codemirror-modes/sql-hint.min.js +1 -0
  30. data/vendor/assets/javascripts/codemirror-modes/sql.min.js +1 -0
  31. data/vendor/assets/javascripts/codemirror-modes/wollok-autocomplete.js +3 -0
  32. data/vendor/assets/javascripts/codemirror-modes/wollok.js +1035 -0
  33. data/vendor/assets/javascripts/codemirror-modes/xml-hint.min.js +1 -0
  34. data/vendor/assets/javascripts/codemirror-modes/xml.min.js +1 -0
  35. data/vendor/assets/javascripts/codemirror.min.js +1 -0
  36. data/vendor/assets/javascripts/hotjar.js +8 -0
  37. data/vendor/assets/javascripts/jquery-console.js +845 -0
  38. data/vendor/assets/javascripts/webcomponents-lite.js +12 -0
  39. data/vendor/assets/stylesheets/codemirror/codemirror.min.css +2 -0
  40. data/vendor/assets/stylesheets/codemirror/show-hint.min.css +2 -0
  41. metadata +39 -1
@@ -0,0 +1,44 @@
1
+ function registerAutocomplete(mode, keywords, identifierRegex) {
2
+
3
+ var regex = identifierRegex || /[a-zA-Z_$][a-zA-Z0-9_$]*\b/;
4
+
5
+ function isIdentifier(name) {
6
+ return regex.test(name.trim());
7
+ }
8
+
9
+ CodeMirror.registerHelper('hint', mode, function (editor, options) {
10
+ var WORD = /[\w$]+/;
11
+
12
+ var word = options && options.word || WORD;
13
+ var cur = editor.getCursor();
14
+ var curLine = editor.getLine(cur.line);
15
+ var end = cur.ch;
16
+ var start = end;
17
+
18
+ var words = {};
19
+ editor.getValue().split(/([^a-zA-Z0-9_$])|[\[\]{}() \n\t]/).concat(keywords).forEach(function (name) {
20
+ if (isIdentifier(name)) words[name.trim()] = true;
21
+ });
22
+
23
+ while (start && word.test(curLine.charAt(start - 1))) --start;
24
+
25
+ var curWord = curLine.slice(start, end);
26
+
27
+ var list = [];
28
+
29
+ for (var aWord in words) {
30
+ if (aWord.toLowerCase().indexOf(curWord.toLowerCase()) === 0) {
31
+ list.push(aWord);
32
+ }
33
+ }
34
+
35
+ list.sort && list.sort();
36
+
37
+ return {
38
+ list: list,
39
+ from: CodeMirror.Pos(cur.line, start),
40
+ to: CodeMirror.Pos(cur.line, end)
41
+ };
42
+ });
43
+
44
+ }
@@ -0,0 +1 @@
1
+ !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror-modes")):"function"==typeof define&&define.amd?define(["../../lib/codemirror-modes"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,o,a){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=o,this.prev=a}function n(e,n,r,o){var a=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(a=e.context.indented),e.context=new t(a,n,r,o,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function o(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function a(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function i(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function l(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}function s(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=s;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function c(e,t){return"type"==t.prevToken&&"type"}function u(e){return e.eatWhile(/[\w\.']/),"number"}function d(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=m,m(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function f(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}function p(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function m(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+n+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function h(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&o.push(t)}"string"==typeof t&&(t=[t]);var o=[];r(n.keywords),r(n.types),r(n.builtin),r(n.atoms),o.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],o));for(var a=0;a<t.length;++a)e.defineMIME(t[a],n)}function g(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}function y(e){return function(t,n){for(var r,o=!1,a=!1;!t.eol();){if(!e&&!o&&t.match('"')){a=!0;break}if(e&&t.match('"""')){a=!0;break}r=t.next(),!o&&"$"==r&&t.match("{")&&t.skipTo("}"),o=!o&&"\\"==r&&!e}return!a&&e||(n.tokenize=null),"string"}}function x(e){return function(t,n){for(var r,o=!1,a=!1;!t.eol();){if(!o&&t.match('"')&&("single"==e||t.match('""'))){a=!0;break}if(!o&&t.match("``")){w=x(e),a=!0;break}r=t.next(),o="single"==e&&!o&&"\\"==r}return a&&(n.tokenize=null),"string"}}e.defineMode("clike",function(i,s){function c(e,t){var n=e.next();if(S[n]){var r=S[n](e,t);if(!1!==r)return r}if('"'==n||"'"==n)return t.tokenize=u(n),t.tokenize(e,t);if(D.test(n))return p=n,null;if(L.test(n)){if(e.backUp(1),e.match(I))return"number";e.next()}if("/"==n){if(e.eat("*"))return t.tokenize=d,d(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(F.test(n)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(F););return"operator"}if(e.eatWhile(z),P)for(;e.match(P);)e.eatWhile(z);var o=e.current();return l(x,o)?(l(w,o)&&(p="newstatement"),l(v,o)&&(m=!0),"keyword"):l(b,o)?"type":l(k,o)?(l(w,o)&&(p="newstatement"),"builtin"):l(_,o)?"atom":"variable"}function u(e){return function(t,n){for(var r,o=!1,a=!1;null!=(r=t.next());){if(r==e&&!o){a=!0;break}o=!o&&"\\"==r}return(a||!o&&!C)&&(n.tokenize=null),"string"}}function d(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function f(e,t){s.typeFirstDefinitions&&e.eol()&&a(t.context)&&(t.typeAtEndOfLine=o(e,t,e.pos))}var p,m,h=i.indentUnit,g=s.statementIndentUnit||h,y=s.dontAlignCalls,x=s.keywords||{},b=s.types||{},k=s.builtin||{},w=s.blockKeywords||{},v=s.defKeywords||{},_=s.atoms||{},S=s.hooks||{},C=s.multiLineStrings,T=!1!==s.indentStatements,M=!1!==s.indentSwitch,P=s.namespaceSeparator,D=s.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,L=s.numberStart||/[\d\.]/,I=s.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,F=s.isOperatorChar||/[+\-*&%=<>!?|\/]/,z=s.isIdentifierChar||/[\w\$_\xa1-\uffff]/;return{startState:function(e){return{tokenize:null,context:new t((e||0)-h,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var i=t.context;if(e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return f(e,t),null;p=m=null;var l=(t.tokenize||c)(e,t);if("comment"==l||"meta"==l)return l;if(null==i.align&&(i.align=!0),";"==p||":"==p||","==p&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==p)n(t,e.column(),"}");else if("["==p)n(t,e.column(),"]");else if("("==p)n(t,e.column(),")");else if("}"==p){for(;"statement"==i.type;)i=r(t);for("}"==i.type&&(i=r(t));"statement"==i.type;)i=r(t)}else p==i.type?r(t):T&&(("}"==i.type||"top"==i.type)&&";"!=p||"statement"==i.type&&"newstatement"==p)&&n(t,e.column(),"statement",e.current());if("variable"==l&&("def"==t.prevToken||s.typeFirstDefinitions&&o(e,t,e.start)&&a(t.context)&&e.match(/^\s*\(/,!1))&&(l="def"),S.token){var u=S.token(e,t,l);void 0!==u&&(l=u)}return"def"==l&&!1===s.styleDefs&&(l="variable"),t.startOfLine=!1,t.prevToken=m?"def":l||p,f(e,t),l},indent:function(t,n){if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,o=n&&n.charAt(0);if("statement"==r.type&&"}"==o&&(r=r.prev),s.dontIndentStatements)for(;"statement"==r.type&&s.dontIndentStatements.test(r.info);)r=r.prev;if(S.indent){var a=S.indent(t,r,n);if("number"==typeof a)return a}var i=o==r.type,l=r.prev&&"switch"==r.prev.info;if(s.allmanIndentation&&/[{(]/.test(o)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==o?0:g):!r.align||y&&")"==r.type?")"!=r.type||i?r.indented+(i?0:h)+(i||!l||/^(?:case|default)\b/.test(n)?0:h):r.indented+g:r.column+(i?0:1)},electricInput:M?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var b="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",k="int long char short double float unsigned signed void size_t ptrdiff_t";h(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:i(b),types:i(k+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:i("case do else for if switch while struct"),defKeywords:i("struct"),typeFirstDefinitions:!0,atoms:i("null true false"),hooks:{"#":s,"*":c},modeProps:{fold:["brace","include"]}}),h(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:i(b+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:i(k+" bool wchar_t"),blockKeywords:i("catch class do else finally for if struct switch try while"),defKeywords:i("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:i("true false null"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{"#":s,"*":c,u:d,U:d,L:d,R:d,0:u,1:u,2:u,3:u,4:u,5:u,6:u,7:u,8:u,9:u,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&f(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),h("text/x-java",{name:"clike",keywords:i("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:i("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:i("catch class do else finally for if switch try while"),defKeywords:i("class interface package enum @interface"),typeFirstDefinitions:!0,atoms:i("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),h("text/x-csharp",{name:"clike",keywords:i("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:i("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:i("catch class do else finally for foreach if struct switch try while"),defKeywords:i("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:i("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=p,p(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),h("text/x-scala",{name:"clike",keywords:i("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:i("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:i("catch class enum do else finally for forSome if match switch try while"),defKeywords:i("class enum def object package trait type val var"),atoms:i("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=g,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")}},modeProps:{closeBrackets:{triples:'"'}}}),h("text/x-kotlin",{name:"clike",keywords:i("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend"),types:i("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:i("catch class do else finally for if where try while enum"),defKeywords:i("class val var object package interface fun"),atoms:i("true false null this"),hooks:{'"':function(e,t){return t.tokenize=y(e.match('""')),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),h(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:i("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:i("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:i("for while do if else struct"),builtin:i("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:i("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":s},modeProps:{fold:["brace","include"]}}),h("text/x-nesc",{name:"clike",keywords:i(b+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:i(k),blockKeywords:i("case do else for if switch while struct"),atoms:i("null true false"),hooks:{"#":s},modeProps:{fold:["brace","include"]}}),h("text/x-objectivec",{name:"clike",keywords:i(b+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:i(k),atoms:i("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":s,indent:function(e,t,n){if("statement"==t.type&&/^@\w/.test(n))return t.indented}},modeProps:{fold:"brace"}}),h("text/x-squirrel",{name:"clike",keywords:i("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:i(k),blockKeywords:i("case catch class else for foreach if switch try while"),defKeywords:i("function local class"),typeFirstDefinitions:!0,atoms:i("true false null"),hooks:{"#":s},modeProps:{fold:["brace","include"]}});var w=null;h("text/x-ceylon",{name:"clike",keywords:i("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:i("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:i("class dynamic function interface module object package value"),builtin:i("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:i("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=x(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!w||!e.match("`"))&&(t.tokenize=w,w=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})});
@@ -0,0 +1 @@
1
+ !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror-modes")):"function"==typeof define&&define.amd?define(["../../lib/codemirror-modes"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:h[t]}function n(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),i="'"+n+"'";d[i]||(d[i]=r(n))}}function r(e){return function(t){return o(t,e)}}function i(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function a(t){var n=e.cmpPos(t.anchor,t.head)>0;return{anchor:new u(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new u(t.head.line,t.head.ch+(n?1:-1))}}function o(n,r){var o=i(n);if(!o||n.getOption("disableInput"))return e.Pass;var c=t(o,"pairs"),h=c.indexOf(r);if(-1==h)return e.Pass;for(var d,g=t(o,"triples"),p=c.charAt(h+1)==r,v=n.listSelections(),m=h%2==0,b=0;b<v.length;b++){var x,C=v[b],k=C.head,P=n.getRange(k,u(k.line,k.ch+1));if(m&&!C.empty())x="surround";else if(!p&&m||P!=r)if(p&&k.ch>1&&g.indexOf(r)>=0&&n.getRange(u(k.line,k.ch-2),k)==r+r&&(k.ch<=2||n.getRange(u(k.line,k.ch-3),u(k.line,k.ch-2))!=r))x="addFour";else if(p){if(e.isWordChar(P)||!l(n,k,r))return e.Pass;x="both"}else{if(!m||n.getLine(k.line).length!=k.ch&&!s(P,c)&&!/\s/.test(P))return e.Pass;x="both"}else x=p&&f(n,k)?"both":g.indexOf(r)>=0&&n.getRange(k,u(k.line,k.ch+3))==r+r+r?"skipThree":"skip";if(d){if(d!=x)return e.Pass}else d=x}var S=h%2?c.charAt(h-1):r,y=h%2?r:c.charAt(h+1);n.operation(function(){if("skip"==d)n.execCommand("goCharRight");else if("skipThree"==d)for(t=0;t<3;t++)n.execCommand("goCharRight");else if("surround"==d){for(var e=n.getSelections(),t=0;t<e.length;t++)e[t]=S+e[t]+y;n.replaceSelections(e,"around"),e=n.listSelections().slice();for(t=0;t<e.length;t++)e[t]=a(e[t]);n.setSelections(e)}else"both"==d?(n.replaceSelection(S+y,null),n.triggerElectric(S+y),n.execCommand("goCharLeft")):"addFour"==d&&(n.replaceSelection(S+S+S+S,"before"),n.execCommand("goCharRight"))})}function s(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function c(e,t){var n=e.getRange(u(t.line,t.ch-1),u(t.line,t.ch+1));return 2==n.length?n:null}function l(t,n,r){var i=t.getLine(n.line),a=t.getTokenAt(n);if(/\bstring2?\b/.test(a.type)||f(t,n))return!1;var o=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(o.pos=o.start=a.start;;){var s=t.getMode().token(o,a.state);if(o.pos>=n.ch+1)return/\bstring2?\b/.test(s);o.start=o.pos}}function f(e,t){var n=e.getTokenAt(u(t.line,t.ch+1));return/\bstring/.test(n.type)&&n.start==t.ch}var h={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},u=e.Pos;e.defineOption("autoCloseBrackets",!1,function(r,i,a){a&&a!=e.Init&&(r.removeKeyMap(d),r.state.closeBrackets=null),i&&(n(t(i,"pairs")),r.state.closeBrackets=i,r.addKeyMap(d))});var d={Backspace:function(n){var r=i(n);if(!r||n.getOption("disableInput"))return e.Pass;for(var a=t(r,"pairs"),o=n.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=c(n,o[s].head);if(!l||a.indexOf(l)%2!=0)return e.Pass}for(s=o.length-1;s>=0;s--){var f=o[s].head;n.replaceRange("",u(f.line,f.ch-1),u(f.line,f.ch+1),"+delete")}},Enter:function(n){var r=i(n),a=r&&t(r,"explode");if(!a||n.getOption("disableInput"))return e.Pass;for(var o=n.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=c(n,o[s].head);if(!l||a.indexOf(l)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null),n.execCommand("goCharLeft"),o=n.listSelections();for(var e=0;e<o.length;e++){var t=o[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}};n(h.pairs+"`")});
@@ -0,0 +1 @@
1
+ !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror-modes"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror-modes","../../mode/css/css"],e):e(CodeMirror)}(function(e){"use strict";var r={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(t){function o(e){for(var r in e)c&&0!=r.lastIndexOf(c,0)||l.push(r)}var s=t.getCursor(),i=t.getTokenAt(s),n=e.innerMode(t.getMode(),i.state);if("css"==n.mode.name){if("keyword"==i.type&&0=="!important".indexOf(i.string))return{list:["!important"],from:e.Pos(s.line,i.start),to:e.Pos(s.line,i.end)};var a=i.start,d=s.ch,c=i.string.slice(0,d-a);/[^\w$_-]/.test(c)&&(c="",a=d=s.ch);var f=e.resolveMode("text/css"),l=[],p=n.state.state;return"pseudo"==p||"variable-3"==i.type?o(r):"block"==p||"maybeprop"==p?o(f.propertyKeywords):"prop"==p||"parens"==p||"at"==p||"params"==p?(o(f.valueKeywords),o(f.colorKeywords)):"media"!=p&&"media_parens"!=p||(o(f.mediaTypes),o(f.mediaFeatures)),l.length?{list:l,from:e.Pos(s.line,a),to:e.Pos(s.line,d)}:void 0}})});
@@ -0,0 +1 @@
1
+ !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror-modes")):"function"==typeof define&&define.amd?define(["../../lib/codemirror-modes"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,o=!1;null!=(r=e.next());){if(o&&"/"==r){t.tokenize=null;break}o="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function o(e,t){return h=t,e}function a(e,t){var r=e.next();if(f[r]){var a=f[r](e,t);if(!1!==a)return a}return"@"==r?(e.eatWhile(/[\w\\\-]/),o("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?o(null,"compare"):'"'==r||"'"==r?(t.tokenize=i(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),o("atom","hash")):"!"==r?(e.match(/^\s*\w*/),o("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),o("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?o(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?o(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=n,o("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),o("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?o("variable-2","variable-definition"):o("variable-2","variable")):e.match(/^\w+-/)?o("meta","meta"):void 0}function i(e){return function(t,r){for(var a,i=!1;null!=(a=t.next());){if(a==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==a}return(a==e||!i&&")"!=e)&&(r.tokenize=null),o("string","string")}}function n(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=i(")"),o(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,o){return e.context=new l(r,t.indentation()+(!1===o?0:b),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function d(e,t,r){return _[r.context.type](e,t,r)}function p(e,t,r,o){for(var a=o||1;a>0;a--)r.context=r.context.prev;return d(e,t,r)}function u(e){var t=e.current().toLowerCase();g=K.hasOwnProperty(t)?"atom":P.hasOwnProperty(t)?"keyword":"variable"}var m=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var h,g,b=t.indentUnit,f=r.tokenHooks,y=r.documentTypes||{},w=r.mediaTypes||{},k=r.mediaFeatures||{},v=r.mediaValueKeywords||{},x=r.propertyKeywords||{},z=r.nonStandardPropertyKeywords||{},j=r.fontProperties||{},q=r.counterDescriptors||{},P=r.colorKeywords||{},K=r.valueKeywords||{},B=r.allowNested,C=r.lineComment,T=!0===r.supportsAtComponent,_={};return _.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(T&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)g="builtin";else if("word"==e)g="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(B&&"("==e)return s(r,t,"parens")}return r.context.type},_.block=function(e,t,r){if("word"==e){var o=t.current().toLowerCase();return x.hasOwnProperty(o)?(g="property","maybeprop"):z.hasOwnProperty(o)?(g="string-2","maybeprop"):B?(g=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(g+=" error","maybeprop")}return"meta"==e?"block":B||"hash"!=e&&"qualifier"!=e?_.top(e,t,r):(g="error","block")},_.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):d(e,t,r)},_.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&B)return s(r,t,"propBlock");if("}"==e||"{"==e)return p(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)u(t);else if("interpolation"==e)return s(r,t,"interpolation")}else g+=" error";return"prop"},_.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(g="property","maybeprop"):r.context.type},_.parens=function(e,t,r){return"{"==e||"}"==e?p(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&u(t),"parens")},_.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(g="variable-3",r.context.type):d(e,t,r)},_.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(g="tag",r.context.type):_.atBlock(e,t,r)},_.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return p(e,t,r);if("{"==e)return c(r)&&s(r,t,B?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var o=t.current().toLowerCase();g="only"==o||"not"==o||"and"==o||"or"==o?"keyword":w.hasOwnProperty(o)?"attribute":k.hasOwnProperty(o)?"property":v.hasOwnProperty(o)?"keyword":x.hasOwnProperty(o)?"property":z.hasOwnProperty(o)?"string-2":K.hasOwnProperty(o)?"atom":P.hasOwnProperty(o)?"keyword":"error"}return r.context.type},_.atComponentBlock=function(e,t,r){return"}"==e?p(e,t,r):"{"==e?c(r)&&s(r,t,B?"block":"top",!1):("word"==e&&(g="error"),r.context.type)},_.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?p(e,t,r,2):_.atBlock(e,t,r)},_.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(g="variable","restricted_atBlock_before"):d(e,t,r)},_.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(g="@font-face"==r.stateArg&&!j.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!q.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},_.keyframes=function(e,t,r){return"word"==e?(g="variable","keyframes"):"{"==e?s(r,t,"top"):d(e,t,r)},_.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?p(e,t,r):("word"==e?g="tag":"hash"==e&&(g="builtin"),"at")},_.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?p(e,t,r):("word"==e?g="variable":"variable"!=e&&"("!=e&&")"!=e&&(g="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:m?"block":"top",stateArg:null,context:new l(m?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||a)(e,t);return r&&"object"==typeof r&&(h=r[1],r=r[0]),g=r,"comment"!=h&&(t.state=_[t.state](h,e,t)),g},indent:function(e,t){var r=e.context,o=t&&t.charAt(0),a=r.indent;return"prop"!=r.type||"}"!=o&&")"!=o||(r=r.prev),r.prev&&("}"!=o||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=o||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=o||"at"!=r.type&&"atBlock"!=r.type)||(a=Math.max(0,r.indent-b)):a=(r=r.prev).indent),a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:C,fold:"brace"}});var o=["domain","regexp","url","url-prefix"],a=t(o),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],n=t(i),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],d=t(c),p=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(p),m=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(m),g=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),b=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),f=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(f),w=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(w),v=o.concat(i).concat(l).concat(c).concat(p).concat(m).concat(f).concat(w);e.registerHelper("hintWords","css",v),e.defineMIME("text/css",{documentTypes:a,mediaTypes:n,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:b,colorKeywords:y,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:n,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:y,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:n,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:y,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:a,mediaTypes:n,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:b,colorKeywords:y,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})});
@@ -0,0 +1,1284 @@
1
+ // Parts from Ace; see <https://raw.githubusercontent.com/ajaxorg/ace/master/LICENSE>
2
+ CodeMirror.defineMode("elixir", function(cmCfg, modeCfg) {
3
+
4
+ // Fake define() function.
5
+ var moduleHolder = Object.create(null);
6
+
7
+ // Given a module path as a string, create the canonical version
8
+ // (no leading ./, no ending .js).
9
+ var canonicalPath = function(path) {
10
+ return path.replace(/\.\//, '').replace(/\.js$/, '');
11
+ };
12
+
13
+ // We intentionally add the `path` argument to `define()`.
14
+ var define = function(path, init) {
15
+ var exports = Object.create(null);
16
+ init(require, exports); // module (3rd parameter) isn't supported.
17
+ moduleHolder[canonicalPath(path)] = exports;
18
+ };
19
+
20
+ // path: string of the location of the JS file.
21
+ var require = function(path) { return moduleHolder[canonicalPath(path)]; };
22
+
23
+ // All dependencies here.
24
+ define("../lib/oop.js", function(require, exports, module) {
25
+ "use strict";
26
+
27
+ exports.inherits = function(ctor, superCtor) {
28
+ ctor.super_ = superCtor;
29
+ ctor.prototype = Object.create(superCtor.prototype, {
30
+ constructor: {
31
+ value: ctor,
32
+ enumerable: false,
33
+ writable: true,
34
+ configurable: true
35
+ }
36
+ });
37
+ };
38
+
39
+ exports.mixin = function(obj, mixin) {
40
+ for (var key in mixin) {
41
+ obj[key] = mixin[key];
42
+ }
43
+ return obj;
44
+ };
45
+
46
+ exports.implement = function(proto, mixin) {
47
+ exports.mixin(proto, mixin);
48
+ };
49
+
50
+ });
51
+
52
+
53
+ define("../lib/lang.js", function(require, exports, module) {
54
+ "use strict";
55
+
56
+ exports.last = function(a) {
57
+ return a[a.length - 1];
58
+ };
59
+
60
+ exports.stringReverse = function(string) {
61
+ return string.split("").reverse().join("");
62
+ };
63
+
64
+ exports.stringRepeat = function (string, count) {
65
+ var result = '';
66
+ while (count > 0) {
67
+ if (count & 1)
68
+ result += string;
69
+
70
+ if (count >>= 1)
71
+ string += string;
72
+ }
73
+ return result;
74
+ };
75
+
76
+ var trimBeginRegexp = /^\s\s*/;
77
+ var trimEndRegexp = /\s\s*$/;
78
+
79
+ exports.stringTrimLeft = function (string) {
80
+ return string.replace(trimBeginRegexp, '');
81
+ };
82
+
83
+ exports.stringTrimRight = function (string) {
84
+ return string.replace(trimEndRegexp, '');
85
+ };
86
+
87
+ exports.copyObject = function(obj) {
88
+ var copy = {};
89
+ for (var key in obj) {
90
+ copy[key] = obj[key];
91
+ }
92
+ return copy;
93
+ };
94
+
95
+ exports.copyArray = function(array){
96
+ var copy = [];
97
+ for (var i=0, l=array.length; i<l; i++) {
98
+ if (array[i] && typeof array[i] == "object")
99
+ copy[i] = this.copyObject(array[i]);
100
+ else
101
+ copy[i] = array[i];
102
+ }
103
+ return copy;
104
+ };
105
+
106
+ exports.deepCopy = function deepCopy(obj) {
107
+ if (typeof obj !== "object" || !obj)
108
+ return obj;
109
+ var copy;
110
+ if (Array.isArray(obj)) {
111
+ copy = [];
112
+ for (var key = 0; key < obj.length; key++) {
113
+ copy[key] = deepCopy(obj[key]);
114
+ }
115
+ return copy;
116
+ }
117
+ if (Object.prototype.toString.call(obj) !== "[object Object]")
118
+ return obj;
119
+
120
+ copy = {};
121
+ for (var key in obj)
122
+ copy[key] = deepCopy(obj[key]);
123
+ return copy;
124
+ };
125
+
126
+ exports.arrayToMap = function(arr) {
127
+ var map = {};
128
+ for (var i=0; i<arr.length; i++) {
129
+ map[arr[i]] = 1;
130
+ }
131
+ return map;
132
+
133
+ };
134
+
135
+ exports.createMap = function(props) {
136
+ var map = Object.create(null);
137
+ for (var i in props) {
138
+ map[i] = props[i];
139
+ }
140
+ return map;
141
+ };
142
+
143
+ /*
144
+ * splice out of 'array' anything that === 'value'
145
+ */
146
+ exports.arrayRemove = function(array, value) {
147
+ for (var i = 0; i <= array.length; i++) {
148
+ if (value === array[i]) {
149
+ array.splice(i, 1);
150
+ }
151
+ }
152
+ };
153
+
154
+ exports.escapeRegExp = function(str) {
155
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
156
+ };
157
+
158
+ exports.escapeHTML = function(str) {
159
+ return str.replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
160
+ };
161
+
162
+ exports.getMatchOffsets = function(string, regExp) {
163
+ var matches = [];
164
+
165
+ string.replace(regExp, function(str) {
166
+ matches.push({
167
+ offset: arguments[arguments.length-2],
168
+ length: str.length
169
+ });
170
+ });
171
+
172
+ return matches;
173
+ };
174
+
175
+ /* deprecated */
176
+ exports.deferredCall = function(fcn) {
177
+ var timer = null;
178
+ var callback = function() {
179
+ timer = null;
180
+ fcn();
181
+ };
182
+
183
+ var deferred = function(timeout) {
184
+ deferred.cancel();
185
+ timer = setTimeout(callback, timeout || 0);
186
+ return deferred;
187
+ };
188
+
189
+ deferred.schedule = deferred;
190
+
191
+ deferred.call = function() {
192
+ this.cancel();
193
+ fcn();
194
+ return deferred;
195
+ };
196
+
197
+ deferred.cancel = function() {
198
+ clearTimeout(timer);
199
+ timer = null;
200
+ return deferred;
201
+ };
202
+
203
+ deferred.isPending = function() {
204
+ return timer;
205
+ };
206
+
207
+ return deferred;
208
+ };
209
+
210
+
211
+ exports.delayedCall = function(fcn, defaultTimeout) {
212
+ var timer = null;
213
+ var callback = function() {
214
+ timer = null;
215
+ fcn();
216
+ };
217
+
218
+ var _self = function(timeout) {
219
+ if (timer == null)
220
+ timer = setTimeout(callback, timeout || defaultTimeout);
221
+ };
222
+
223
+ _self.delay = function(timeout) {
224
+ timer && clearTimeout(timer);
225
+ timer = setTimeout(callback, timeout || defaultTimeout);
226
+ };
227
+ _self.schedule = _self;
228
+
229
+ _self.call = function() {
230
+ this.cancel();
231
+ fcn();
232
+ };
233
+
234
+ _self.cancel = function() {
235
+ timer && clearTimeout(timer);
236
+ timer = null;
237
+ };
238
+
239
+ _self.isPending = function() {
240
+ return timer;
241
+ };
242
+
243
+ return _self;
244
+ };
245
+ });
246
+
247
+
248
+ define("./text_highlight_rules.js", function(require, exports, module) {
249
+ "use strict";
250
+
251
+ var lang = require("../lib/lang");
252
+
253
+ var TextHighlightRules = function() {
254
+
255
+ // regexp must not have capturing parentheses
256
+ // regexps are ordered -> the first match is used
257
+
258
+ this.$rules = {
259
+ "start" : [{
260
+ token : "empty_line",
261
+ regex : '^$'
262
+ }, {
263
+ defaultToken : "text"
264
+ }]
265
+ };
266
+ };
267
+
268
+ (function() {
269
+
270
+ this.addRules = function(rules, prefix) {
271
+ if (!prefix) {
272
+ for (var key in rules)
273
+ this.$rules[key] = rules[key];
274
+ return;
275
+ }
276
+ for (var key in rules) {
277
+ var state = rules[key];
278
+ for (var i = 0; i < state.length; i++) {
279
+ var rule = state[i];
280
+ if (rule.next || rule.onMatch) {
281
+ if (typeof rule.next == "string") {
282
+ if (rule.next.indexOf(prefix) !== 0)
283
+ rule.next = prefix + rule.next;
284
+ }
285
+ if (rule.nextState && rule.nextState.indexOf(prefix) !== 0)
286
+ rule.nextState = prefix + rule.nextState;
287
+ }
288
+ }
289
+ this.$rules[prefix + key] = state;
290
+ }
291
+ };
292
+
293
+ this.getRules = function() {
294
+ return this.$rules;
295
+ };
296
+
297
+ this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) {
298
+ var embedRules = typeof HighlightRules == "function"
299
+ ? new HighlightRules().getRules()
300
+ : HighlightRules;
301
+ if (states) {
302
+ for (var i = 0; i < states.length; i++)
303
+ states[i] = prefix + states[i];
304
+ } else {
305
+ states = [];
306
+ for (var key in embedRules)
307
+ states.push(prefix + key);
308
+ }
309
+
310
+ this.addRules(embedRules, prefix);
311
+
312
+ if (escapeRules) {
313
+ var addRules = Array.prototype[append ? "push" : "unshift"];
314
+ for (var i = 0; i < states.length; i++)
315
+ addRules.apply(this.$rules[states[i]], lang.deepCopy(escapeRules));
316
+ }
317
+
318
+ if (!this.$embeds)
319
+ this.$embeds = [];
320
+ this.$embeds.push(prefix);
321
+ };
322
+
323
+ this.getEmbeds = function() {
324
+ return this.$embeds;
325
+ };
326
+
327
+ var pushState = function(currentState, stack) {
328
+ if (currentState != "start" || stack.length)
329
+ stack.unshift(this.nextState, currentState);
330
+ return this.nextState;
331
+ };
332
+ var popState = function(currentState, stack) {
333
+ // if (stack[0] === currentState)
334
+ stack.shift();
335
+ return stack.shift() || "start";
336
+ };
337
+
338
+ this.normalizeRules = function() {
339
+ var id = 0;
340
+ var rules = this.$rules;
341
+ function processState(key) {
342
+ var state = rules[key];
343
+ state.processed = true;
344
+ for (var i = 0; i < state.length; i++) {
345
+ var rule = state[i];
346
+ var toInsert = null;
347
+ if (Array.isArray(rule)) {
348
+ toInsert = rule;
349
+ rule = {};
350
+ }
351
+ if (!rule.regex && rule.start) {
352
+ rule.regex = rule.start;
353
+ if (!rule.next)
354
+ rule.next = [];
355
+ rule.next.push({
356
+ defaultToken: rule.token
357
+ }, {
358
+ token: rule.token + ".end",
359
+ regex: rule.end || rule.start,
360
+ next: "pop"
361
+ });
362
+ rule.token = rule.token + ".start";
363
+ rule.push = true;
364
+ }
365
+ var next = rule.next || rule.push;
366
+ if (next && Array.isArray(next)) {
367
+ var stateName = rule.stateName;
368
+ if (!stateName) {
369
+ stateName = rule.token;
370
+ if (typeof stateName != "string")
371
+ stateName = stateName[0] || "";
372
+ if (rules[stateName])
373
+ stateName += id++;
374
+ }
375
+ rules[stateName] = next;
376
+ rule.next = stateName;
377
+ processState(stateName);
378
+ } else if (next == "pop") {
379
+ rule.next = popState;
380
+ }
381
+
382
+ if (rule.push) {
383
+ rule.nextState = rule.next || rule.push;
384
+ rule.next = pushState;
385
+ delete rule.push;
386
+ }
387
+
388
+ if (rule.rules) {
389
+ for (var r in rule.rules) {
390
+ if (rules[r]) {
391
+ if (rules[r].push)
392
+ rules[r].push.apply(rules[r], rule.rules[r]);
393
+ } else {
394
+ rules[r] = rule.rules[r];
395
+ }
396
+ }
397
+ }
398
+ var includeName = typeof rule == "string" ? rule : rule.include;
399
+ if (includeName) {
400
+ if (Array.isArray(includeName))
401
+ toInsert = includeName.map(function(x) { return rules[x]; });
402
+ else
403
+ toInsert = rules[includeName];
404
+ }
405
+
406
+ if (toInsert) {
407
+ var args = [i, 1].concat(toInsert);
408
+ if (rule.noEscape)
409
+ args = args.filter(function(x) {return !x.next;});
410
+ state.splice.apply(state, args);
411
+ // skip included rules since they are already processed
412
+ //i += args.length - 3;
413
+ i--;
414
+ }
415
+
416
+ if (rule.keywordMap) {
417
+ rule.token = this.createKeywordMapper(
418
+ rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive
419
+ );
420
+ delete rule.defaultToken;
421
+ }
422
+ }
423
+ }
424
+ Object.keys(rules).forEach(processState, this);
425
+ };
426
+
427
+ this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) {
428
+ var keywords = Object.create(null);
429
+ Object.keys(map).forEach(function(className) {
430
+ var a = map[className];
431
+ if (ignoreCase)
432
+ a = a.toLowerCase();
433
+ var list = a.split(splitChar || "|");
434
+ for (var i = list.length; i--; )
435
+ keywords[list[i]] = className;
436
+ });
437
+ // in old versions of opera keywords["__proto__"] sets prototype
438
+ // even on objects with __proto__=null
439
+ if (Object.getPrototypeOf(keywords)) {
440
+ keywords.__proto__ = null;
441
+ }
442
+ this.$keywordList = Object.keys(keywords);
443
+ map = null;
444
+ return ignoreCase
445
+ ? function(value) {return keywords[value.toLowerCase()] || defaultToken; }
446
+ : function(value) {return keywords[value] || defaultToken; };
447
+ };
448
+
449
+ this.getKeywords = function() {
450
+ return this.$keywords;
451
+ };
452
+
453
+ }).call(TextHighlightRules.prototype);
454
+
455
+ exports.TextHighlightRules = TextHighlightRules;
456
+ });
457
+
458
+
459
+ define("elixir_highlight_rules", function(require, exports, module) {
460
+ "use strict";
461
+
462
+ var oop = require("../lib/oop");
463
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
464
+
465
+ var ElixirHighlightRules = function() {
466
+ // regexp must not have capturing parentheses. Use (?:) instead.
467
+ // regexps are ordered -> the first match is used
468
+
469
+ this.$rules = { start:
470
+ [ { token:
471
+ [ 'meta.module.elixir',
472
+ 'keyword.control.module.elixir',
473
+ 'meta.module.elixir',
474
+ 'entity.name.type.module.elixir' ],
475
+ regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' },
476
+ { token: 'comment.documentation.heredoc',
477
+ regex: '@(?:module|type)?doc (?:~[a-z])?"""',
478
+ push:
479
+ [ { token: 'comment.documentation.heredoc',
480
+ regex: '\\s*"""',
481
+ next: 'pop' },
482
+ { include: '#interpolated_elixir' },
483
+ { include: '#escaped_char' },
484
+ { defaultToken: 'comment.documentation.heredoc' } ],
485
+ comment: '@doc with heredocs is treated as documentation' },
486
+ { token: 'comment.documentation.heredoc',
487
+ regex: '@(?:module|type)?doc ~[A-Z]"""',
488
+ push:
489
+ [ { token: 'comment.documentation.heredoc',
490
+ regex: '\\s*"""',
491
+ next: 'pop' },
492
+ { defaultToken: 'comment.documentation.heredoc' } ],
493
+ comment: '@doc with heredocs is treated as documentation' },
494
+ { token: 'comment.documentation.heredoc',
495
+ regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'',
496
+ push:
497
+ [ { token: 'comment.documentation.heredoc',
498
+ regex: '\\s*\'\'\'',
499
+ next: 'pop' },
500
+ { include: '#interpolated_elixir' },
501
+ { include: '#escaped_char' },
502
+ { defaultToken: 'comment.documentation.heredoc' } ],
503
+ comment: '@doc with heredocs is treated as documentation' },
504
+ { token: 'comment.documentation.heredoc',
505
+ regex: '@(?:module|type)?doc ~[A-Z]\'\'\'',
506
+ push:
507
+ [ { token: 'comment.documentation.heredoc',
508
+ regex: '\\s*\'\'\'',
509
+ next: 'pop' },
510
+ { defaultToken: 'comment.documentation.heredoc' } ],
511
+ comment: '@doc with heredocs is treated as documentation' },
512
+ { token: 'comment.documentation.false',
513
+ regex: '@(?:module|type)?doc false',
514
+ comment: '@doc false is treated as documentation' },
515
+ { token: 'comment.documentation.string',
516
+ regex: '@(?:module|type)?doc "',
517
+ push:
518
+ [ { token: 'comment.documentation.string',
519
+ regex: '"',
520
+ next: 'pop' },
521
+ { include: '#interpolated_elixir' },
522
+ { include: '#escaped_char' },
523
+ { defaultToken: 'comment.documentation.string' } ],
524
+ comment: '@doc with string is treated as documentation' },
525
+ { token: 'keyword.control.elixir',
526
+ regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])',
527
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
528
+ originalRegex: '(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])' },
529
+ { token: 'keyword.operator.elixir',
530
+ regex: '\\b(?:and|not|or|when|xor|in|inlist|inbits)\\b',
531
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
532
+ originalRegex: '(?<!\\.)\\b(and|not|or|when|xor|in|inlist|inbits)\\b',
533
+ comment: ' as above, just doesn\'t need a \'end\' and does a logic operation' },
534
+ { token: 'constant.language.elixir',
535
+ regex: '\\b(?:nil|true|false)\\b(?![?!])' },
536
+ { token: 'variable.language.elixir',
537
+ regex: '\\b__(?:CALLER|ENV|MODULE|DIR)__\\b(?![?!])' },
538
+ { token:
539
+ [ 'punctuation.definition.variable.elixir',
540
+ 'variable.other.readwrite.module.elixir' ],
541
+ regex: '(@)([a-zA-Z_]\\w*)' },
542
+ { token:
543
+ [ 'punctuation.definition.variable.elixir',
544
+ 'variable.other.anonymous.elixir' ],
545
+ regex: '(&)(\\d*)' },
546
+ { token: 'variable.other.constant.elixir',
547
+ regex: '\\b[A-Z]\\w*\\b' },
548
+ { token: 'constant.numeric.elixir',
549
+ regex: '\\b(?:0x[\\da-fA-F](?:_?[\\da-fA-F])*|\\d(?:_?\\d)*(?:\\.(?![^[:space:][:digit:]])(?:_?\\d)*)?(?:[eE][-+]?\\d(?:_?\\d)*)?|0b[01]+|0o[0-7]+)\\b',
550
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
551
+ originalRegex: '\\b(0x\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' },
552
+ { token: 'punctuation.definition.constant.elixir',
553
+ regex: ':\'',
554
+ push:
555
+ [ { token: 'punctuation.definition.constant.elixir',
556
+ regex: '\'',
557
+ next: 'pop' },
558
+ { include: '#interpolated_elixir' },
559
+ { include: '#escaped_char' },
560
+ { defaultToken: 'constant.other.symbol.single-quoted.elixir' } ] },
561
+ { token: 'punctuation.definition.constant.elixir',
562
+ regex: ':"',
563
+ push:
564
+ [ { token: 'punctuation.definition.constant.elixir',
565
+ regex: '"',
566
+ next: 'pop' },
567
+ { include: '#interpolated_elixir' },
568
+ { include: '#escaped_char' },
569
+ { defaultToken: 'constant.other.symbol.double-quoted.elixir' } ] },
570
+ { token: 'punctuation.definition.string.begin.elixir',
571
+ regex: '(?:\'\'\')',
572
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
573
+ originalRegex: '(?>\'\'\')',
574
+ push:
575
+ [ { token: 'punctuation.definition.string.end.elixir',
576
+ regex: '^\\s*\'\'\'',
577
+ next: 'pop' },
578
+ { include: '#interpolated_elixir' },
579
+ { include: '#escaped_char' },
580
+ { defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' } ],
581
+ comment: 'Single-quoted heredocs' },
582
+ { token: 'punctuation.definition.string.begin.elixir',
583
+ regex: '\'',
584
+ push:
585
+ [ { token: 'punctuation.definition.string.end.elixir',
586
+ regex: '\'',
587
+ next: 'pop' },
588
+ { include: '#interpolated_elixir' },
589
+ { include: '#escaped_char' },
590
+ { defaultToken: 'support.function.variable.quoted.single.elixir' } ],
591
+ comment: 'single quoted string (allows for interpolation)' },
592
+ { token: 'punctuation.definition.string.begin.elixir',
593
+ regex: '(?:""")',
594
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
595
+ originalRegex: '(?>""")',
596
+ push:
597
+ [ { token: 'punctuation.definition.string.end.elixir',
598
+ regex: '^\\s*"""',
599
+ next: 'pop' },
600
+ { include: '#interpolated_elixir' },
601
+ { include: '#escaped_char' },
602
+ { defaultToken: 'string.quoted.double.heredoc.elixir' } ],
603
+ comment: 'Double-quoted heredocs' },
604
+ { token: 'punctuation.definition.string.begin.elixir',
605
+ regex: '"',
606
+ push:
607
+ [ { token: 'punctuation.definition.string.end.elixir',
608
+ regex: '"',
609
+ next: 'pop' },
610
+ { include: '#interpolated_elixir' },
611
+ { include: '#escaped_char' },
612
+ { defaultToken: 'string.quoted.double.elixir' } ],
613
+ comment: 'double quoted string (allows for interpolation)' },
614
+ { token: 'punctuation.definition.string.begin.elixir',
615
+ regex: '~[a-z](?:""")',
616
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
617
+ originalRegex: '~[a-z](?>""")',
618
+ push:
619
+ [ { token: 'punctuation.definition.string.end.elixir',
620
+ regex: '^\\s*"""',
621
+ next: 'pop' },
622
+ { include: '#interpolated_elixir' },
623
+ { include: '#escaped_char' },
624
+ { defaultToken: 'string.quoted.double.heredoc.elixir' } ],
625
+ comment: 'Double-quoted heredocs sigils' },
626
+ { token: 'punctuation.definition.string.begin.elixir',
627
+ regex: '~[a-z]\\{',
628
+ push:
629
+ [ { token: 'punctuation.definition.string.end.elixir',
630
+ regex: '\\}[a-z]*',
631
+ next: 'pop' },
632
+ { include: '#interpolated_elixir' },
633
+ { include: '#escaped_char' },
634
+ { defaultToken: 'string.interpolated.elixir' } ],
635
+ comment: 'sigil (allow for interpolation)' },
636
+ { token: 'punctuation.definition.string.begin.elixir',
637
+ regex: '~[a-z]\\[',
638
+ push:
639
+ [ { token: 'punctuation.definition.string.end.elixir',
640
+ regex: '\\][a-z]*',
641
+ next: 'pop' },
642
+ { include: '#interpolated_elixir' },
643
+ { include: '#escaped_char' },
644
+ { defaultToken: 'string.interpolated.elixir' } ],
645
+ comment: 'sigil (allow for interpolation)' },
646
+ { token: 'punctuation.definition.string.begin.elixir',
647
+ regex: '~[a-z]\\<',
648
+ push:
649
+ [ { token: 'punctuation.definition.string.end.elixir',
650
+ regex: '\\>[a-z]*',
651
+ next: 'pop' },
652
+ { include: '#interpolated_elixir' },
653
+ { include: '#escaped_char' },
654
+ { defaultToken: 'string.interpolated.elixir' } ],
655
+ comment: 'sigil (allow for interpolation)' },
656
+ { token: 'punctuation.definition.string.begin.elixir',
657
+ regex: '~[a-z]\\(',
658
+ push:
659
+ [ { token: 'punctuation.definition.string.end.elixir',
660
+ regex: '\\)[a-z]*',
661
+ next: 'pop' },
662
+ { include: '#interpolated_elixir' },
663
+ { include: '#escaped_char' },
664
+ { defaultToken: 'string.interpolated.elixir' } ],
665
+ comment: 'sigil (allow for interpolation)' },
666
+ { token: 'punctuation.definition.string.begin.elixir',
667
+ regex: '~[a-z][^\\w]',
668
+ push:
669
+ [ { token: 'punctuation.definition.string.end.elixir',
670
+ regex: '[^\\w][a-z]*',
671
+ next: 'pop' },
672
+ { include: '#interpolated_elixir' },
673
+ { include: '#escaped_char' },
674
+ { include: '#escaped_char' },
675
+ { defaultToken: 'string.interpolated.elixir' } ],
676
+ comment: 'sigil (allow for interpolation)' },
677
+ { token: 'punctuation.definition.string.begin.elixir',
678
+ regex: '~[A-Z](?:""")',
679
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
680
+ originalRegex: '~[A-Z](?>""")',
681
+ push:
682
+ [ { token: 'punctuation.definition.string.end.elixir',
683
+ regex: '^\\s*"""',
684
+ next: 'pop' },
685
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
686
+ comment: 'Double-quoted heredocs sigils' },
687
+ { token: 'punctuation.definition.string.begin.elixir',
688
+ regex: '~[A-Z]\\{',
689
+ push:
690
+ [ { token: 'punctuation.definition.string.end.elixir',
691
+ regex: '\\}[a-z]*',
692
+ next: 'pop' },
693
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
694
+ comment: 'sigil (without interpolation)' },
695
+ { token: 'punctuation.definition.string.begin.elixir',
696
+ regex: '~[A-Z]\\[',
697
+ push:
698
+ [ { token: 'punctuation.definition.string.end.elixir',
699
+ regex: '\\][a-z]*',
700
+ next: 'pop' },
701
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
702
+ comment: 'sigil (without interpolation)' },
703
+ { token: 'punctuation.definition.string.begin.elixir',
704
+ regex: '~[A-Z]\\<',
705
+ push:
706
+ [ { token: 'punctuation.definition.string.end.elixir',
707
+ regex: '\\>[a-z]*',
708
+ next: 'pop' },
709
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
710
+ comment: 'sigil (without interpolation)' },
711
+ { token: 'punctuation.definition.string.begin.elixir',
712
+ regex: '~[A-Z]\\(',
713
+ push:
714
+ [ { token: 'punctuation.definition.string.end.elixir',
715
+ regex: '\\)[a-z]*',
716
+ next: 'pop' },
717
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
718
+ comment: 'sigil (without interpolation)' },
719
+ { token: 'punctuation.definition.string.begin.elixir',
720
+ regex: '~[A-Z][^\\w]',
721
+ push:
722
+ [ { token: 'punctuation.definition.string.end.elixir',
723
+ regex: '[^\\w][a-z]*',
724
+ next: 'pop' },
725
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
726
+ comment: 'sigil (without interpolation)' },
727
+ { token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'],
728
+ regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)',
729
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
730
+ originalRegex: '(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)',
731
+ comment: 'symbols' },
732
+ { token: 'punctuation.definition.constant.elixir',
733
+ regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)',
734
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
735
+ originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)',
736
+ comment: 'symbols' },
737
+ { token:
738
+ [ 'punctuation.definition.comment.elixir',
739
+ 'comment.line.number-sign.elixir' ],
740
+ regex: '(#)(.*)' },
741
+ { token: 'constant.numeric.elixir',
742
+ regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])',
743
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
744
+ originalRegex: '(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|[^xMC])|[^\\s\\\\])',
745
+ comment: '\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t' },
746
+ /* { token: 'punctuation.separator.variable.elixir',
747
+ regex: '(?<=\\{|do|\\{\\s|do\\s)\\|',
748
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
749
+ originalRegex: '(?<=\\{|do|\\{\\s|do\\s)(\\|)',
750
+ push:
751
+ [ { token: 'punctuation.separator.variable.elixir',
752
+ regex: '\\|',
753
+ next: 'pop' },
754
+ { token: 'variable.other.block.elixir',
755
+ regex: '[_a-zA-Z][_a-zA-Z0-9]*' },
756
+ { token: 'punctuation.separator.variable.elixir', regex: ',' } ] },*/
757
+ { token: 'keyword.operator.assignment.augmented.elixir',
758
+ regex: '\\+=|\\-=|\\|\\|=|~=|&&=' },
759
+ { token: 'keyword.operator.comparison.elixir',
760
+ regex: '===?|!==?|<=?|>=?' },
761
+ { token: 'keyword.operator.bitwise.elixir',
762
+ regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' },
763
+ { token: 'keyword.operator.logical.elixir',
764
+ regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b',
765
+ originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' },
766
+ { token: 'keyword.operator.arithmetic.elixir',
767
+ regex: '\\*|\\+|\\-|/' },
768
+ { token: 'keyword.operator.other.elixir',
769
+ regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' },
770
+ { token: 'keyword.operator.assignment.elixir', regex: '=' },
771
+ { token: 'punctuation.separator.other.elixir', regex: ':' },
772
+ { token: 'punctuation.separator.statement.elixir',
773
+ regex: '\\;' },
774
+ { token: 'punctuation.separator.object.elixir', regex: ',' },
775
+ { token: 'punctuation.separator.method.elixir', regex: '\\.' },
776
+ { token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' },
777
+ { token: 'punctuation.section.array.elixir', regex: '\\[|\\]' },
778
+ { token: 'punctuation.section.function.elixir',
779
+ regex: '\\(|\\)' } ],
780
+ '#escaped_char':
781
+ [ { token: 'constant.character.escape.elixir',
782
+ regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' } ],
783
+ '#interpolated_elixir':
784
+ [ { token:
785
+ [ 'source.elixir.embedded.source',
786
+ 'source.elixir.embedded.source.empty' ],
787
+ regex: '(#\\{)(\\})' },
788
+ { todo:
789
+ { token: 'punctuation.section.embedded.elixir',
790
+ regex: '#\\{',
791
+ push:
792
+ [ { token: 'punctuation.section.embedded.elixir',
793
+ regex: '\\}',
794
+ next: 'pop' },
795
+ { include: '#nest_curly_and_self' },
796
+ { include: '$self' },
797
+ { defaultToken: 'source.elixir.embedded.source' } ] } } ],
798
+ '#nest_curly_and_self':
799
+ [ { token: 'punctuation.section.scope.elixir',
800
+ regex: '\\{',
801
+ push:
802
+ [ { token: 'punctuation.section.scope.elixir',
803
+ regex: '\\}',
804
+ next: 'pop' },
805
+ { include: '#nest_curly_and_self' } ] },
806
+ { include: '$self' } ],
807
+ '#regex_sub':
808
+ [ { include: '#interpolated_elixir' },
809
+ { include: '#escaped_char' },
810
+ { token:
811
+ [ 'punctuation.definition.arbitrary-repitition.elixir',
812
+ 'string.regexp.arbitrary-repitition.elixir',
813
+ 'string.regexp.arbitrary-repitition.elixir',
814
+ 'punctuation.definition.arbitrary-repitition.elixir' ],
815
+ regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' },
816
+ { token: 'punctuation.definition.character-class.elixir',
817
+ regex: '\\[(?:\\^?\\])?',
818
+ push:
819
+ [ { token: 'punctuation.definition.character-class.elixir',
820
+ regex: '\\]',
821
+ next: 'pop' },
822
+ { include: '#escaped_char' },
823
+ { defaultToken: 'string.regexp.character-class.elixir' } ] },
824
+ { token: 'punctuation.definition.group.elixir',
825
+ regex: '\\(',
826
+ push:
827
+ [ { token: 'punctuation.definition.group.elixir',
828
+ regex: '\\)',
829
+ next: 'pop' },
830
+ { include: '#regex_sub' },
831
+ { defaultToken: 'string.regexp.group.elixir' } ] },
832
+ { token:
833
+ [ 'punctuation.definition.comment.elixir',
834
+ 'comment.line.number-sign.elixir' ],
835
+ regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)',
836
+ originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$',
837
+ comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' } ] };
838
+
839
+ this.normalizeRules();
840
+ };
841
+
842
+ ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.',
843
+ fileTypes: [ 'ex', 'exs' ],
844
+ firstLineMatch: '^#!/.*\\belixir',
845
+ foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$',
846
+ foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)',
847
+ keyEquivalent: '^~E',
848
+ name: 'Elixir',
849
+ scopeName: 'source.elixir' };
850
+
851
+
852
+ oop.inherits(ElixirHighlightRules, TextHighlightRules);
853
+
854
+ exports.ElixirHighlightRules = ElixirHighlightRules;
855
+ });
856
+
857
+
858
+ // Ace highlight rules function imported below.
859
+ var HighlightRules = require("elixir_highlight_rules").ElixirHighlightRules;
860
+
861
+
862
+
863
+ // Ace's Syntax Tokenizer.
864
+
865
+ // tokenizing lines longer than this makes editor very slow
866
+ var MAX_TOKEN_COUNT = 1000;
867
+ var Tokenizer = function(rules) {
868
+ this.states = rules;
869
+
870
+ this.regExps = {};
871
+ this.matchMappings = {};
872
+ for (var key in this.states) {
873
+ var state = this.states[key];
874
+ var ruleRegExps = [];
875
+ var matchTotal = 0;
876
+ var mapping = this.matchMappings[key] = {defaultToken: "text"};
877
+ var flag = "g";
878
+
879
+ var splitterRurles = [];
880
+ for (var i = 0; i < state.length; i++) {
881
+ var rule = state[i];
882
+ if (rule.defaultToken)
883
+ mapping.defaultToken = rule.defaultToken;
884
+ if (rule.caseInsensitive)
885
+ flag = "gi";
886
+ if (rule.regex == null)
887
+ continue;
888
+
889
+ if (rule.regex instanceof RegExp)
890
+ rule.regex = rule.regex.toString().slice(1, -1);
891
+
892
+ // Count number of matching groups. 2 extra groups from the full match
893
+ // And the catch-all on the end (used to force a match);
894
+ var adjustedregex = rule.regex;
895
+ var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2;
896
+ if (Array.isArray(rule.token)) {
897
+ if (rule.token.length == 1 || matchcount == 1) {
898
+ rule.token = rule.token[0];
899
+ } else if (matchcount - 1 != rule.token.length) {
900
+ throw new Error("number of classes and regexp groups in '" +
901
+ rule.token + "'\n'" + rule.regex + "' doesn't match\n"
902
+ + (matchcount - 1) + "!=" + rule.token.length);
903
+ } else {
904
+ rule.tokenArray = rule.token;
905
+ rule.token = null;
906
+ rule.onMatch = this.$arrayTokens;
907
+ }
908
+ } else if (typeof rule.token == "function" && !rule.onMatch) {
909
+ if (matchcount > 1)
910
+ rule.onMatch = this.$applyToken;
911
+ else
912
+ rule.onMatch = rule.token;
913
+ }
914
+
915
+ if (matchcount > 1) {
916
+ if (/\\\d/.test(rule.regex)) {
917
+ // Replace any backreferences and offset appropriately.
918
+ adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) {
919
+ return "\\" + (parseInt(digit, 10) + matchTotal + 1);
920
+ });
921
+ } else {
922
+ matchcount = 1;
923
+ adjustedregex = this.removeCapturingGroups(rule.regex);
924
+ }
925
+ if (!rule.splitRegex && typeof rule.token != "string")
926
+ splitterRurles.push(rule); // flag will be known only at the very end
927
+ }
928
+
929
+ mapping[matchTotal] = i;
930
+ matchTotal += matchcount;
931
+
932
+ ruleRegExps.push(adjustedregex);
933
+
934
+ // makes property access faster
935
+ if (!rule.onMatch)
936
+ rule.onMatch = null;
937
+ }
938
+
939
+ splitterRurles.forEach(function(rule) {
940
+ rule.splitRegex = this.createSplitterRegexp(rule.regex, flag);
941
+ }, this);
942
+
943
+ this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag);
944
+ }
945
+ };
946
+
947
+ (function() {
948
+ this.$setMaxTokenCount = function(m) {
949
+ MAX_TOKEN_COUNT = m | 0;
950
+ };
951
+
952
+ this.$applyToken = function(str) {
953
+ var values = this.splitRegex.exec(str).slice(1);
954
+ var types = this.token.apply(this, values);
955
+
956
+ // required for compatibility with old modes
957
+ if (typeof types === "string")
958
+ return [{type: types, value: str}];
959
+
960
+ var tokens = [];
961
+ for (var i = 0, l = types.length; i < l; i++) {
962
+ if (values[i])
963
+ tokens[tokens.length] = {
964
+ type: types[i],
965
+ value: values[i]
966
+ };
967
+ }
968
+ return tokens;
969
+ },
970
+
971
+ this.$arrayTokens = function(str) {
972
+ if (!str)
973
+ return [];
974
+ var values = this.splitRegex.exec(str);
975
+ if (!values)
976
+ return "text";
977
+ var tokens = [];
978
+ var types = this.tokenArray;
979
+ for (var i = 0, l = types.length; i < l; i++) {
980
+ if (values[i + 1])
981
+ tokens[tokens.length] = {
982
+ type: types[i],
983
+ value: values[i + 1]
984
+ };
985
+ }
986
+ return tokens;
987
+ };
988
+
989
+ this.removeCapturingGroups = function(src) {
990
+ var r = src.replace(
991
+ /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g,
992
+ function(x, y) {return y ? "(?:" : x;}
993
+ );
994
+ return r;
995
+ };
996
+
997
+ this.createSplitterRegexp = function(src, flag) {
998
+ if (src.indexOf("(?=") != -1) {
999
+ var stack = 0;
1000
+ var inChClass = false;
1001
+ var lastCapture = {};
1002
+ src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function(
1003
+ m, esc, parenOpen, parenClose, square, index
1004
+ ) {
1005
+ if (inChClass) {
1006
+ inChClass = square != "]";
1007
+ } else if (square) {
1008
+ inChClass = true;
1009
+ } else if (parenClose) {
1010
+ if (stack == lastCapture.stack) {
1011
+ lastCapture.end = index+1;
1012
+ lastCapture.stack = -1;
1013
+ }
1014
+ stack--;
1015
+ } else if (parenOpen) {
1016
+ stack++;
1017
+ if (parenOpen.length != 1) {
1018
+ lastCapture.stack = stack
1019
+ lastCapture.start = index;
1020
+ }
1021
+ }
1022
+ return m;
1023
+ });
1024
+
1025
+ if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end)))
1026
+ src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end);
1027
+ }
1028
+ return new RegExp(src, (flag||"").replace("g", ""));
1029
+ };
1030
+
1031
+ /**
1032
+ * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state.
1033
+ * @returns {Object}
1034
+ **/
1035
+ this.getLineTokens = function(line, startState) {
1036
+ if (startState && typeof startState != "string") {
1037
+ var stack = startState.slice(0);
1038
+ startState = stack[0];
1039
+ } else
1040
+ var stack = [];
1041
+
1042
+ var currentState = startState || "start";
1043
+ var state = this.states[currentState];
1044
+ if (!state) {
1045
+ currentState = "start";
1046
+ state = this.states[currentState];
1047
+ }
1048
+ var mapping = this.matchMappings[currentState];
1049
+ var re = this.regExps[currentState];
1050
+ re.lastIndex = 0;
1051
+
1052
+ var match, tokens = [];
1053
+ var lastIndex = 0;
1054
+
1055
+ var token = {type: null, value: ""};
1056
+
1057
+ while (match = re.exec(line)) {
1058
+ var type = mapping.defaultToken;
1059
+ var rule = null;
1060
+ var value = match[0];
1061
+ var index = re.lastIndex;
1062
+
1063
+ if (index - value.length > lastIndex) {
1064
+ var skipped = line.substring(lastIndex, index - value.length);
1065
+ if (token.type == type) {
1066
+ token.value += skipped;
1067
+ } else {
1068
+ if (token.type)
1069
+ tokens.push(token);
1070
+ token = {type: type, value: skipped};
1071
+ }
1072
+ }
1073
+
1074
+ for (var i = 0; i < match.length-2; i++) {
1075
+ if (match[i + 1] === undefined)
1076
+ continue;
1077
+
1078
+ rule = state[mapping[i]];
1079
+
1080
+ if (rule.onMatch)
1081
+ type = rule.onMatch(value, currentState, stack);
1082
+ else
1083
+ type = rule.token;
1084
+
1085
+ if (rule.next) {
1086
+ if (typeof rule.next == "string")
1087
+ currentState = rule.next;
1088
+ else
1089
+ currentState = rule.next(currentState, stack);
1090
+
1091
+ state = this.states[currentState];
1092
+ if (!state) {
1093
+ window.console && console.error && console.error(currentState, "doesn't exist");
1094
+ currentState = "start";
1095
+ state = this.states[currentState];
1096
+ }
1097
+ mapping = this.matchMappings[currentState];
1098
+ lastIndex = index;
1099
+ re = this.regExps[currentState];
1100
+ re.lastIndex = index;
1101
+ }
1102
+ break;
1103
+ }
1104
+
1105
+ if (value) {
1106
+ if (typeof type == "string") {
1107
+ if ((!rule || rule.merge !== false) && token.type === type) {
1108
+ token.value += value;
1109
+ } else {
1110
+ if (token.type)
1111
+ tokens.push(token);
1112
+ token = {type: type, value: value};
1113
+ }
1114
+ } else if (type) {
1115
+ if (token.type)
1116
+ tokens.push(token);
1117
+ token = {type: null, value: ""};
1118
+ for (var i = 0; i < type.length; i++)
1119
+ tokens.push(type[i]);
1120
+ }
1121
+ }
1122
+
1123
+ if (lastIndex == line.length)
1124
+ break;
1125
+
1126
+ lastIndex = index;
1127
+
1128
+ if (tokens.length > MAX_TOKEN_COUNT) {
1129
+ // chrome doens't show contents of text nodes with very long text
1130
+ while (lastIndex < line.length) {
1131
+ if (token.type)
1132
+ tokens.push(token);
1133
+ token = {
1134
+ value: line.substring(lastIndex, lastIndex += 2000),
1135
+ type: "overflow"
1136
+ };
1137
+ }
1138
+ currentState = "start";
1139
+ stack = [];
1140
+ break;
1141
+ }
1142
+ }
1143
+
1144
+ if (token.type)
1145
+ tokens.push(token);
1146
+
1147
+ if (stack.length > 1) {
1148
+ if (stack[0] !== currentState)
1149
+ stack.unshift(currentState);
1150
+ }
1151
+ return {
1152
+ tokens : tokens,
1153
+ state : stack.length ? stack : currentState
1154
+ };
1155
+ };
1156
+
1157
+ }).call(Tokenizer.prototype);
1158
+
1159
+ // Token conversion.
1160
+ // See <https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#common-tokens>
1161
+ // This is not an exact match nor the best match that can be made.
1162
+ var tokenFromAceToken = {
1163
+ empty: null,
1164
+ text: null,
1165
+
1166
+ // Keyword
1167
+ keyword: 'keyword',
1168
+ control: 'keyword',
1169
+ operator: 'operator',
1170
+
1171
+ // Constants
1172
+ constant: 'atom',
1173
+ numeric: 'number',
1174
+ character: 'atom',
1175
+ escape: 'atom',
1176
+
1177
+ // Variables
1178
+ variable: 'variable',
1179
+ parameter: 'variable-3',
1180
+ language: 'variable-2', // Python's `self` uses that.
1181
+
1182
+ // Comments
1183
+ comment: 'comment',
1184
+ line: 'comment',
1185
+ 'double-slash': 'comment',
1186
+ 'double-dash': 'comment',
1187
+ 'number-sign': 'comment',
1188
+ percentage: 'comment',
1189
+ block: 'comment',
1190
+ documentation: 'comment',
1191
+
1192
+ // String
1193
+ string: 'string',
1194
+ quoted: 'string',
1195
+ single: 'string',
1196
+ double: 'string',
1197
+ triple: 'string',
1198
+ unquoted: 'string',
1199
+ interpolated: 'string',
1200
+ regexp: 'string-2',
1201
+
1202
+ meta: 'meta',
1203
+ literal: 'qualifier',
1204
+ support: 'builtin',
1205
+
1206
+ // Markup
1207
+ markup: 'tag',
1208
+ underline: 'link',
1209
+ link: 'link',
1210
+ bold: 'strong',
1211
+ heading: 'header',
1212
+ italic: 'em',
1213
+ list: 'variable-2',
1214
+ numbered: 'variable-2',
1215
+ unnumbered: 'variable-2',
1216
+ quote: 'quote',
1217
+ raw: 'variable-2', // Markdown's raw block uses that.
1218
+
1219
+ // Invalid
1220
+ invalid: 'error',
1221
+ illegal: 'invalidchar',
1222
+ deprecated: 'error'
1223
+ };
1224
+
1225
+ // Takes a list of Ace tokens, returns a (string) CodeMirror token.
1226
+ var cmTokenFromAceTokens = function(tokens) {
1227
+ var token = null;
1228
+ for (var i = 0; i < tokens.length; i++) {
1229
+ // Find the most specific token.
1230
+ if (tokenFromAceToken[tokens[i]] !== undefined) {
1231
+ token = tokenFromAceToken[tokens[i]];
1232
+ }
1233
+ }
1234
+ return token;
1235
+ };
1236
+
1237
+ // Consume a token from plannedTokens.
1238
+ var consumeToken = function(stream, state) {
1239
+ var plannedToken = state.plannedTokens.shift();
1240
+ if (plannedToken === undefined) {
1241
+ return null;
1242
+ }
1243
+ stream.match(plannedToken.value);
1244
+ var tokens = plannedToken.type.split('.');
1245
+ return cmTokenFromAceTokens(tokens);
1246
+ };
1247
+
1248
+ var matchToken = function(stream, state) {
1249
+ // Anormal start: we already have planned tokens to consume.
1250
+ if (state.plannedTokens.length > 0) {
1251
+ return consumeToken(stream, state);
1252
+ }
1253
+
1254
+ // Normal start.
1255
+ var currentState = state.current;
1256
+ var currentLine = stream.match(/.*$/, false)[0];
1257
+ var tokenized = tokenizer.getLineTokens(currentLine, currentState);
1258
+ // We got a {tokens, state} object.
1259
+ // Each token is a {value, type} object.
1260
+ state.plannedTokens = tokenized.tokens;
1261
+ state.current = tokenized.state;
1262
+
1263
+ // Consume a token.
1264
+ return consumeToken(stream, state);
1265
+ }
1266
+
1267
+ // Initialize all state.
1268
+ var aceHighlightRules = new HighlightRules();
1269
+ var tokenizer = new Tokenizer(aceHighlightRules.$rules);
1270
+
1271
+ return {
1272
+ startState: function() {
1273
+ return {
1274
+ current: 'start',
1275
+ // List of {value, type}, with type being an Ace token string.
1276
+ plannedTokens: []
1277
+ };
1278
+ },
1279
+ blankLine: function(state) { matchToken('', state); },
1280
+ token: matchToken
1281
+ };
1282
+ });
1283
+
1284
+ CodeMirror.defineMIME("text/x-elixir", "elixir");