openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

lua.min.js (3776B)


      1 (function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('lua',function(e,t){var f=e.indentUnit;function d(e){return new RegExp('^(?:'+e.join('|')+')','i')};function n(e){return new RegExp('^(?:'+e.join('|')+')$','i')};var o=n(t.specials||[]),u=n(['_G','_VERSION','assert','collectgarbage','dofile','error','getfenv','getmetatable','ipairs','load','loadfile','loadstring','module','next','pairs','pcall','print','rawequal','rawget','rawset','require','select','setfenv','setmetatable','tonumber','tostring','type','unpack','xpcall','coroutine.create','coroutine.resume','coroutine.running','coroutine.status','coroutine.wrap','coroutine.yield','debug.debug','debug.getfenv','debug.gethook','debug.getinfo','debug.getlocal','debug.getmetatable','debug.getregistry','debug.getupvalue','debug.setfenv','debug.sethook','debug.setlocal','debug.setmetatable','debug.setupvalue','debug.traceback','close','flush','lines','read','seek','setvbuf','write','io.close','io.flush','io.input','io.lines','io.open','io.output','io.popen','io.read','io.stderr','io.stdin','io.stdout','io.tmpfile','io.type','io.write','math.abs','math.acos','math.asin','math.atan','math.atan2','math.ceil','math.cos','math.cosh','math.deg','math.exp','math.floor','math.fmod','math.frexp','math.huge','math.ldexp','math.log','math.log10','math.max','math.min','math.modf','math.pi','math.pow','math.rad','math.random','math.randomseed','math.sin','math.sinh','math.sqrt','math.tan','math.tanh','os.clock','os.date','os.difftime','os.execute','os.exit','os.getenv','os.remove','os.rename','os.setlocale','os.time','os.tmpname','package.cpath','package.loaded','package.loaders','package.loadlib','package.path','package.preload','package.seeall','string.byte','string.char','string.dump','string.find','string.format','string.gmatch','string.gsub','string.len','string.lower','string.match','string.rep','string.reverse','string.sub','string.upper','table.concat','table.insert','table.maxn','table.remove','table.sort']),l=n(['and','break','elseif','false','nil','not','or','return','true','function','end','if','then','else','do','while','repeat','until','for','in','local']),s=n(['function','if','repeat','do','\\(','{']),c=n(['end','until','\\)','}']),m=d(['end','until','\\)','}','else','elseif']);function i(e){var t=0;while(e.eat('='))++t;e.eat('[');return t};function r(e,t){var n=e.next();if(n=='-'&&e.eat('-')){if(e.eat('[')&&e.eat('['))return(t.cur=a(i(e),'comment'))(e,t);e.skipToEnd();return'comment'};if(n=='"'||n=='\'')return(t.cur=g(n))(e,t);if(n=='['&&/[\[=]/.test(e.peek()))return(t.cur=a(i(e),'string'))(e,t);if(/\d/.test(n)){e.eatWhile(/[\w.%]/);return'number'};if(/[\w_]/.test(n)){e.eatWhile(/[\w\\\-_.]/);return'variable'};return null};function a(e,t){return function(n,i){var a=null,o;while((o=n.next())!=null){if(a==null){if(o==']')a=0}
      2 else if(o=='=')++a;else if(o==']'&&a==e){i.cur=r;break}
      3 else a=null};return t}};function g(e){return function(t,n){var i=!1,a;while((a=t.next())!=null){if(a==e&&!i)break;i=!i&&a=='\\'};if(!i)n.cur=r;return'string'}};return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:r}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();if(n=='variable'){if(l.test(r))n='keyword';else if(u.test(r))n='builtin';else if(o.test(r))n='variable-2'};if((n!='comment')&&(n!='string')){if(s.test(r))++t.indentDepth;else if(c.test(r))--t.indentDepth};return n},indent:function(e,t){var n=m.test(t);return e.basecol+f*(e.indentDepth-(n?1:0))},lineComment:'--',blockCommentStart:'--[[',blockCommentEnd:']]'}});e.defineMIME('text/x-lua','lua')});