From ca17649dab6d0d1ed49a3e072827e8324629aa64 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 31 Jul 2008 11:48:46 +0200 Subject: Reader: Add support for dispatching macro characters. --- MLKDynamicContext.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'MLKDynamicContext.m') diff --git a/MLKDynamicContext.m b/MLKDynamicContext.m index 1b8725b..bf70929 100644 --- a/MLKDynamicContext.m +++ b/MLKDynamicContext.m @@ -27,6 +27,7 @@ #import "MLKBackquoteReader.h" #import "MLKCommaReader.h" #import "MLKCons.h" +#import "MLKDispatchingMacroCharacterReader.h" #import "MLKDynamicContext.h" #import "MLKEnvironment.h" #import "MLKLinkedList.h" @@ -36,6 +37,7 @@ #import "MLKReadtable.h" #import "MLKStringReader.h" #import "MLKSemicolonReader.h" +#import "MLKSharpsignColonReader.h" #import "MLKSymbol.h" #import "MLKInteger.h" #import "runtime-compatibility.h" @@ -61,6 +63,7 @@ static MLKDynamicContext *global_context; MLKPackage *keyword = [MLKPackage findPackage:@"KEYWORD"]; MLKSymbol *t = [cl intern:@"T"]; MLKReadtable *readtable = [[MLKReadtable alloc] init]; + MLKDispatchingMacroCharacterReader *sharpsign; unichar ch; id NIL = [NSNull null]; @@ -148,7 +151,14 @@ static MLKDynamicContext *global_context; [readtable setSyntaxType:MULTI_ESCAPE forCharacter:'|']; - // [readtable setSyntaxType:NONTERMINATING_MACRO forCharacter:'#']; + [readtable setSyntaxType:NONTERMINATING_MACRO forCharacter:'#']; + sharpsign = AUTORELEASE ([[MLKDispatchingMacroCharacterReader + alloc] init]); + [readtable setMacroFunction:sharpsign forCharacter:'#']; + + [sharpsign setMacroFunction:AUTORELEASE([[MLKSharpsignColonReader alloc] + init]) + forCharacter:':']; [readtable setSyntaxType:SINGLE_ESCAPE forCharacter:'\\']; -- cgit v1.2.3