summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-06-15 13:45:30 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-06-15 13:45:30 +0200
commit915e7a81737866a5bf8e9b39fea20716ad18bce7 (patch)
tree62717a52ea82cc248e0d6171fc9ce260d3dcc9d8
parenta3f2ee06ee4892f0a6b6d4595e3fdef43bbecdde (diff)
MLKReader: Properly handle single and double package markers.
-rw-r--r--MLKReader.m14
1 files 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 <Foundation/NSArray.h>
+#import <Foundation/NSSet.h>
#import <Foundation/NSString.h>
@@ -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)
{