2 lines
2.7 KiB
JavaScript
2 lines
2.7 KiB
JavaScript
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[80795],{80795:function(S,k,h){"use strict";h.r(k),h.d(k,{shell:function(){return x}});var c={};function s(n,e){for(var i=0;i<e.length;i++)c[e[i]]=n}var p=["true","false"],a=["if","then","do","else","elif","while","until","for","in","esac","fi","fin","fil","done","exit","set","unset","export","function"],d=["ab","awk","bash","beep","cat","cc","cd","chown","chmod","chroot","clear","cp","curl","cut","diff","echo","find","gawk","gcc","get","git","grep","hg","kill","killall","ln","ls","make","mkdir","openssl","mv","nc","nl","node","npm","ping","ps","restart","rm","rmdir","sed","service","sh","shopt","shred","source","sort","sleep","ssh","start","stop","su","sudo","svn","tee","telnet","top","touch","vi","vim","wall","wc","wget","who","write","yes","zsh"];s("atom",p),s("keyword",a),s("builtin",d);function w(n,e){if(n.eatSpace())return null;var i=n.sol(),t=n.next();if(t==="\\")return n.next(),null;if(t==="'"||t==='"'||t==="`")return e.tokens.unshift(l(t,t==="`"?"quote":"string")),f(n,e);if(t==="#")return i&&n.eat("!")?(n.skipToEnd(),"meta"):(n.skipToEnd(),"comment");if(t==="$")return e.tokens.unshift(g),f(n,e);if(t==="+"||t==="=")return"operator";if(t==="-")return n.eat("-"),n.eatWhile(/\w/),"attribute";if(t=="<"){if(n.match("<<"))return"operator";var o=n.match(/^<-?\s*(?:['"]([^'"]*)['"]|([^'"\s]*))/);if(o)return e.tokens.unshift(b(o[1]||o[2])),"string.special"}if(/\d/.test(t)&&(n.eatWhile(/\d/),n.eol()||!/\w/.test(n.peek())))return"number";n.eatWhile(/[\w-]/);var r=n.current();return n.peek()==="="&&/\w+/.test(r)?"def":c.hasOwnProperty(r)?c[r]:null}function l(n,e){var i=n=="("?")":n=="{"?"}":n;return function(t,o){for(var r,u=!1;(r=t.next())!=null;){if(r===i&&!u){o.tokens.shift();break}else if(r==="$"&&!u&&n!=="'"&&t.peek()!=i){u=!0,t.backUp(1),o.tokens.unshift(g);break}else{if(!u&&n!==i&&r===n)return o.tokens.unshift(l(n,e)),f(t,o);if(!u&&/['"]/.test(r)&&!/['"]/.test(n)){o.tokens.unshift(v(r,"string")),t.backUp(1);break}}u=!u&&r==="\\"}return e}}function v(n,e){return function(i,t){return t.tokens[0]=l(n,e),i.next(),f(i,t)}}var g=function(n,e){e.tokens.length>1&&n.eat("$");var i=n.next();return/['"({]/.test(i)?(e.tokens[0]=l(i,i=="("?"quote":i=="{"?"def":"string"),f(n,e)):(/\d/.test(i)||n.eatWhile(/\w/),e.tokens.shift(),"def")};function b(n){return function(e,i){return e.sol()&&e.string==n&&i.tokens.shift(),e.skipToEnd(),"string.special"}}function f(n,e){return(e.tokens[0]||w)(n,e)}const x={name:"shell",startState:function(){return{tokens:[]}},token:function(n,e){return f(n,e)},languageData:{autocomplete:p.concat(a,d),closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}}}}]);
|