@informalsystems/quint
Version:
Core tool for the Quint specification language
27 lines • 916 B
JavaScript
;
/* ----------------------------------------------------------------------------------
* Copyright 2023 Informal Systems
* Licensed under the Apache License, Version 2.0.
* See LICENSE in the project root for license information.
* --------------------------------------------------------------------------------- */
Object.defineProperty(exports, "__esModule", { value: true });
exports.FreshVarGenerator = void 0;
/**
* Generation of fresh variables with a given prefix.
*
* @author Gabriela Moreira
*
* @module
*/
class FreshVarGenerator {
constructor() {
this.freshVarCounters = new Map();
}
freshVar(prefix) {
const counter = this.freshVarCounters.get(prefix) ?? 0;
this.freshVarCounters.set(prefix, counter + 1);
return `${prefix}${counter}`;
}
}
exports.FreshVarGenerator = FreshVarGenerator;
//# sourceMappingURL=FreshVarGenerator.js.map