function e(e){var t=e.statementIndentUnit,n=e.dontAlignCalls,r=e.noIndentKeywords||[],i=e.multiLineStrings,a=e.hooks||{};function o(e){for(var t={},n=e.split(` `),r=0;r=0)return o}var s=e.context,c=r&&r.charAt(0);s.type==`statement`&&c==`}`&&(s=s.prev);var l=!1,u=r.match(g);return u&&(l=j(u[0],s.type)),s.type==`statement`?s.indented+(c==`{`?0:t||i.unit):_.test(s.type)&&s.align&&!n?s.column+ +!l:s.type==`)`&&!l?s.indented+(t||i.unit):s.indented+(l?0:i.unit)},languageData:{indentOnInput:M(),commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}}}}}var t=e({}),n={"|":`link`,">":`property`,$:`variable`,$$:`variable`,"?$":`qualifier`,"?*":`qualifier`,"-":`contentSeparator`,"/":`property`,"/-":`property`,"@":`variableName.special`,"@-":`variableName.special`,"@++":`variableName.special`,"@+=":`variableName.special`,"@+=-":`variableName.special`,"@--":`variableName.special`,"@-=":`variableName.special`,"%+":`tag`,"%-":`tag`,"%":`tag`,">>":`tag`,"<<":`tag`,"<>":`tag`,"#":`tag`,"^":`attribute`,"^^":`attribute`,"^!":`attribute`,"*":`variable`,"**":`variable`,"\\":`keyword`,'"':`comment`},r={"/":`beh-hier`,">":`beh-hier`,"-":`phys-hier`,"|":`pipe`,"?":`when`,"@":`stage`,"\\":`keyword`},i=3,a=!1,o=/^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/,s=/^[! ] */,c=/^\/[\/\*]/;e({hooks:{electricInput:!1,token:function(e,t){var l=void 0,u;if(e.sol()&&!t.tlvInBlockComment){e.peek()==`\\`&&(l=`def`,e.skipToEnd(),e.string.match(/\\SV/)?t.tlvCodeActive=!1:e.string.match(/\\TLV/)&&(t.tlvCodeActive=!0)),t.tlvCodeActive&&e.pos==0&&t.indented==0&&(u=e.match(s,!1))&&(t.indented=u[0].length);var d=t.indented,f=d/i;if(f<=t.tlvIndentationStyle.length){var p=e.string.length==d,m=f*i;if(m0||(t.tlvIndentationStyle[f]=r[g],a&&(t.statementComment=!1),f++))}if(!p)for(;t.tlvIndentationStyle.length>f;)t.tlvIndentationStyle.pop()}t.tlvNextIndent=d}if(t.tlvCodeActive){var _=!1;a&&(_=e.peek()!=` `&&l===void 0&&!t.tlvInBlockComment&&e.column()==t.tlvIndentationStyle.length*i,_&&(t.statementComment&&(_=!1),t.statementComment=e.match(c,!1)));var u;if(l===void 0)if(t.tlvInBlockComment)e.match(/^.*?\*\//)?(t.tlvInBlockComment=!1,a&&!e.eol()&&(t.statementComment=!1)):e.skipToEnd(),l=`comment`;else if((u=e.match(c))&&!t.tlvInBlockComment)u[0]==`//`?e.skipToEnd():t.tlvInBlockComment=!0,l=`comment`;else if(u=e.match(o)){var v=u[1],y=u[2];n.hasOwnProperty(v)&&(y.length>0||e.eol())?l=n[v]:e.backUp(e.current().length-1)}else e.match(/^\t+/)?l=`invalid`:e.match(/^[\[\]{}\(\);\:]+/)?l=`meta`:(u=e.match(/^[mM]4([\+_])?[\w\d_]*/))?l=u[1]==`+`?`keyword.special`:`keyword`:e.match(/^ +/)?e.eol()&&(l=`error`):e.match(/^[\w\d_]+/)?l=`number`:e.next()}else e.match(/^[mM]4([\w\d_]*)/)&&(l=`keyword`);return l},indent:function(e){return e.tlvCodeActive==1?e.tlvNextIndent:-1},startState:function(e){e.tlvIndentationStyle=[],e.tlvCodeActive=!0,e.tlvNextIndent=-1,e.tlvInBlockComment=!1,a&&(e.statementComment=!1)}}});export{t as verilog};