diff options
author | dan <[email protected]> | 2023-05-26 20:21:43 -0400 |
---|---|---|
committer | dan <[email protected]> | 2023-05-26 20:21:43 -0400 |
commit | 71a1f237dd678adfc0355e9c7546315280de2f17 (patch) | |
tree | dc2f7f2ce654986c46330790013cc547a8fc20f3 /forth.js | |
parent | 1d059ec9193202a7508134c1ec65364286f945ac (diff) | |
download | forth-71a1f237dd678adfc0355e9c7546315280de2f17.tar.gz forth-71a1f237dd678adfc0355e9c7546315280de2f17.tar.bz2 forth-71a1f237dd678adfc0355e9c7546315280de2f17.zip |
fix: js forth if statement so that string "0" is false
Diffstat (limited to 'forth.js')
-rw-r--r-- | forth.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -42,7 +42,7 @@ function forth(print = console.log) { }, 'then' : () => {/*Doing nothing skips the token*/}, 'if' : (initialIdx, tokens) => { - if (!s.pop()) { + if (!popNum()) { let localIdx = initialIdx; while (tokens[localIdx] && tokens[localIdx] !== 'then') {localIdx++} return localIdx - initialIdx; |