no longer random identifiers for matches

master
Dustin Swan 2 weeks ago
parent dd6dad76c8
commit 62f6e202b0
Signed by: dustinswan
GPG Key ID: 30D46587E2100467

@ -1,6 +1,8 @@
import type { AST, Pattern, Definition } from './ast';
import { _rt, store } from './runtime-js';
let matchCounter = 0;
export const definitions: Map<string, AST> = new Map();
export const dependencies: Map<string, Set<string>> = new Map();
export const dependents: Map<string, Set<string>> = new Map();
@ -135,7 +137,7 @@ function sanitizeName(name: string): string {
function compileMatch(ast: AST & { kind: 'match'}, useStore = true, bound = new Set<string>()): string {
const expr = compile(ast.expr, useStore, bound);
const tmpVar = `_m${Math.floor(Math.random() * 10000)}`;
const tmpVar = `_m${matchCounter++}`;
let code = `((${tmpVar}) => { `;

Loading…
Cancel
Save