summaryrefslogtreecommitdiff
path: root/src/cr-parser.c
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@gnome.org>2004-05-29 23:37:28 +0000
committerDodji Seketeli <dodji@src.gnome.org>2004-05-29 23:37:28 +0000
commit324e1473cc7e86bb47c38e06977e6b862efe5464 (patch)
tree2812123daa5899d0acea6acb582f3961c8fe4e35 /src/cr-parser.c
parente197a2d61042320dfc40bf663c138867a6120a6b (diff)
downloadlibcroco-324e1473cc7e86bb47c38e06977e6b862efe5464.tar.gz
Synchronize with libcroco--mainline--0.6--patch-25.
2004-05-29 Dodji Seketeli <dodji@gnome.org> Synchronize with libcroco--mainline--0.6--patch-25.
Diffstat (limited to 'src/cr-parser.c')
-rw-r--r--src/cr-parser.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/src/cr-parser.c b/src/cr-parser.c
index 926ba3d..e713ff6 100644
--- a/src/cr-parser.c
+++ b/src/cr-parser.c
@@ -1520,16 +1520,32 @@ cr_parser_parse_term (CRParser * a_this, CRTerm ** a_term)
cr_parsing_location_copy (&location, &token->location) ;
if (token->type == DELIM_TK && token->u.unichar == '+') {
result->unary_op = PLUS_UOP;
+ cr_token_destroy (token) ;
+ token = NULL ;
+ cr_parser_try_to_skip_spaces_and_comments (a_this);
+ status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr,
+ &token);
+ if (status != CR_OK || !token)
+ goto error;
} else if (token->type == DELIM_TK && token->u.unichar == '-') {
result->unary_op = MINUS_UOP;
- } else if (token->type == EMS_TK
- || token->type == EXS_TK
- || token->type == LENGTH_TK
- || token->type == ANGLE_TK
- || token->type == TIME_TK
- || token->type == FREQ_TK
- || token->type == PERCENTAGE_TK
- || token->type == NUMBER_TK) {
+ cr_token_destroy (token) ;
+ token = NULL ;
+ cr_parser_try_to_skip_spaces_and_comments (a_this);
+ status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr,
+ &token);
+ if (status != CR_OK || !token)
+ goto error;
+ }
+
+ if (token->type == EMS_TK
+ || token->type == EXS_TK
+ || token->type == LENGTH_TK
+ || token->type == ANGLE_TK
+ || token->type == TIME_TK
+ || token->type == FREQ_TK
+ || token->type == PERCENTAGE_TK
+ || token->type == NUMBER_TK) {
status = cr_term_set_number (result, token->u.num);
CHECK_PARSING_STATUS (status, TRUE);
token->u.num = NULL;
@@ -1594,7 +1610,7 @@ cr_parser_parse_term (CRParser * a_this, CRTerm ** a_term)
cr_parser_clear_errors (a_this);
return CR_OK;
- error:
+ error:
if (result) {
cr_term_destroy (result);
@@ -2123,7 +2139,7 @@ cr_parser_parse_function (CRParser * a_this,
cr_parser_try_to_skip_spaces_and_comments (a_this) ;
- status = cr_parser_parse_term (a_this, &expr);
+ status = cr_parser_parse_expr (a_this, &expr);
CHECK_PARSING_STATUS (status, FALSE);