Server IP : 195.201.23.43 / Your IP : 3.144.136.254 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/kdecoratie/public_html/media/editors/codemirror/mode/soy/ |
Upload File : |
!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],a):a(CodeMirror)})((function(a){"use strict";var b={noEndTag:!0,soyState:"param-def"},c={alias:{noEndTag:!0},delpackage:{noEndTag:!0},namespace:{noEndTag:!0,soyState:"namespace-def"},"@attribute":b,"@attribute?":b,"@param":b,"@param?":b,"@inject":b,"@inject?":b,"@state":b,template:{soyState:"templ-def",variableScope:!0},literal:{},msg:{},fallbackmsg:{noEndTag:!0,reduceIndent:!0},select:{},plural:{},let:{soyState:"var-def"},if:{},elseif:{noEndTag:!0,reduceIndent:!0},else:{noEndTag:!0,reduceIndent:!0},switch:{},case:{noEndTag:!0,reduceIndent:!0},default:{noEndTag:!0,reduceIndent:!0},foreach:{variableScope:!0,soyState:"for-loop"},ifempty:{noEndTag:!0,reduceIndent:!0},for:{variableScope:!0,soyState:"for-loop"},call:{soyState:"templ-ref"},param:{soyState:"param-ref"},print:{noEndTag:!0},deltemplate:{soyState:"templ-def",variableScope:!0},delcall:{soyState:"templ-ref"},log:{},element:{variableScope:!0}},d=Object.keys(c).filter((function(a){return!c[a].noEndTag||c[a].reduceIndent}));a.defineMode("soy",(function(b){function e(a){return a[a.length-1]}function f(a,b,c){if(a.sol()){for(var d=0;d<b.indent&&a.eat(/\s/);d++);if(d)return null}var f=a.string,g=c.exec(f.substr(a.pos));g&&(a.string=f.substr(0,a.pos+g.index));var h=a.hideFirstChars(b.indent,(function(){var c=e(b.localStates);return c.mode.token(a,c.state)}));return a.string=f,h}function g(a,b){for(;a;){if(a.element===b)return!0;a=a.next}return!1}function h(a,b){return{element:b,next:a}}function i(a){a.context&&(a.context.scope&&(a.variables=a.context.scope),a.context=a.context.previousContext)}function j(a,b,c){return g(a,b)?"variable-2":c?"variable":"variable-2 error"}function k(a,b,c){this.previousContext=a,this.tag=b,this.kind=null,this.scope=c}function l(a,b){var c;return a.match(/[[]/)?(b.soyState.push("list-literal"),b.context=new k(b.context,"list-literal",b.variables),b.lookupVariables=!1,null):a.match(/map\b/)?(b.soyState.push("map-literal"),"keyword"):a.match(/record\b/)?(b.soyState.push("record-literal"),"keyword"):a.match(/([\w]+)(?=\()/)?"variable callee":(c=a.match(/^["']/))?(b.soyState.push("string"),b.quoteKind=c[0],"string"):a.match(/^[(]/)?(b.soyState.push("open-parentheses"),null):a.match(/(null|true|false)(?!\w)/)||a.match(/0x([0-9a-fA-F]{2,})/)||a.match(/-?([0-9]*[.])?[0-9]+(e[0-9]*)?/)?"atom":a.match(/(\||[+\-*\/%]|[=!]=|\?:|[<>]=?)/)?"operator":(c=a.match(/^\$([\w]+)/))?j(b.variables,c[1],!b.lookupVariables):(c=a.match(/^\w+/))?/^(?:as|and|or|not|in|if)$/.test(c[0])?"keyword":null:(a.next(),null)}var m=a.getMode(b,"text/plain"),n={html:a.getMode(b,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1,allowMissingTagName:!0}),attributes:m,text:m,uri:m,trusted_resource_uri:m,css:a.getMode(b,"text/css"),js:a.getMode(b,{name:"text/javascript",statementIndent:2*b.indentUnit})};return{startState:function(){return{soyState:[],variables:h(null,"ij"),scopes:null,indent:0,quoteKind:null,context:null,lookupVariables:!0,localStates:[{mode:n.html,state:a.startState(n.html)}]}},copyState:function(b){return{tag:b.tag,soyState:b.soyState.concat([]),variables:b.variables,context:b.context,indent:b.indent,quoteKind:b.quoteKind,lookupVariables:b.lookupVariables,localStates:b.localStates.map((function(b){return{mode:b.mode,state:a.copyState(b.mode,b.state)}}))}},token:function(g,m){var o;switch(e(m.soyState)){case"comment":if(g.match(/^.*?\*\//)?m.soyState.pop():g.skipToEnd(),!m.context||!m.context.scope)for(var o,p=/@param\??\s+(\S+)/g,q=g.current();o=p.exec(q);)m.variables=h(m.variables,o[1]);return"comment";case"string":var o=g.match(/^.*?(["']|\\[\s\S])/);return o?o[1]==m.quoteKind&&(m.quoteKind=null,m.soyState.pop()):g.skipToEnd(),"string"}if(!m.soyState.length||"literal"!=e(m.soyState)){if(g.match(/^\/\*/))return m.soyState.push("comment"),"comment";if(g.match(g.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/))return"comment"}switch(e(m.soyState)){case"templ-def":return(o=g.match(/^\.?([\w]+(?!\.[\w]+)*)/))?(m.soyState.pop(),"def"):(g.next(),null);case"templ-ref":return(o=g.match(/(\.?[a-zA-Z_][a-zA-Z_0-9]+)+/))?(m.soyState.pop(),"."==o[0][0]?"variable-2":"variable"):(o=g.match(/^\$([\w]+)/))?(m.soyState.pop(),j(m.variables,o[1],!m.lookupVariables)):(g.next(),null);case"namespace-def":return(o=g.match(/^\.?([\w\.]+)/))?(m.soyState.pop(),"variable"):(g.next(),null);case"param-def":return(o=g.match(/^\*/))?(m.soyState.pop(),m.soyState.push("param-type"),"type"):(o=g.match(/^\w+/))?(m.variables=h(m.variables,o[0]),m.soyState.pop(),m.soyState.push("param-type"),"def"):(g.next(),null);case"param-ref":return(o=g.match(/^\w+/))?(m.soyState.pop(),"property"):(g.next(),null);case"open-parentheses":return g.match(/[)]/)?(m.soyState.pop(),null):l(g,m);case"param-type":var r=g.peek();return-1!="}]=>,".indexOf(r)?(m.soyState.pop(),null):"["==r?(m.soyState.push("param-type-record"),null):"("==r?(m.soyState.push("param-type-template"),null):"<"==r?(m.soyState.push("param-type-parameter"),null):(o=g.match(/^([\w]+|[?])/))?"type":(g.next(),null);case"param-type-record":var r=g.peek();return"]"==r?(m.soyState.pop(),null):g.match(/^\w+/)?(m.soyState.push("param-type"),"property"):(g.next(),null);case"param-type-parameter":return g.match(/^[>]/)?(m.soyState.pop(),null):g.match(/^[<,]/)?(m.soyState.push("param-type"),null):(g.next(),null);case"param-type-template":return g.match(/[>]/)?(m.soyState.pop(),m.soyState.push("param-type"),null):g.match(/^\w+/)?(m.soyState.push("param-type"),"def"):(g.next(),null);case"var-def":return(o=g.match(/^\$([\w]+)/))?(m.variables=h(m.variables,o[1]),m.soyState.pop(),"def"):(g.next(),null);case"for-loop":return g.match(/\bin\b/)?(m.soyState.pop(),"keyword"):"$"==g.peek()?(m.soyState.push("var-def"),null):(g.next(),null);case"record-literal":return g.match(/^[)]/)?(m.soyState.pop(),null):g.match(/[(,]/)?(m.soyState.push("map-value"),m.soyState.push("record-key"),null):(g.next(),null);case"map-literal":return g.match(/^[)]/)?(m.soyState.pop(),null):g.match(/[(,]/)?(m.soyState.push("map-value"),m.soyState.push("map-value"),null):(g.next(),null);case"list-literal":return g.match("]")?(m.soyState.pop(),m.lookupVariables=!0,i(m),null):g.match(/\bfor\b/)?(m.lookupVariables=!0,m.soyState.push("for-loop"),"keyword"):l(g,m);case"record-key":return g.match(/[\w]+/)?"property":g.match(/^[:]/)?(m.soyState.pop(),null):(g.next(),null);case"map-value":return")"==g.peek()||","==g.peek()||g.match(/^[:)]/)?(m.soyState.pop(),null):l(g,m);case"import":return g.eat(";")?(m.soyState.pop(),m.indent-=2*b.indentUnit,null):g.match(/\w+(?=\s+as)/)?"variable":(o=g.match(/\w+/))?/(from|as)/.test(o[0])?"keyword":"def":(o=g.match(/^["']/))?(m.soyState.push("string"),m.quoteKind=o[0],"string"):(g.next(),null);case"tag":var s,t;void 0===m.tag?(s=!0,t=""):(s="/"==m.tag[0],t=s?m.tag.substring(1):m.tag);var u=c[t];if(g.match(/^\/?}/)){var v="/}"==g.current();return v&&!s&&i(m),"/template"==m.tag||"/deltemplate"==m.tag?(m.variables=h(null,"ij"),m.indent=0):m.indent-=b.indentUnit*(v||-1==d.indexOf(m.tag)?2:1),m.soyState.pop(),"keyword"}if(g.match(/^([\w?]+)(?==)/)){if(m.context&&m.context.tag==t&&"kind"==g.current()&&(o=g.match(/^="([^"]+)/,!1))){var w=o[1];m.context.kind=w;var x=n[w]||n.html,y=e(m.localStates);y.mode.indent&&(m.indent+=y.mode.indent(y.state,"","")),m.localStates.push({mode:x,state:a.startState(x)})}return"attribute"}return l(g,m);case"template-call-expression":return g.match(/^([\w-?]+)(?==)/)?"attribute":g.eat(">")?(m.soyState.pop(),"keyword"):g.eat("/>")?(m.soyState.pop(),"keyword"):l(g,m);case"literal":return g.match("{/literal}",!1)?(m.soyState.pop(),this.token(g,m)):f(g,m,/\{\/literal}/)}if(g.match("{literal}"))return m.indent+=b.indentUnit,m.soyState.push("literal"),m.context=new k(m.context,"literal",m.variables),"keyword";if(o=g.match(/^\{([\/@\\]?\w+\??)(?=$|[\s}]|\/[\/*])/)){var z=m.tag;m.tag=o[1];var s="/"==m.tag[0],A=!!c[m.tag],t=s?m.tag.substring(1):m.tag,u=c[t];"/switch"!=m.tag&&(m.indent+=((s||u&&u.reduceIndent)&&"switch"!=z?1:2)*b.indentUnit),m.soyState.push("tag");var B=!1;if(u)if(s||u.soyState&&m.soyState.push(u.soyState),u.noEndTag||!A&&s){if(s)if(m.context&&m.context.tag==t){if(m.context){if(m.context.kind){m.localStates.pop();var y=e(m.localStates);y.mode.indent&&(m.indent-=y.mode.indent(y.state,"",""))}i(m)}}else B=!0}else m.context=new k(m.context,m.tag,u.variableScope?m.variables:null);else s&&(B=!0);return(B?"error ":"")+"keyword"}return g.eat("{")?(m.tag="print",m.indent+=2*b.indentUnit,m.soyState.push("tag"),"keyword"):!m.context&&g.match(/\bimport\b/)?(m.soyState.push("import"),m.indent+=2*b.indentUnit,"keyword"):(o=g.match("<{"))?(m.soyState.push("template-call-expression"),m.indent+=2*b.indentUnit,m.soyState.push("tag"),"keyword"):(o=g.match("</>"))?(m.indent-=1*b.indentUnit,"keyword"):f(g,m,/\{|\s+\/\/|\/\*/)},indent:function(c,d,f){var g=c.indent,h=e(c.soyState);if("comment"==h)return a.Pass;if("literal"==h)/^\{\/literal}/.test(d)&&(g-=b.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(d))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(d)&&(g-=b.indentUnit),"switch"!=c.tag&&/^\{(case|default)\b/.test(d)&&(g-=b.indentUnit),/^\{\/switch\b/.test(d)&&(g-=b.indentUnit)}var i=e(c.localStates);return g&&i.mode.indent&&(g+=i.mode.indent(i.state,d,f)),g},innerMode:function(a){return a.soyState.length&&"literal"!=e(a.soyState)?null:e(a.localStates)},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",useInnerComments:!1,fold:"indent"}}),"htmlmixed"),a.registerHelper("wordChars","soy",/[\w$]/),a.registerHelper("hintWords","soy",Object.keys(c).concat(["css","debugger"])),a.defineMIME("text/x-soy","soy")}));Private