bellinitte / ruxnasm

Alternative Uxntal assembler focused on error reporting
MIT License
50 stars 5 forks source link

Error code > 0 expected when the assembler fails due to errors #1

Closed xaderfos closed 3 years ago

xaderfos commented 3 years ago

This happens for me on OSX 10.15.7 with ruxnasm built from the source code.

I can see the errors and there is no rom produced but the return code is 0. This is an issue when trying to use ruxnasm from within other processes.

Expected behaviour: 0 should only be returned if the assemble was successful, greater than 0 should be returned otherwise.

~/Documents/ruxnasm/target/release(main) » ./ruxnasm ~/life.tal /tmp/yolo.rom                                                                                                                                                                                                                                xyz@abc
error: macro `JSR345#%$#%@##%@$#%$#%#$%4` is not defined
   ┌─ /Users/xyz/life.tal:43:25
   │
43 │ ,fsdfdsaf ;fsdfdasfdsf  JSR345#%$#%@##%@$#%$#%#$%4
   │                         ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: macro `435` is not defined
   ┌─ /Users/xyz/life.tal:46:1
   │
46 │ 435
   │ ^^^

error: macro `345` is not defined
   ┌─ /Users/xyz/life.tal:47:1
   │
47 │ 345
   │ ^^^

error: macro `243543erf` is not defined
   ┌─ /Users/xyz/life.tal:49:1
   │
49 │ 243543erf DEO
   │ ^^^^^^^^^

error: found bytes on the zeroth page
   ┌─ /Users/xyz/life.tal:43:1
   │
43 │ ╭ ,fsdfdsaf ;fsdfdasfdsf  JSR345#%$#%@##%@$#%$#%#$%4
44 │ │ %#$543
45 │ │ 5345
46 │ │ 435
47 │ │ 345
48 │ │ 3245
49 │ │ 243543erf DEO
   │ ╰─────────────^

warning: macro `//` is never used
  ┌─ /Users/xyz/life.tal:9:40
  │
9 │ %++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
  │                                        ^^^

warning: macro `!!` is never used
   ┌─ /Users/xyz/life.tal:10:40
   │
10 │ %<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
   │                                        ^^^

warning: macro `#$543` is never used
   ┌─ /Users/xyz/life.tal:44:1
   │
44 │ %#$543
   │ ^^^^^^

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
~/Documents/ruxnasm/target/release(main) » echo $?                                                                                                                                                                                                                                                           xyz@abc
0
bellinitte commented 3 years ago

@xaderfos you're absolutely right. thank you for reporting this issue! i'll try to push the fix asap

xaderfos commented 3 years ago

That's great, I've been testing ruxnasm in my Emacs uxntal-mode and wanted to make sure it works as smooth as uxnasm.

bellinitte commented 3 years ago

@xaderfos alright, should be fixed in 519b8109d4a83cd86f34bb755cbc866f53303f77.

again, thank you so much for the issue. sorry you had to wait for so long, i didn't get a notification

xaderfos commented 3 years ago

No worries at all! I have not been slowed down by this in any way. I'll test it as soon as I can ;)

xaderfos commented 3 years ago

I can confirm that this is now fixed, thank you very much for this @karolbelina ;)