mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 00:45:04 +01:00
avoid wasm symbol conflicts
This commit is contained in:
parent
6bdbf14ecb
commit
e951cd5ee1
8 changed files with 188 additions and 99 deletions
|
|
@ -32,7 +32,7 @@ import { Ids } from "./utils";
|
|||
|
||||
type Parser<T> = (t: Token[]) => [Token[], T];
|
||||
|
||||
export function parse(t: Token[]): Ast {
|
||||
export function parse(packageName: string, t: Token[]): Ast {
|
||||
const items: Item[] = [];
|
||||
|
||||
while (t.length > 0) {
|
||||
|
|
@ -41,7 +41,7 @@ export function parse(t: Token[]): Ast {
|
|||
items.push(item);
|
||||
}
|
||||
|
||||
const ast = assignIds(items);
|
||||
const ast = buildAst(packageName, items);
|
||||
|
||||
validateAst(ast);
|
||||
|
||||
|
|
@ -711,13 +711,14 @@ function validateAst(ast: Ast) {
|
|||
foldAst(ast, validator);
|
||||
}
|
||||
|
||||
function assignIds(rootItems: Item[]): Ast {
|
||||
function buildAst(packageName: string, rootItems: Item[]): Ast {
|
||||
const itemId = new Ids();
|
||||
const loopId = new Ids();
|
||||
|
||||
const ast: Ast = {
|
||||
rootItems,
|
||||
itemsById: new Map(),
|
||||
packageName,
|
||||
};
|
||||
|
||||
const assigner: Folder = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue