baby's first lexer

This commit is contained in:
Dustin Swan 2026-01-30 23:02:46 -07:00
parent 920151f49c
commit f74d374555
No known key found for this signature in database
GPG key ID: 30D46587E2100467
4 changed files with 152 additions and 7 deletions

View file

@ -1,6 +1,7 @@
import { evaluate } from './interpreter'
import type { AST } from './ast'
import type { Env } from './env'
import { tokenize } from './lexer'
const ast: AST = {
kind: 'binaryop',
@ -72,3 +73,5 @@ const env2: Env = new Map();
const res2 = evaluate(ast2, env2);
console.log(res2);
console.log(tokenize("let x = 5"));