From 3c4fb8abe4e28091cb857705af2d762cd00b985a Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Sun, 18 Jul 2010 00:59:02 +0000 Subject: Theme Editor: Added column number to parser error messages git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27477 a1c6a512-1295-4272-9138-f99709370657 --- lib/skin_parser/skin_debug.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'lib/skin_parser/skin_debug.c') diff --git a/lib/skin_parser/skin_debug.c b/lib/skin_parser/skin_debug.c index 4abe625..c03b32e 100644 --- a/lib/skin_parser/skin_debug.c +++ b/lib/skin_parser/skin_debug.c @@ -30,15 +30,25 @@ /* Global variables for debug output */ int debug_indent_level = 0; extern int skin_line; +extern char* skin_start; /* Global error variables */ int error_line; +int error_col; char* error_message; /* Debugging functions */ -void skin_error(enum skin_errorcode error) +void skin_error(enum skin_errorcode error, char* cursor) { + error_col = 0; + + while(cursor > skin_start && *cursor != '\n') + { + cursor--; + error_col++; + } + error_line = skin_line; switch(error) @@ -91,6 +101,11 @@ int skin_error_line() return error_line; } +int skin_error_col() +{ + return error_col; +} + char* skin_error_message() { return error_message; @@ -99,6 +114,7 @@ char* skin_error_message() void skin_clear_errors() { error_line = 0; + error_col = 0; error_message = NULL; } -- cgit v1.1