?
Path : /home/admin/public_html/old/media/editors/codemirror/mode/z80/ |
Current File : /home/admin/public_html/old/media/editors/codemirror/mode/z80/z80.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";a.defineMode("z80",function(a,b){var c,d,e=b.ez80;e?(c=/^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i,d=/^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i):(c=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i,d=/^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i);var f=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,g=/^(n?[zc]|p[oe]?|m)\b/i,h=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,i=/^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i;return{startState:function(){return{context:0}},token:function(a,b){if(a.column()||(b.context=0),a.eatSpace())return null;var j;if(a.eatWhile(/\w/)){if(e&&a.eat(".")&&a.eatWhile(/\w/),j=a.current(),!a.indentation())return a.match(i)?"number":null;if((1==b.context||4==b.context)&&f.test(j))return b.context=4,"var2";if(2==b.context&&g.test(j))return b.context=4,"var3";if(c.test(j))return b.context=1,"keyword";if(d.test(j))return b.context=2,"keyword";if(4==b.context&&i.test(j))return"number";if(h.test(j))return"error"}else{if(a.eat(";"))return a.skipToEnd(),"comment";if(a.eat('"')){for(;(j=a.next())&&'"'!=j;)"\\"==j&&a.next();return"string"}if(a.eat("'")){if(a.match(/\\?.'/))return"number"}else if(a.eat(".")||a.sol()&&a.eat("#")){if(b.context=5,a.eatWhile(/\w/))return"def"}else if(a.eat("$")){if(a.eatWhile(/[\da-f]/i))return"number"}else if(a.eat("%")){if(a.eatWhile(/[01]/))return"number"}else a.next()}return null}}}),a.defineMIME("text/x-z80","z80"),a.defineMIME("text/x-ez80",{name:"z80",ez80:!0})});