polterguy / lizzie

A script language for .Net and the CLR
https://ainiro.io/
MIT License
190 stars 27 forks source link

Exceptions thrown in parsing numbers #23

Closed SapphireBrand closed 5 years ago

SapphireBrand commented 5 years ago

Compiler.CompileNumber uses double.Parse and long.Parse, which will thrown ArgumentNullException , FormatException, or OverflowException. (https://docs.microsoft.com/en-us/dotnet/api/system.double.parse?redirectedfrom=MSDN&view=netframework-4.7.2#System_Double_Parse_System_String_)

I think better is to TryParse(), and then thrown your own exception. This will allow programs that call Lizzie to trap execution issues better.

polterguy commented 5 years ago

Hmm, yet again the exception issue. This one is more easy to agree with by default I think ...

polterguy commented 5 years ago

Fixed (in repo)!