a post-component library for building user-interfaces on the web.
at main 22 lines 575 B view raw
1globalThis.__DEV__ = true 2const lexer = await import('../src/shared/lexer.ts') 3 4const names = Object.fromEntries( 5 Object.entries(lexer) 6 .filter(([name, value]) => typeof value === 'number') 7 .map(([name, value]) => [value, name]), 8) 9 10function tsa(...strings: string[]): TemplateStringsArray { 11 return Object.assign(strings, { raw: strings }) 12} 13 14for (const entry of process.argv.slice(2)) { 15 const statics = entry.split('$') 16 console.log(statics) 17 for (const [char, state] of lexer.lex(tsa(...statics))) { 18 console.log(JSON.stringify(char), names[state]) 19 } 20} 21 22export {}