Download src/compiler/variable-pool.js from soiz1/penguinmod-vm-prain: direct link, hf CLI and curl.
- Browser
- Download file 454 Bytes
-
https://huggingface.co/datasets/soiz1/penguinmod-vm-prain/resolve/main/src/compiler/variable-pool.js
- Command line
-
hf download hf://datasets/soiz1/penguinmod-vm-prain/src/compiler/variable-pool.js
-
curl -L -o variable-pool.js https://huggingface.co/datasets/soiz1/penguinmod-vm-prain/resolve/main/src/compiler/variable-pool.js
454 Bytes
| class VariablePool { | |
| /** | |
| * @param {string} prefix The prefix at the start of the variable name. | |
| */ | |
| constructor (prefix) { | |
| if (prefix.trim().length === 0) { | |
| throw new Error('prefix cannot be empty'); | |
| } | |
| this.prefix = prefix; | |
| /** | |
| * @private | |
| */ | |
| this.count = 0; | |
| } | |
| next () { | |
| return `${this.prefix}${this.count++}`; | |
| } | |
| } | |
| module.exports = VariablePool; | |