diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-31 12:48:11 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-31 12:48:11 +0200 |
commit | 0fc2324c1cc28dd80b13d34a030576a20d887066 (patch) | |
tree | 35ac1730ce580b5d94b5ecbecec659c711715cbc /MLKRoot.m | |
parent | c0f7fd07c3303f6928a42fe0ed41aefc8cf7fb2e (diff) |
Reader: Support #\.
Diffstat (limited to 'MLKRoot.m')
-rw-r--r-- | MLKRoot.m | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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]; |