Float support

This commit is contained in:
madmaurice 2021-04-05 03:50:33 +02:00
parent 9d2665e2e8
commit 41984b0083

View file

@ -80,8 +80,17 @@ sub tokenize {
elsif($str =~ s/^([^\s()"]+)//)
{
my $ident = $1;
if($ident =~ /^[0-9]+$/)
if($ident eq ".")
{
die "short cons not supported"
}
elsif($ident =~ /^-?([0-9]+|[0-9]*\.[0-9]*)$/)
{
if($ident =~ s/^-//)
{
$ident = 0 - $ident;
}
push @tokens, {
type => NUMBER,
value => 0+ $ident,