Enlightenment CVS committal Author : barbieri Project : e17 Module : libs/edje
Dir : e17/libs/edje/src/bin Modified Files: edje_cc_parse.c Log Message: Avoid doing math inside strings (quoted text), so I'm now enable to have part.description.text.text starting with "(". Patch originally by rephorm. Tested and minor changes by barbieri. =================================================================== RCS file: /cvs/e/e17/libs/edje/src/bin/edje_cc_parse.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- edje_cc_parse.c 17 Jun 2007 06:51:42 -0000 1.42 +++ edje_cc_parse.c 11 Jul 2007 15:33:03 -0000 1.43 @@ -7,7 +7,6 @@ static void new_object(void); static void new_statement(void); static char *perform_math (char *input); -static void preprocess_params (void); static int isdelim(char c); static char *next_token(char *p, char *end, char **new_p, int *delim); static char *stack_id(void); @@ -120,30 +119,6 @@ free(id); } -static void -preprocess_params (void) -{ - Evas_List *l; - - /* a formula will never be spread across multiple params */ - for (l = params; l; l = l->next) { - char *data = l->data; - char *replace = NULL; - - /* if the token begins with a opening parens, the user wants us - * to do some math :) - */ - if (*data == '(') - { - replace = perform_math (data); - - free (l->data); - l->data = replace; - } - - } -} - static char * perform_math (char *input) { @@ -364,6 +339,14 @@ p++; } } + else if (tok && *tok == '(') + { + char *tmp; + tmp = tok; + tok = perform_math(tok); + free(tmp); + } + return tok; } @@ -452,7 +435,6 @@ if (do_params) { do_params = 0; - preprocess_params (); new_statement(); /* clear out params */ while (params) ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs