mikaelpatel / Arduino-Shell

RPN Postscript/Forth Command Shell for Arduino
19 stars 5 forks source link

Enhance: HEX number literals #17

Closed dpharris closed 8 years ago

dpharris commented 8 years ago

How can hex be entered? Suggestion might use X: X5ef,Xa5+.

(Would have preferred x, and X for execute.)

mikaelpatel commented 8 years ago

Right now it is only decimal format but I planned to add the traditional C-style with 0x and 0b. This increases the foot-print but will be needed. Also I would like the cell width to be configurable (int as now or long).

mikaelpatel commented 8 years ago

Please see commit https://github.com/mikaelpatel/Arduino-Shell/commit/8ba71a0e052fce20e2940eb910345b819f2ee919.

dpharris commented 8 years ago

Yes, just saw it in the code!

mikaelpatel commented 8 years ago

The current implementation has a few short-cuts. It is possible to give 0b12345, i.e. binary base does not check the character set. I will get back to this later on.

mikaelpatel commented 8 years ago

Hexadecimal should be working fine so I will close this issue.

mikaelpatel commented 8 years ago

Commit https://github.com/mikaelpatel/Arduino-Shell/commit/2f19d35a2caea6c5ac62a84b2b476b8c7f4f3b9d fixes the issue with accepting illegal digits in binary base.