diff options
author | Nak-Gyeong Kim <nakkyong.kim@samsung.com> | 2015-05-29 18:11:49 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-05-29 18:22:09 +0200 |
commit | 7d33ae501b2263ff1450c6351dea181573afe517 (patch) | |
tree | cd46ff3b8749c8206e433f68a8847e414db3d4f6 /src/bin/edje | |
parent | 7056b2f6e4af9c1ef9445472c018655a19a54e71 (diff) |
edje: edje_cc_parse should check pair of parens.
Summary:
Fix parens bug.
((x + y)-z) is OK.
((x + y) - z) is NOT OK. This patch can cover this case.
@fix
Signed-off-by: Nak-Gyeong Kim <nakkyong.kim@samsung.com>
Test Plan:
Test in edc.
((x + y)-z) is OK.
((x + y) - z) is NOT OK. This patch can cover this case.
If parens are not paired, it will notify.
Reviewers: raster, Hermet, cedric
Subscribers: kimcinoo, jaehwan
Differential Revision: https://phab.enlightenment.org/D2554
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/bin/edje')
-rw-r--r-- | src/bin/edje/edje_cc_parse.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c index 4e2884318f..b87afb08ac 100644 --- a/src/bin/edje/edje_cc_parse.c +++ b/src/bin/edje/edje_cc_parse.c | |||
@@ -387,10 +387,18 @@ next_token(char *p, char *end, char **new_p, int *delim) | |||
387 | else if (is_escaped) | 387 | else if (is_escaped) |
388 | is_escaped = 0; | 388 | is_escaped = 0; |
389 | } | 389 | } |
390 | else if (in_parens) | 390 | else if (in_parens != 0 && (!is_escaped)) |
391 | { | 391 | { |
392 | if (((*p) == ')') && (!is_escaped)) | 392 | if (*p == '(') |
393 | in_parens++; | ||
394 | else if (*p == ')') | ||
393 | in_parens--; | 395 | in_parens--; |
396 | else if (isdelim(*p)) | ||
397 | { | ||
398 | ERR("check pair of parens %s:%i.", file_in, line - 1); | ||
399 | err_show(); | ||
400 | exit(-1); | ||
401 | } | ||
394 | } | 402 | } |
395 | else | 403 | else |
396 | { | 404 | { |
@@ -401,6 +409,8 @@ next_token(char *p, char *end, char **new_p, int *delim) | |||
401 | } | 409 | } |
402 | else if (*p == '(') | 410 | else if (*p == '(') |
403 | in_parens++; | 411 | in_parens++; |
412 | else if (*p == ')') | ||
413 | in_parens--; | ||
404 | 414 | ||
405 | /* check for end-of-token */ | 415 | /* check for end-of-token */ |
406 | if ( | 416 | if ( |