2 lines
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[78805],{78805:function(y,u,f){"use strict";f.r(u),f.d(u,{turtle:function(){return h}});var o;function p(e){return new RegExp("^(?:"+e.join("|")+")$","i")}var v=p([]),x=p(["@prefix","@base","a"]),a=/[*+\-<>=&|]/;function d(e,n){var t=e.next();if(o=null,t=="<"&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if(t=='"'||t=="'")return n.tokenize=g(t),n.tokenize(e,n);if(/[{}\(\),\.;\[\]]/.test(t))return o=t,null;if(t=="#")return e.skipToEnd(),"comment";if(a.test(t))return e.eatWhile(a),null;if(t==":")return"operator";if(e.eatWhile(/[_\w\d]/),e.peek()==":")return"variableName.special";var r=e.current();return x.test(r)?"meta":t>="A"&&t<="Z"?"comment":"keyword";var r=e.current();return v.test(r)?null:x.test(r)?"meta":"variable"}function g(e){return function(n,t){for(var r=!1,i;(i=n.next())!=null;){if(i==e&&!r){t.tokenize=d;break}r=!r&&i=="\\"}return"string"}}function l(e,n,t){e.context={prev:e.context,indent:e.indent,col:t,type:n}}function c(e){e.indent=e.context.indent,e.context=e.context.prev}const h={name:"turtle",startState:function(){return{tokenize:d,context:null,indent:0,col:0}},token:function(e,n){if(e.sol()&&(n.context&&n.context.align==null&&(n.context.align=!1),n.indent=e.indentation()),e.eatSpace())return null;var t=n.tokenize(e,n);if(t!="comment"&&n.context&&n.context.align==null&&n.context.type!="pattern"&&(n.context.align=!0),o=="(")l(n,")",e.column());else if(o=="[")l(n,"]",e.column());else if(o=="{")l(n,"}",e.column());else if(/[\]\}\)]/.test(o)){for(;n.context&&n.context.type=="pattern";)c(n);n.context&&o==n.context.type&&c(n)}else o=="."&&n.context&&n.context.type=="pattern"?c(n):/atom|string|variable/.test(t)&&n.context&&(/[\}\]]/.test(n.context.type)?l(n,"pattern",e.column()):n.context.type=="pattern"&&!n.context.align&&(n.context.align=!0,n.context.col=e.column()));return t},indent:function(e,n,t){var r=n&&n.charAt(0),i=e.context;if(/[\]\}]/.test(r))for(;i&&i.type=="pattern";)i=i.prev;var k=i&&r==i.type;return i?i.type=="pattern"?i.col:i.align?i.col+(k?0:1):i.indent+(k?0:t.unit):0},languageData:{commentTokens:{line:"#"}}}}}]);
|