2 lines
3.0 KiB
JavaScript
2 lines
3.0 KiB
JavaScript
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[97080],{97080:function(A,c,a){"use strict";a.r(c),a.d(c,{oz:function(){return C}});function o(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var p=/[\^@!\|<>#~\.\*\-\+\\/,=]/,z=/(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/,g=/(:::)|(\.\.\.)|(=<:)|(>=:)/,f=["in","then","else","of","elseof","elsecase","elseif","catch","finally","with","require","prepare","import","export","define","do"],l=["end"],m=o(["true","false","nil","unit"]),v=o(["andthen","at","attr","declare","feat","from","lex","mod","div","mode","orelse","parser","prod","prop","scanner","self","syn","token"]),w=o(["local","proc","fun","case","class","if","cond","or","dis","choice","not","thread","try","raise","lock","for","suchthat","meth","functor"]),d=o(f),h=o(l);function i(e,n){if(e.eatSpace())return null;if(e.match(/[{}]/))return"bracket";if(e.match("[]"))return"keyword";if(e.match(g)||e.match(z))return"operator";if(e.match(m))return"atom";var t=e.match(w);if(t)return n.doInCurrentLine?n.doInCurrentLine=!1:n.currentIndent++,t[0]=="proc"||t[0]=="fun"?n.tokenize=x:t[0]=="class"?n.tokenize=b:t[0]=="meth"&&(n.tokenize=y),"keyword";if(e.match(d)||e.match(v))return"keyword";if(e.match(h))return n.currentIndent--,"keyword";var r=e.next();if(r=='"'||r=="'")return n.tokenize=I(r),n.tokenize(e,n);if(/[~\d]/.test(r)){if(r=="~")if(/^[0-9]/.test(e.peek())){if(e.next()=="0"&&e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))return"number"}else return null;return r=="0"&&e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)?"number":null}return r=="%"?(e.skipToEnd(),"comment"):r=="/"&&e.eat("*")?(n.tokenize=s,s(e,n)):p.test(r)?"operator":(e.eatWhile(/\w/),"variable")}function b(e,n){return e.eatSpace()?null:(e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/),n.tokenize=i,"type")}function y(e,n){return e.eatSpace()?null:(e.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/),n.tokenize=i,"def")}function x(e,n){return e.eatSpace()?null:!n.hasPassedFirstStage&&e.eat("{")?(n.hasPassedFirstStage=!0,"bracket"):n.hasPassedFirstStage?(e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/),n.hasPassedFirstStage=!1,n.tokenize=i,"def"):(n.tokenize=i,null)}function s(e,n){for(var t=!1,r;r=e.next();){if(r=="/"&&t){n.tokenize=i;break}t=r=="*"}return"comment"}function I(e){return function(n,t){for(var r=!1,u,k=!1;(u=n.next())!=null;){if(u==e&&!r){k=!0;break}r=!r&&u=="\\"}return(k||!r)&&(t.tokenize=i),"string"}}function S(){var e=f.concat(l);return new RegExp("[\\[\\]]|("+e.join("|")+")$")}const C={name:"oz",startState:function(){return{tokenize:i,currentIndent:0,doInCurrentLine:!1,hasPassedFirstStage:!1}},token:function(e,n){return e.sol()&&(n.doInCurrentLine=0),n.tokenize(e,n)},indent:function(e,n,t){var r=n.replace(/^\s+|\s+$/g,"");return r.match(h)||r.match(d)||r.match(/(\[])/)?t.unit*(e.currentIndent-1):e.currentIndent<0?0:e.currentIndent*t.unit},languageData:{indentOnInut:S(),commentTokens:{line:"%",block:{open:"/*",close:"*/"}}}}}}]);
|