No more Refs, no more store, every top level def goes in the store, to update store values use :=
This commit is contained in:
parent
31ef279f16
commit
70569dfe48
9 changed files with 58 additions and 74 deletions
11
src/ast.ts
11
src/ast.ts
|
|
@ -2,7 +2,6 @@ import type { Value } from './types';
|
|||
|
||||
// Literals and Variables
|
||||
|
||||
|
||||
export type Literal = {
|
||||
kind: 'literal'
|
||||
value: Value
|
||||
|
|
@ -160,6 +159,15 @@ export type Import = {
|
|||
start: number
|
||||
}
|
||||
|
||||
export type Rebind = {
|
||||
kind: 'rebind'
|
||||
target: AST
|
||||
value: AST
|
||||
line: number
|
||||
column: number
|
||||
start: number
|
||||
}
|
||||
|
||||
export type AST =
|
||||
| Literal
|
||||
| Variable
|
||||
|
|
@ -176,6 +184,7 @@ export type AST =
|
|||
| Definition
|
||||
| TypeDef
|
||||
| Import
|
||||
| Rebind
|
||||
|
||||
export function prettyPrint(ast: AST, indent = 0): string {
|
||||
const i = ' '.repeat(indent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue