Use isDebug

This commit is contained in:
Corey Johnson 2026-01-05 11:30:02 -08:00
parent b378756c5d
commit 04c2137fe2

View File

@ -1,4 +1,4 @@
const DEBUG = process.env.DEBUG || false import { isDebug } from '#utils/utils'
export type Token = { export type Token = {
type: TokenType type: TokenType
@ -169,11 +169,11 @@ export class Scanner {
from, from,
to, to,
}, },
valueTokens.has(type) ? { value: this.input.slice(from, to) } : {}, valueTokens.has(type) ? { value: this.input.slice(from, to) } : {}
), )
) )
if (DEBUG) { if (isDebug()) {
const tok = this.tokens.at(-1) const tok = this.tokens.at(-1)
console.log(`≫ PUSH(${from},${to})`, TokenType[tok?.type || 0], '—', tok?.value) console.log(`≫ PUSH(${from},${to})`, TokenType[tok?.type || 0], '—', tok?.value)
} }