Closed mungre closed 1 year ago
FWIW I've had a quick look over this and it seems reasonable. My comments in the other thread that I didn't think #36 was a blocker were based on not having a fix; I think it's good if we can fix this, as it's been an ongoing source of occasional problems. The fact we have a test suite now makes me pretty happy this isn't going to break stuff, and I imagine a 1.10 release candidate announced on stardot will also get a fair amount of additional testing too.
It would be good to document the new underscore feature and the more reliable parsing in the README, of course.
Cheers. Yes, I wouldn't have been confident doing this without the tests. I've updated the README and also changed the parsing of exponents for consistency with BBC BASIC. Previously, the 2
in 2EOR3
was parsed as an unfinished exponent 2E
giving an error but now it's just a 2
. The parser won't commit to an exponent unless there's a sign or digit.
Thanks for fixing the bug and making the underscore Improvement. LGTM.
Cheers, I've merged both of my PRs now.
36 is a reminder that the syntax for numeric literals accepted by beebasm depended on the C++ standard library of the compiler used to build it. This pr parses parses all numeric types so that the supported syntax is explicit and platform-independent. It also allows underscores to be used as digit separators in all numeric types, e.g. &1_0000 or 0.000_000_1.
Sorry for the late submission, but #36 has always niggled.