[gtk+/wip/otte/shader: 25/55] gskslexpression: Parse (sub)expressions in parenthesis
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/shader: 25/55] gskslexpression: Parse (sub)expressions in parenthesis
- Date: Tue, 3 Oct 2017 03:41:04 +0000 (UTC)
commit e03985a313644e76ddad041d439ba378962e7445
Author: Benjamin Otte <otte redhat com>
Date: Fri Sep 29 01:18:49 2017 +0200
gskslexpression: Parse (sub)expressions in parenthesis
Well, that was easy.
gsk/gskslexpression.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gsk/gskslexpression.c b/gsk/gskslexpression.c
index 041b7b8..fd191dd 100644
--- a/gsk/gskslexpression.c
+++ b/gsk/gskslexpression.c
@@ -1283,6 +1283,23 @@ gsk_sl_expression_parse_primary (GskSlScope *scope,
gsk_sl_preprocessor_consume (stream, (GskSlExpression *) constant);
return (GskSlExpression *) constant;
+ case GSK_SL_TOKEN_LEFT_PAREN:
+ {
+ GskSlExpression *expr;
+
+ gsk_sl_preprocessor_consume (stream, NULL);
+ expr = gsk_sl_expression_parse (scope, stream);
+
+ token = gsk_sl_preprocessor_get (stream);
+ if (!gsk_sl_token_is (token, GSK_SL_TOKEN_RIGHT_PAREN))
+ {
+ gsk_sl_preprocessor_error (stream, SYNTAX, "Expected closing \")\".");
+ gsk_sl_preprocessor_sync (stream, GSK_SL_TOKEN_RIGHT_PAREN);
+ }
+ gsk_sl_preprocessor_consume (stream, NULL);
+
+ return expr;
+ }
case GSK_SL_TOKEN_VOID:
case GSK_SL_TOKEN_FLOAT:
case GSK_SL_TOKEN_DOUBLE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]