summaryrefslogtreecommitdiff
path: root/MLKRoot.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-07-31 12:48:11 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-07-31 12:48:11 +0200
commit0fc2324c1cc28dd80b13d34a030576a20d887066 (patch)
tree35ac1730ce580b5d94b5ecbecec659c711715cbc /MLKRoot.m
parentc0f7fd07c3303f6928a42fe0ed41aefc8cf7fb2e (diff)
Reader: Support #\.
Diffstat (limited to 'MLKRoot.m')
-rw-r--r--MLKRoot.m20
1 files changed, 19 insertions, 1 deletions
diff --git a/MLKRoot.m b/MLKRoot.m
index 4b8356f..f155733 100644
--- a/MLKRoot.m
+++ b/MLKRoot.m
@@ -523,7 +523,25 @@ static id truify (BOOL value)
for (i = 2; i < [args count]; i++)
{
id argument = denullify ([args objectAtIndex:i]);
- [invocation setArgument:&argument atIndex:i];
+ const char *type = [signature getArgumentTypeAtIndex:i];
+
+ if (strcmp (type, @encode(unichar)) == 0)
+ {
+ unichar arg;
+ if ([argument isKindOfClass:[MLKCharacter class]])
+ arg = [argument unicharValue];
+ else if ([argument isKindOfClass:[MLKInteger class]])
+ arg = [argument intValue];
+ else
+ [NSException raise:@"MLKInvalidArgumentError"
+ format:@"Don't know how to coerce %@ into type \"%s\".",
+ argument, type];
+ [invocation setArgument:&arg atIndex:i];
+ }
+ else
+ {
+ [invocation setArgument:&argument atIndex:i];
+ }
}
[invocation invoke];