Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported operator ! does not report line number #87

Open
micheldebree opened this issue Jan 13, 2023 · 0 comments
Open

Unsupported operator ! does not report line number #87

micheldebree opened this issue Jan 13, 2023 · 0 comments

Comments

@micheldebree
Copy link

I try to use a "fake" boolean variable, and apply the ! (not) operator. This is not supported. The following gives a message that is quite clear, but doesn't report the line number. It is hard to find the error without the line number.

I would expect the line number to be reported so I can find the error.

Nice to have would be to support the ! operator, or support real booleans

!let debugging = 1

!if (!debugging) {
  lda #0
}

Gives

|| /Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/asm.js:1399
||                 throw err;
||                 ^
|| 
|| Error: Unhandled unary operator !
||     at Assembler.evalExpr (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/asm.js:639:31)
||     at Assembler.checkDirectives (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/asm.js:1083:44)
||     at Assembler.assembleLine (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/asm.js:1318:18)
||     at assemble (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/asm.js:1259:22)
||     at Assembler.assembleLines (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/asm.js:1283:16)
||     at Assembler.assemble (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/asm.js:1388:22)
||     at Object.assemble (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/asm.js:1474:13)
||     at compile (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/cli.js:60:26)
||     at Object.<anonymous> (/Users/michel/Commodore64/Dev/xmastree/node_modules/c64jasm/dist/src/cli.js:187:12)
||     at Module._compile (node:internal/modules/cjs/loader:1165:14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant