From 194806b17d3309202ddaf7a981ec02581984f033 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sat, 23 Mar 2013 15:49:16 +0000 Subject: Bring back parser/lexer error reporting Even better than before! --- tikzit/src/osx/TikzSourceController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tikzit/src/osx/TikzSourceController.m') diff --git a/tikzit/src/osx/TikzSourceController.m b/tikzit/src/osx/TikzSourceController.m index d01589b..0cb3703 100644 --- a/tikzit/src/osx/TikzSourceController.m +++ b/tikzit/src/osx/TikzSourceController.m @@ -183,8 +183,8 @@ NSDictionary *d = [lastError userInfo]; - NSString *ts = [NSString stringWithFormat: @"Parse error on line %@: %@\n", [d valueForKey:@"lineNumber"], [d valueForKey:NSLocalizedDescriptionKey]]; - NSMutableAttributedString *as = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat: @"Parse error on line %@: %@\n%@\n", [d valueForKey:@"lineNumber"], [d valueForKey:NSLocalizedDescriptionKey], [[d valueForKey:@"syntaxString"] stringByReplacingOccurrencesOfString:@"\t" withString:@""]]]; + NSString *ts = [NSString stringWithFormat: @"Parse error on line %@: %@\n", [d valueForKey:@"startLine"], [d valueForKey:NSLocalizedDescriptionKey]]; + NSMutableAttributedString *as = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat: @"Parse error on line %@: %@\n%@\n", [d valueForKey:@"startLine"], [d valueForKey:NSLocalizedDescriptionKey], [[d valueForKey:@"syntaxString"] stringByReplacingOccurrencesOfString:@"\t" withString:@""]]]; NSInteger tokenLength = [[d valueForKey:@"tokenLength"] integerValue]; // Bit of a mess, offset around to find correct position and correct for 4 characters for every one character of \t -- cgit v1.2.3