MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / component.min.js

File component.min.js

www/js/ext/component.min.js:None–None  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1(()=>{var x=class{#s;#i=[];#f=null;#a=[];source;constructor(t,e){this.#s=t,this.source=e,this.consumeWhitespace()}get list(){return this.#s}get consumed(){return this.#i}toString(){var t=this.currentToken(),e=this.source.split(`
2`),i=t?.line?t.line-1:e.length-1,n=t?.line?t.column:0,d=e[i]||"",I=Math.max(1,t?.value?.length||1),_=String(i+1).length,p="Tokens(";return p+=this.#i.filter(k=>k.type!=="WHITESPACE").length+" consumed, ",p+=this.#s.filter(k=>k.type!=="WHITESPACE").length+" remaining",p+=", line "+(i+1)+`)
3`,p+=" "+String(i+1).padStart(_)+" | "+d+`
4`,p+=" ".repeat(_+5)+" ".repeat(n)+"^".repeat(I),t&&(p+=" "+t.type+" '"+t.value+"'"),p}currentToken(){return this.token(0)}token(t,e){var i,n=0;do{if(!e)for(;this.#s[n]&&this.#s[n].type==="WHITESPACE";)n++;i=this.#s[n],t--,n++}while(t>-1);return i||{type:"EOF",value:"<<<EOF>>>"}}hasMore(){return this.#s.length>0}lastMatch(){return this.#f}matchToken(t,e){if(!this.#a.includes(t)&&(e=e||"IDENTIFIER",this.currentToken()&&this.currentToken().value===t&&this.currentToken().type===e))return this.consumeToken()}matchOpToken(t){if(this.currentToken()&&this.currentToken().op&&this.currentToken().value===t)return this.consumeToken()}matchTokenType(...t){if(this.currentToken()&&this.currentToken().type&&t.includes(this.currentToken().type))return this.consumeToken()}matchAnyToken(...t){for(var e=0;e<t.length;e++){var i=this.matchToken(t[e]);if(i)return i}}matchAnyOpToken(...t){for(var e=0;e<t.length;e++){var i=this.matchOpToken(t[e]);if(i)return i}}consumeToken(){var t=this.#s.shift();return this.#i.push(t),this.#f=t,this.consumeWhitespace(),t}consumeWhitespace(){for(;this.token(0,!0).type==="WHITESPACE";)this.#i.push(this.#s.shift())}consumeUntil(t,e){for(var i=[],n=this.token(0,!0);(e==null||n.type!==e)&&(t==null||n.value!==t)&&n.type!=="EOF";){var d=this.#s.shift();this.#i.push(d),i.push(n),n=this.token(0,!0)}return this.consumeWhitespace(),i}consumeUntilWhitespace(){return this.consumeUntil(null,"WHITESPACE")}peekToken(t,e,i){e=e||0,i=i||"IDENTIFIER";let n=0;for(;e>0;)n++,this.#s[n]?.type!=="WHITESPACE"&&e--;if(this.#s[n]&&this.#s[n].value===t&&this.#s[n].type===i)return this.#s[n]}lastWhitespace(){var t=this.#i.at(-1);return t&&t.type==="WHITESPACE"?t.value:""}pushFollow(t){this.#a.push(t)}popFollow(){this.#a.pop()}pushFollows(...t){for(var e=0;e<t.length;e++)this.#a.push(t[e]);return t.length}popFollows(t){for(var e=0;e<t;e++)this.#a.pop()}clearFollows(){var t=this.#a;return this.#a=[],t}restoreFollows(t){this.#a=t}},L={"+":"PLUS","-":"MINUS","*":"MULTIPLY","/":"DIVIDE",".":"PERIOD","..":"ELLIPSIS","\\":"BACKSLASH",":":"COLON","%":"PERCENT","|":"PIPE","!":"EXCLAMATION","?":"QUESTION","#":"POUND","&":"AMPERSAND",$:"DOLLAR",";":"SEMI",",":"COMMA","(":"L_PAREN",")":"R_PAREN","<":"L_ANG",">":"R_ANG","<=":"LTE_ANG",">=":"GTE_ANG","==":"EQ","===":"EQQ","!=":"NEQ","!==":"NEQQ","{":"L_BRACE","}":"R_BRACE","[":"L_BRACKET","]":"R_BRACKET","=":"EQUALS","~":"TILDE","^":"CARET"},w=class v{#s="";#i=0;#f=0;#a=1;#h="<START>";#p=0;#r=[];#m=!1;#c;#o(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}#u(t){return t>="0"&&t<="9"}#v(t){return t===" "||t===" "||t==="\r"||t===`

Callers

nothing calls this directly

Calls 1

useMethod · 0.45

Tested by

no test coverage detected