From 915e7a81737866a5bf8e9b39fea20716ad18bce7 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 15 Jun 2008 13:45:30 +0200 Subject: MLKReader: Properly handle single and double package markers. --- MLKReader.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/MLKReader.m b/MLKReader.m index 1002ca3..9a9b956 100644 --- a/MLKReader.m +++ b/MLKReader.m @@ -28,6 +28,7 @@ #import "MLKStream.h" #import +#import #import @@ -243,10 +244,19 @@ { package = [MLKPackage findPackage:[token substringToIndex:packageMarker]]; - symbolName = [token substringFromIndex:(packageMarker+1)]; + if ([readtable isPackageMarker:[token characterAtIndex:(i+1)]]) + symbolName = [token substringFromIndex:(packageMarker+2)]; + else + { + // A single package marker means we have to check whether + // the symbol is external in the package. + symbolName = [token substringFromIndex:(packageMarker+1)]; + if (![[package exportedSymbols] containsObject:[package intern:token]]) + [[[MLKReaderError alloc] init] raise]; + } } - symbol = [package intern:token]; + symbol = [package intern:symbolName]; if (packageMarker == 0) { -- cgit v1.2.3