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