Float support
This commit is contained in:
parent
9d2665e2e8
commit
41984b0083
1 changed files with 10 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue