summaryrefslogtreecommitdiff
path: root/lib/skin_parser/skin_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/skin_parser/skin_debug.c')
-rw-r--r--lib/skin_parser/skin_debug.c18
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 */
31int debug_indent_level = 0; 31int debug_indent_level = 0;
32extern int skin_line; 32extern int skin_line;
33extern char* skin_start;
33 34
34/* Global error variables */ 35/* Global error variables */
35int error_line; 36int error_line;
37int error_col;
36char* error_message; 38char* error_message;
37 39
38/* Debugging functions */ 40/* Debugging functions */
39void skin_error(enum skin_errorcode error) 41void 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
104int skin_error_col()
105{
106 return error_col;
107}
108
94char* skin_error_message() 109char* skin_error_message()
95{ 110{
96 return error_message; 111 return error_message;
@@ -99,6 +114,7 @@ char* skin_error_message()
99void skin_clear_errors() 114void 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