Archived
1

Cleaned Code

This commit is contained in:
Kim Wittenburg
2014-10-21 15:06:57 +02:00
parent 5592128926
commit 91e7dbe9f2
20 changed files with 126 additions and 92 deletions

View File

@@ -46,11 +46,18 @@
- (BOOL)validate:(MPParseError *__autoreleasing *)error
{
if (_factors.count == 0) {
if (error) {
*error = MPParseError(_range, @"Expected Value");
}
return NO;
}
MPFactor *factor = _factors[0];
if (factor.hasMultiplicationSymbol) {
if (error) {
*error = MPParseError(factor.multiplicationSymbolRange, @"Unexpected Symbol.");
}
return NO;
}
if (![factor.value validate:error]) {
return NO;