diff options
Diffstat (limited to 'lib/skin_parser/skin_debug.c')
-rw-r--r-- | lib/skin_parser/skin_debug.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/skin_parser/skin_debug.c b/lib/skin_parser/skin_debug.c index 4abe6252f0..c03b32e910 100644 --- a/lib/skin_parser/skin_debug.c +++ b/lib/skin_parser/skin_debug.c | |||
@@ -30,15 +30,25 @@ | |||
30 | /* Global variables for debug output */ | 30 | /* Global variables for debug output */ |
31 | int debug_indent_level = 0; | 31 | int debug_indent_level = 0; |
32 | extern int skin_line; | 32 | extern int skin_line; |
33 | extern char* skin_start; | ||
33 | 34 | ||
34 | /* Global error variables */ | 35 | /* Global error variables */ |
35 | int error_line; | 36 | int error_line; |
37 | int error_col; | ||
36 | char* error_message; | 38 | char* error_message; |
37 | 39 | ||
38 | /* Debugging functions */ | 40 | /* Debugging functions */ |
39 | void skin_error(enum skin_errorcode error) | 41 | void skin_error(enum skin_errorcode error, char* cursor) |
40 | { | 42 | { |
41 | 43 | ||
44 | error_col = 0; | ||
45 | |||
46 | while(cursor > skin_start && *cursor != '\n') | ||
47 | { | ||
48 | cursor--; | ||
49 | error_col++; | ||
50 | } | ||
51 | |||
42 | error_line = skin_line; | 52 | error_line = skin_line; |
43 | 53 | ||
44 | switch(error) | 54 | switch(error) |
@@ -91,6 +101,11 @@ int skin_error_line() | |||
91 | return error_line; | 101 | return error_line; |
92 | } | 102 | } |
93 | 103 | ||
104 | int skin_error_col() | ||
105 | { | ||
106 | return error_col; | ||
107 | } | ||
108 | |||
94 | char* skin_error_message() | 109 | char* skin_error_message() |
95 | { | 110 | { |
96 | return error_message; | 111 | return error_message; |
@@ -99,6 +114,7 @@ char* skin_error_message() | |||
99 | void skin_clear_errors() | 114 | void skin_clear_errors() |
100 | { | 115 | { |
101 | error_line = 0; | 116 | error_line = 0; |
117 | error_col = 0; | ||
102 | error_message = NULL; | 118 | error_message = NULL; |
103 | } | 119 | } |
104 | 120 | ||