You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
3.4 KiB
1 line
3.4 KiB
"use strict";(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[3085],{63085:(C,p,s)=>{function f(e){for(var t={},n=e.split(","),r=0;r<n.length;++r){var i=n[r].toUpperCase(),l=n[r].charAt(0).toUpperCase()+n[r].slice(1);t[n[r]]=!0,t[i]=!0,t[l]=!0}return t}function d(e){return e.eatWhile(/[\w\$_]/),"meta"}s.r(p),s.d(p,{vhdl:()=>z});var o,b=f("null"),h={"`":d,$:d},w=f("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block,body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,end block,end case,end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for,function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage,literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map,postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal,sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor"),v=f("architecture,entity,begin,case,port,else,elsif,end,for,function,if"),g=/[&|~><!\)\(*#%@+\/=?\:;}{,\.\^\-\[\]]/;function a(e,t){var n=e.next();if(h[n]){var r=h[n](e,t);if(!1!==r)return r}if('"'==n)return t.tokenize=function x(e){return function(t,n){for(var i,r=!1,l=!1;null!=(i=t.next());){if(i==e&&!r){l=!0;break}r=!r&&"--"==i}return(l||!r)&&(n.tokenize=a),"string.special"}}(n),t.tokenize(e,t);if("'"==n)return t.tokenize=function m(e){return function(t,n){for(var i,r=!1,l=!1;null!=(i=t.next());){if(i==e&&!r){l=!0;break}r=!r&&"--"==i}return(l||!r)&&(n.tokenize=a),"string"}}(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return o=n,null;if(/[\d']/.test(n))return e.eatWhile(/[\w\.']/),"number";if("-"==n&&e.eat("-"))return e.skipToEnd(),"comment";if(g.test(n))return e.eatWhile(g),"operator";e.eatWhile(/[\w\$_]/);var i=e.current();return w.propertyIsEnumerable(i.toLowerCase())?(v.propertyIsEnumerable(i)&&(o="newstatement"),"keyword"):b.propertyIsEnumerable(i)?"atom":"variable"}function y(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function c(e,t,n){return e.context=new y(e.indented,t,n,null,e.context)}function u(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}const z={name:"vhdl",startState:function(e){return{tokenize:null,context:new y(-e,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;o=null;var r=(t.tokenize||a)(e,t);if("comment"==r||"meta"==r)return r;if(null==n.align&&(n.align=!0),";"!=o&&":"!=o||"statement"!=n.type)if("{"==o)c(t,e.column(),"}");else if("["==o)c(t,e.column(),"]");else if("("==o)c(t,e.column(),")");else if("}"==o){for(;"statement"==n.type;)n=u(t);for("}"==n.type&&(n=u(t));"statement"==n.type;)n=u(t)}else o==n.type?u(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==o)&&c(t,e.column(),"statement");else u(t);return t.startOfLine=!1,r},indent:function(e,t,n){if(e.tokenize!=a&&null!=e.tokenize)return 0;var r=t&&t.charAt(0),i=e.context,l=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:n.unit):i.align?i.column+(l?0:1):i.indented+(l?0:n.unit)},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:"--"}}}}}]); |