compose: use a ternary tree instead of a regular trie
[platform/upstream/libxkbcommon.git] / src / xkbcomp / expr.c
index b2567de..dbdf734 100644 (file)
@@ -24,6 +24,8 @@
  *
  ********************************************************/
 
+#include "config.h"
+
 #include "xkbcomp-priv.h"
 #include "text.h"
 #include "expr.h"
@@ -52,10 +54,10 @@ ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr,
         *elem_rtrn = xkb_atom_text(ctx, expr->array_ref.element);
         *field_rtrn = xkb_atom_text(ctx, expr->array_ref.field);
         *index_rtrn = expr->array_ref.entry;
-       if (expr->array_ref.element != XKB_ATOM_NONE && *elem_rtrn == NULL)
-               return false;
-       if (*field_rtrn == NULL)
-               return false;
+        if (expr->array_ref.element != XKB_ATOM_NONE && *elem_rtrn == NULL)
+            return false;
+        if (*field_rtrn == NULL)
+            return false;
         return true;
     default:
         break;
@@ -182,6 +184,9 @@ ExprResolveBoolean(struct xkb_context *ctx, const ExprDef *expr,
     case EXPR_ASSIGN:
     case EXPR_NEGATE:
     case EXPR_UNARY_PLUS:
+    case EXPR_ACTION_DECL:
+    case EXPR_ACTION_LIST:
+    case EXPR_KEYSYM_LIST:
         log_err(ctx, "%s of boolean values not permitted\n",
                 expr_op_type_to_string(expr->expr.op));
         break;
@@ -474,6 +479,9 @@ ExprResolveString(struct xkb_context *ctx, const ExprDef *expr,
     case EXPR_INVERT:
     case EXPR_NOT:
     case EXPR_UNARY_PLUS:
+    case EXPR_ACTION_DECL:
+    case EXPR_ACTION_LIST:
+    case EXPR_KEYSYM_LIST:
         log_err(ctx, "%s of strings not permitted\n",
                 expr_op_type_to_string(expr->expr.op));
         return false;
@@ -549,7 +557,7 @@ ExprResolveMaskLookup(struct xkb_context *ctx, const ExprDef *expr,
 
     case EXPR_ARRAY_REF:
         bogus = "array reference";
-       /* fallthrough */
+        /* fallthrough */
     case EXPR_ACTION_DECL:
         if (bogus == NULL)
             bogus = "function use";