[gtk+/wip/otte/shader: 352/367] gskslexpression: Parse (sub)expressions in parenthesis
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/shader: 352/367] gskslexpression: Parse (sub)expressions in parenthesis
- Date: Sun, 1 Oct 2017 03:16:59 +0000 (UTC)
commit 1e81754ae5b1ac677be98fcc070940de595f636c
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]