no longer random identifiers for matches
This commit is contained in:
parent
dd6dad76c8
commit
62f6e202b0
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue