diff options
Diffstat (limited to 'MLKReader.m')
-rw-r--r-- | MLKReader.m | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/MLKReader.m b/MLKReader.m index 7db9670..a6f11c1 100644 --- a/MLKReader.m +++ b/MLKReader.m @@ -50,15 +50,17 @@ eofValue:eofValue recursive:recursive preserveWhitespace:preserveWhitespace - singleDotMarker:nil]; + singleDotMarker:nil + readingUninternedSymbol:NO]; } -+(id) readFromStream:(MLKStream *)stream - eofError:(BOOL)eofError - eofValue:(id)eofValue - recursive:(BOOL)recursive - preserveWhitespace:(BOOL)preserveWhitespace - singleDotMarker:(id)dotMarker ++(id) readFromStream:(MLKStream *)stream + eofError:(BOOL)eofError + eofValue:(id)eofValue + recursive:(BOOL)recursive + preserveWhitespace:(BOOL)preserveWhitespace + singleDotMarker:(id)dotMarker +readingUninternedSymbol:(BOOL)readingUninternedSymbol { unichar ch; NSMutableString *token; @@ -72,6 +74,13 @@ valueForSymbol:[[MLKPackage findPackage:@"COMMON-LISP"] intern:@"*READTABLE*"]]; + if (readingUninternedSymbol) + { + token = [NSMutableString stringWithString:@"#:"]; + escaped = NO; + goto read_token; + } + start: if ([stream isEOF]) { @@ -89,7 +98,7 @@ if ([readtable isMacroCharacter:ch]) { NSArray *returnValues; - MLKFuncallable *macrofun = [readtable macroFunctionForCharacter:ch]; + id <MLKFuncallable> macrofun = [readtable macroFunctionForCharacter:ch]; NSArray *args = [NSArray arrayWithObjects: stream, [MLKCharacter characterWithUnichar:ch], @@ -135,6 +144,7 @@ [token appendFormat:@"%C", [readtable charWithReadtableCase:ch]]; } + read_token: while (![stream isEOF]) { //NSLog (@"..."); @@ -260,7 +270,7 @@ escaped:(BOOL)escaped { int base; - + base = [[[MLKDynamicContext currentContext] valueForSymbol:[[MLKPackage findPackage:@"COMMON-LISP"] intern:@"*READ-BASE*"]] |