diff --git a/src/app.ts b/src/app.ts index 040a281..f35c761 100644 --- a/src/app.ts +++ b/src/app.ts @@ -138,7 +138,7 @@ function prase(expression: string, i: number, terminators: string[], args: strin escaped = true; break; - case "[": // RNG vyber + case "[": { // RNG vyber let option: string, term: string | undefined; const options: string[] = []; @@ -151,8 +151,9 @@ function prase(expression: string, i: number, terminators: string[], args: strin ret += options[rand(options.length)]; break; + } - case "<": // RNG cislo + case "<": { // RNG cislo let min: string, max: string; [min, i] = prase(expression, i, [","], args); [max, i] = prase(expression, i, [">"], args); @@ -166,8 +167,9 @@ function prase(expression: string, i: number, terminators: string[], args: strin ret += rand(imax - imin + 1) + imin; break; + } - case "{": // ARG + case "{": {// ARG let argId: string; [argId, i] = prase(expression, i, ["}"], args); @@ -182,6 +184,7 @@ function prase(expression: string, i: number, terminators: string[], args: strin } break; + } default: for (const terminator of terminators) {