Skip to content

Commit

Permalink
Add warning when expression errors are detected.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damnae committed Feb 4, 2024
1 parent a03cff8 commit 77c807d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sources/gamecore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,12 @@ export function evaluateDynamicExpression(expression?:DynamicExpression, context
var result = stack.pop()
formula = result ?? 'empty'
if (stack.length > 0)
console.log('expression stack not empty: ' + stack.length)
{
formula = '⚠ ' + formula + ' ⚠'
console.log(formula
+ '\nexpression stack not empty: ' + stack.length + ' left'
+ '\n' + bytes.split ('').map(c => ('0' + c.charCodeAt(0).toString(16)).slice(-2)).join(' '))
}
break
default:
console.log('expression opcode not implemented: ' + opCode)
Expand Down

0 comments on commit 77c807d

Please sign in to comment.