summaryrefslogtreecommitdiff
path: root/MLKDynamicContext.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-07-31 11:48:46 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-07-31 11:48:46 +0200
commitca17649dab6d0d1ed49a3e072827e8324629aa64 (patch)
tree4b6cd04a660f44e11aa6089a02df7ab925c60eaf /MLKDynamicContext.m
parent0f383318a079bd0c7bb23c909f30771b1c20b29c (diff)
Reader: Add support for dispatching macro characters.
Diffstat (limited to 'MLKDynamicContext.m')
-rw-r--r--MLKDynamicContext.m12
1 files changed, 11 insertions, 1 deletions
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:'\\'];