?
Path : /home/admin/public_html/old/media/editors/codemirror/mode/clike/ |
Current File : /home/admin/public_html/old/media/editors/codemirror/mode/clike/clike.min.js |
!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b){if(!b.startOfLine)return!1;for(;;){if(!a.skipTo("\\")){a.skipToEnd(),b.tokenize=null;break}if(a.next(),a.eol()){b.tokenize=c;break}}return"meta"}function d(a,b){return"variable-3"==b.prevToken?"variable-3":!1}function e(a,b){if(a.backUp(1),a.match(/(R|u8R|uR|UR|LR)/)){var c=a.match(/"([^\s\\()]{0,16})\(/);return c?(b.cpp11RawStringDelim=c[1],b.tokenize=g,g(a,b)):!1}return a.match(/(u8|u|U|L)/)?a.match(/["']/,!1)?"string":!1:(a.next(),!1)}function f(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function g(a,b){var c=b.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),d=a.match(new RegExp(".*?\\)"+c+'"'));return d?b.tokenize=null:a.skipToEnd(),"string"}function h(b,c){function d(a){if(a)for(var b in a)a.hasOwnProperty(b)&&e.push(b)}"string"==typeof b&&(b=[b]);var e=[];d(c.keywords),d(c.types),d(c.builtin),d(c.atoms),e.length&&(c.helperType=b[0],a.registerHelper("hintWords",b[0],e));for(var f=0;f<b.length;++f)a.defineMIME(b[f],c)}function i(a,b){for(var c=!1;!a.eol();){if(!c&&a.match('"""')){b.tokenize=null;break}c="\\"==a.next()&&!c}return"string"}a.defineMode("clike",function(b,c){function d(a,b){var c=a.next();if(w[c]){var d=w[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=e(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return l=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if("/"==c){if(a.eat("*"))return b.tokenize=f,f(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(A.test(c))return a.eatWhile(A),"operator";a.eatWhile(/[\w\$_\xa1-\uffff]/);var g=a.current();return q.propertyIsEnumerable(g)?(t.propertyIsEnumerable(g)&&(l="newstatement"),u.propertyIsEnumerable(g)&&(m=!0),"keyword"):r.propertyIsEnumerable(g)?"variable-3":s.propertyIsEnumerable(g)?(t.propertyIsEnumerable(g)&&(l="newstatement"),"builtin"):v.propertyIsEnumerable(g)?"atom":"variable"}function e(a){return function(b,c){for(var d,e=!1,f=!1;null!=(d=b.next());){if(d==a&&!e){f=!0;break}e=!e&&"\\"==d}return(f||!e&&!x)&&(c.tokenize=null),"string"}}function f(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=null;break}d="*"==c}return"comment"}function g(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function h(a){return"statement"==a.type||"switchstatement"==a.type}function i(a,b,c){var d=a.indented;return a.context&&h(a.context)&&(d=a.context.indented),a.context=new g(d,b,c,null,a.context)}function j(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}function k(a,b){return"variable"==b.prevToken||"variable-3"==b.prevToken?!0:/\S[>*\]]\s*$|\*$/.test(a.string.slice(0,a.start))?!0:void 0}var l,m,n=b.indentUnit,o=c.statementIndentUnit||n,p=c.dontAlignCalls,q=c.keywords||{},r=c.types||{},s=c.builtin||{},t=c.blockKeywords||{},u=c.defKeywords||{},v=c.atoms||{},w=c.hooks||{},x=c.multiLineStrings,y=c.indentStatements!==!1,z=c.indentSwitch!==!1,A=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new g((a||0)-n,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var e=b.context;if(a.sol()&&(null==e.align&&(e.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;l=m=null;var f=(b.tokenize||d)(a,b);if("comment"==f||"meta"==f)return f;if(null==e.align&&(e.align=!0),";"!=l&&":"!=l&&","!=l||!h(e)){if("{"==l)i(b,a.column(),"}");else if("["==l)i(b,a.column(),"]");else if("("==l)i(b,a.column(),")");else if("}"==l){for(;h(e);)e=j(b);for("}"==e.type&&(e=j(b));h(e);)e=j(b)}else if(l==e.type)j(b);else if(y&&(("}"==e.type||"top"==e.type)&&";"!=l||h(e)&&"newstatement"==l)){var g="statement";"newstatement"==l&&z&&"switch"==a.current()&&(g="switchstatement"),i(b,a.column(),g)}}else j(b);return"variable"==f&&("def"==b.prevToken||c.typeFirstDefinitions&&k(a,b)&&a.match(/^\s*\(/,!1))&&(f="def"),b.startOfLine=!1,b.prevToken=m?"def":f,f},indent:function(b,c){if(b.tokenize!=d&&null!=b.tokenize)return a.Pass;var e=b.context,f=c&&c.charAt(0);h(e)&&"}"==f&&(e=e.prev);var g=f==e.type,i=e.prev&&"switchstatement"==e.prev.type;return h(e)?e.indented+("{"==f?0:o):!e.align||p&&")"==e.type?")"!=e.type||g?e.indented+(g?0:n)+(g||!i||/^(?:case|default)\b/.test(c)?0:n):e.indented+o:e.column+(g?0:1)},electricInput:z?/^\s*(?:case .*?:|default:|\{|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var j="auto if break case register continue return default do sizeof static else struct switch extern typedef float union for goto while enum const volatile true false",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:b(j),types:b(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:b("case do else for if switch while struct"),defKeywords:b("struct"),typeFirstDefinitions:!0,atoms:b("null"),hooks:{"#":c,"*":d},modeProps:{fold:["brace","include"]}}),h(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:b(j+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:b(k+"bool wchar_t"),blockKeywords:b("catch class do else finally for if struct switch try while"),defKeywords:b("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":c,"*":d,u:e,U:e,L:e,R:e},modeProps:{fold:["brace","include"]}}),h("text/x-java",{name:"clike",keywords:b("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"),types:b("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:b("catch class do else finally for if switch try while"),defKeywords:b("class interface package enum"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),h("text/x-csharp",{name:"clike",keywords:b("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:b("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:b("catch class do else finally for foreach if struct switch try while"),defKeywords:b("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=f,f(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),h("text/x-scala",{name:"clike",keywords:b("abstract case catch class def do else extends false 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:b("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq 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:b("catch class do else finally for forSome if match switch try while"),defKeywords:b("class def object package trait type val var"),atoms:b("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return a.match('""')?(b.tokenize=i,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),h(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("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:b("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:{"#":c},modeProps:{fold:["brace","include"]}}),h("text/x-nesc",{name:"clike",keywords:b(j+"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:b(k),blockKeywords:b("case do else for if switch while struct"),atoms:b("null"),hooks:{"#":c},modeProps:{fold:["brace","include"]}}),h("text/x-objectivec",{name:"clike",keywords:b(j+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:b(k),atoms:b("YES NO NULL NILL ON OFF"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":c},modeProps:{fold:"brace"}})});