diff --git a/src/artigen/cmdTokenizer.ts b/src/artigen/cmdTokenizer.ts index 720d0f1..dcb1f88 100644 --- a/src/artigen/cmdTokenizer.ts +++ b/src/artigen/cmdTokenizer.ts @@ -2,9 +2,10 @@ import { log, LogTypes as LT } from '@Log4Deno'; import config from '~config'; -import { tokenizeMath } from 'artigen/mathTokenizer.ts'; import { CountDetails, ReturnData } from 'artigen/solver.d.ts'; +import { tokenizeMath } from 'artigen/math/mathTokenizer.ts'; + import { closeInternal, internalWrapRegex, openInternal } from 'artigen/utils/escape.ts'; import { loggingEnabled } from 'artigen/utils/logFlag.ts'; import { getMatchingInternalIdx, getMatchingPostfixIdx } from 'artigen/utils/parenBalance.ts'; diff --git a/src/artigen/executeRoll.ts b/src/artigen/dice/executeRoll.ts similarity index 100% rename from src/artigen/executeRoll.ts rename to src/artigen/dice/executeRoll.ts diff --git a/src/artigen/generateSolvedRoll.ts b/src/artigen/dice/generateSolvedRoll.ts similarity index 95% rename from src/artigen/generateSolvedRoll.ts rename to src/artigen/dice/generateSolvedRoll.ts index 793bb13..dce71d6 100644 --- a/src/artigen/generateSolvedRoll.ts +++ b/src/artigen/dice/generateSolvedRoll.ts @@ -1,12 +1,14 @@ import { log, LogTypes as LT } from '@Log4Deno'; -import { rollCounter } from './utils/counter.ts'; -import { RollModifiers } from 'src/mod.d.ts'; -import { executeRoll } from 'artigen/executeRoll.ts'; import { RollFormat } from 'artigen/solver.d.ts'; +import { executeRoll } from 'artigen/dice/executeRoll.ts'; + +import { rollCounter } from 'artigen/utils/counter.ts'; import { loggingEnabled } from 'artigen/utils/logFlag.ts'; +import { RollModifiers } from 'src/mod.d.ts'; + // generateSolvedRoll(rollConf, modifiers) returns one SolvedStep // generateSolvedRoll handles creating and formatting the completed rolls into the SolvedStep format export const generateSolvedRoll = (rollConf: string, modifiers: RollModifiers): RollFormat => { diff --git a/src/artigen/mathSolver.ts b/src/artigen/math/mathSolver.ts similarity index 100% rename from src/artigen/mathSolver.ts rename to src/artigen/math/mathSolver.ts diff --git a/src/artigen/mathTokenizer.ts b/src/artigen/math/mathTokenizer.ts similarity index 93% rename from src/artigen/mathTokenizer.ts rename to src/artigen/math/mathTokenizer.ts index 31fbad6..6e16925 100644 --- a/src/artigen/mathTokenizer.ts +++ b/src/artigen/math/mathTokenizer.ts @@ -1,9 +1,11 @@ import { log, LogTypes as LT } from '@Log4Deno'; -import { generateSolvedRoll } from 'artigen/generateSolvedRoll.ts'; -import { mathSolver } from 'artigen/mathSolver.ts'; import { CountDetails, MathConf, ReturnData, SolvedStep } from 'artigen/solver.d.ts'; +import { generateSolvedRoll } from 'artigen/dice/generateSolvedRoll.ts'; + +import { mathSolver } from 'artigen/math/mathSolver.ts'; + import { cmdSplitRegex, internalWrapRegex } from 'artigen/utils/escape.ts'; import { legalMathOperators } from 'artigen/utils/legalMath.ts'; import { loggingEnabled } from 'artigen/utils/logFlag.ts'; @@ -100,7 +102,7 @@ export const tokenizeMath = (cmd: string, modifiers: RollModifiers): [ReturnData containsCrit: false, containsFail: false, }, - ], + ] ); i += 2; } else if (!legalMathOperators.includes(strMathConfI) && legalMathOperators.some((mathOp) => strMathConfI.endsWith(mathOp))) { @@ -126,10 +128,10 @@ export const tokenizeMath = (cmd: string, modifiers: RollModifiers): [ReturnData } else { // Handle normally, just set current item to negative if (typeof mathConf[i] === 'number') { - mathConf[i] = mathConf[i] * -1; + mathConf[i] = mathConf[i] * -1; } else { - ( mathConf[i]).total = ( mathConf[i]).total * -1; - ( mathConf[i]).details = `-${( mathConf[i]).details}`; + (mathConf[i]).total = (mathConf[i]).total * -1; + (mathConf[i]).details = `-${(mathConf[i]).details}`; } mathConf.splice(i - 1, 1); i--;