JoeStrout / miniscript

source code of both C# and C++ implementations of the MiniScript scripting language
MIT License
275 stars 64 forks source link

[C++] Redundant decimal point won't cause error #177

Open Withered-Flower-0422 opened 1 month ago

Withered-Flower-0422 commented 1 month ago

MM:

]1.1.1
Compiler Error: invalid numeric literal: 1.1.1 [line 1]
]

CMD:

> 1.1.1
1.1
>
MineRobber9000 commented 1 month ago

As discussed in #125, this is because C++ MiniScript uses sscanf with a format string of %1f, which, in addition to parsing 1foo2 as 1, or 1.1.1 as 1.1, inexplicably parses 0xdeadbeef as 3735928559.