baby's first lexer
This commit is contained in:
parent
920151f49c
commit
f74d374555
4 changed files with 152 additions and 7 deletions
|
|
@ -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"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue