simon987 / Much-Assembly-Required

Assembly programming game
https://muchassemblyrequired.com
GNU General Public License v3.0
926 stars 88 forks source link

Support for octal literal integers #166

Closed kevinramharak closed 4 years ago

kevinramharak commented 6 years ago

Would be nice to have notation like:

octal: 0o777
;; some languages also allow a prefixed 0
octal: 0777
;; tough the capital O is just ugly
octal: 0O777
;; and unreadable

This depends on what is preferred notation

Francessco121 commented 6 years ago

Looks like the game actually supports this already in the format of 0777 (from your example). The game parses integers with Integer.decode (here's the MAR source). Because of this method, the game inherits some other funky ways of writing integers (like # before a hexadecimal number, which assembles even though the game's editor shows an error).

That said, I would definitely prefer using the 0o prefix if the game supports it.

kevinramharak commented 6 years ago

I havent looked at this project for a while, but that is good to know. The editor is quite simple in its parsing. There also isnt a real grammar defined yet, once that is defined the frontend and backend could be modeled after it.