Permalink
Browse files

Better default error messages.

  • Loading branch information...
1 parent ad28d56 commit e93945f2bb35ef6f849b4434ab3d4442b2794230 @beelsebob beelsebob committed Apr 28, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 CoreParse/Parsers/CPShiftReduceParser.m
View
3 CoreParse/Parsers/CPShiftReduceParser.m
@@ -219,7 +219,8 @@ - (CPRecoveryAction *)error:(CPTokenStream *)tokenStream expecting:(NSSet *)acce
}
else
{
- NSLog(@"Parse error on input %@", tokenStream);
+ CPToken *t = [tokenStream peekToken];
+ NSLog(@"%d:%d: parse error. Expected %@, found %@", [t lineNumber], [t columnNumber], acceptableTokens, t);
return nil;
}
}

0 comments on commit e93945f

Please sign in to comment.