diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_test.c | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/LuaSL/src/LuaSL_test.c b/LuaSL/src/LuaSL_test.c index f7087cf..ec7824a 100644 --- a/LuaSL/src/LuaSL_test.c +++ b/LuaSL/src/LuaSL_test.c | |||
@@ -8,7 +8,7 @@ typedef struct | |||
8 | char fileName[PATH_MAX]; | 8 | char fileName[PATH_MAX]; |
9 | struct timeval startTime; | 9 | struct timeval startTime; |
10 | float compileTime; | 10 | float compileTime; |
11 | int errors, warnings; | 11 | int bugs, warnings; |
12 | boolean running; | 12 | boolean running; |
13 | 13 | ||
14 | } script; | 14 | } script; |
@@ -144,6 +144,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Server_D | |||
144 | { | 144 | { |
145 | gameGlobals *game = data; | 145 | gameGlobals *game = data; |
146 | 146 | ||
147 | char buf[PATH_MAX]; | ||
147 | char SID[PATH_MAX]; | 148 | char SID[PATH_MAX]; |
148 | const char *command; | 149 | const char *command; |
149 | char *ext; | 150 | char *ext; |
@@ -160,14 +161,65 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Server_D | |||
160 | ext = rindex(SID, '.'); | 161 | ext = rindex(SID, '.'); |
161 | if (ext) | 162 | if (ext) |
162 | { | 163 | { |
164 | script *me; | ||
165 | |||
163 | ext[0] = '\0'; | 166 | ext[0] = '\0'; |
164 | command = ext + 1; | 167 | command = ext + 1; |
165 | if (0 == strcmp(command, "compiled(false)")) | 168 | me = eina_hash_find(game->scripts, SID); |
169 | if (0 == strncmp(command, "compilerWarning(", 16)) | ||
170 | { | ||
171 | char *temp; | ||
172 | char *line; | ||
173 | char *column; | ||
174 | char *text; | ||
175 | |||
176 | strcpy(buf, &command[16]); | ||
177 | temp = buf; | ||
178 | line = temp; | ||
179 | while (',' != temp[0]) | ||
180 | temp++; | ||
181 | temp[0] = '\0'; | ||
182 | column = ++temp; | ||
183 | while (',' != temp[0]) | ||
184 | temp++; | ||
185 | temp[0] = '\0'; | ||
186 | text = ++temp; | ||
187 | while (')' != temp[0]) | ||
188 | temp++; | ||
189 | temp[0] = '\0'; | ||
190 | PW("%s @ line %s, column %s.", text, line, column); | ||
191 | if (me) | ||
192 | me->warnings++; | ||
193 | } | ||
194 | else if (0 == strncmp(command, "compilerError(", 14)) | ||
195 | { | ||
196 | char *temp; | ||
197 | char *line; | ||
198 | char *column; | ||
199 | char *text; | ||
200 | |||
201 | strcpy(buf, &command[14]); | ||
202 | temp = buf; | ||
203 | line = temp; | ||
204 | while (',' != temp[0]) | ||
205 | temp++; | ||
206 | temp[0] = '\0'; | ||
207 | column = ++temp; | ||
208 | while (',' != temp[0]) | ||
209 | temp++; | ||
210 | temp[0] = '\0'; | ||
211 | text = ++temp; | ||
212 | while (')' != temp[0]) | ||
213 | temp++; | ||
214 | temp[0] = '\0'; | ||
215 | PE("%s @ line %s, column %s.", text, line, column); | ||
216 | if (me) | ||
217 | me->bugs++; | ||
218 | } | ||
219 | else if (0 == strcmp(command, "compiled(false)")) | ||
166 | PE("The compile of %s failed!", SID); | 220 | PE("The compile of %s failed!", SID); |
167 | else if (0 == strcmp(command, "compiled(true)")) | 221 | else if (0 == strcmp(command, "compiled(true)")) |
168 | { | 222 | { |
169 | script *me = eina_hash_find(game->scripts, SID); | ||
170 | |||
171 | if (me) | 223 | if (me) |
172 | { | 224 | { |
173 | struct timeval now; | 225 | struct timeval now; |