summaryrefslogtreecommitdiff
path: root/MLKReader.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-04 18:18:41 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-04 18:18:41 +0200
commit90e6023292e2bfe927bd633bac42fc355bb9f4d1 (patch)
tree14664b9e9d98f43c83b78547ea7c554fef8de9d1 /MLKReader.m
parent383e3e833a7fbb8b1560ba861b76e8be96542c6f (diff)
Add support for fixnums.
Diffstat (limited to 'MLKReader.m')
-rw-r--r--MLKReader.m34
1 files changed, 19 insertions, 15 deletions
diff --git a/MLKReader.m b/MLKReader.m
index 28ac141..86fc60c 100644
--- a/MLKReader.m
+++ b/MLKReader.m
@@ -29,6 +29,7 @@
#import "MLKInteger.h"
#import "MLKRatio.h"
#import "MLKStringInputStream.h"
+#import "functions.h"
#import "runtime-compatibility.h"
#import "util.h"
@@ -306,11 +307,12 @@ readingUninternedSymbol:(BOOL)readingUninternedSymbol
if (i == [token length])
{
//NSLog (@"...");
- return [MLKInteger integerWithString:
- [token substringWithRange:
- NSMakeRange (firstNum, [token length] - firstNum)]
- negative:negative
- base:10];
+ return MLKCanoniseInteger ([MLKInteger integerWithString:
+ [token substringWithRange:
+ NSMakeRange (firstNum,
+ [token length] - firstNum)]
+ negative:negative
+ base:10]);
}
firstSeparator = [token characterAtIndex:i];
@@ -325,11 +327,12 @@ readingUninternedSymbol:(BOOL)readingUninternedSymbol
if (i == [token length] && [readtable isDecimalPoint:firstSeparator])
{
//NSLog (@"+++");
- return [MLKInteger integerWithString:
- [token substringWithRange:
- NSMakeRange (firstNum, [token length] - firstNum - 1)]
- negative:negative
- base:10];
+ return MLKCanoniseInteger ([MLKInteger integerWithString:
+ [token substringWithRange:
+ NSMakeRange (firstNum,
+ [token length] - firstNum - 1)]
+ negative:negative
+ base:10]);
}
else
{
@@ -425,11 +428,12 @@ readingUninternedSymbol:(BOOL)readingUninternedSymbol
if (i == [token length])
{
//NSLog (@"###");
- return [MLKInteger integerWithString:
- [token substringWithRange:
- NSMakeRange (firstNum, [token length] - firstNum)]
- negative:negative
- base:base];
+ return MLKCanoniseInteger ([MLKInteger integerWithString:
+ [token substringWithRange:
+ NSMakeRange (firstNum,
+ [token length] - firstNum)]
+ negative:negative
+ base:base]);
}
// Assume token[i] is a slash.