[Bps-public-commit] lcore branch, master, updated. 768f225ec43d3651fe2e58a9e883d1b9540403c7
clkao at bestpractical.com
clkao at bestpractical.com
Tue Oct 20 09:26:57 EDT 2009
The branch, master has been updated
via 768f225ec43d3651fe2e58a9e883d1b9540403c7 (commit)
from 04f4dc828157d1cd66763035702fadd364df0fab (commit)
Summary of changes:
lib/LCore/TypedExpression.pm | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 768f225ec43d3651fe2e58a9e883d1b9540403c7
Author: Chia-liang Kao <clkao at bestpractical.com>
Date: Tue Oct 20 21:08:13 2009 +0800
distinguish Int and Num
diff --git a/lib/LCore/TypedExpression.pm b/lib/LCore/TypedExpression.pm
index d274084..dba677f 100644
--- a/lib/LCore/TypedExpression.pm
+++ b/lib/LCore/TypedExpression.pm
@@ -33,7 +33,10 @@ sub get_return_type {
return 'Function';
}
elsif ($self->isa('LCore::Expression::SelfEvaluating')) {
- return looks_like_number $self->value ? 'Num' : 'Str';
+ return looks_like_number $self->value
+ ? m/\D/ ? 'Num'
+ : 'Int'
+ : 'Str';
}
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list