]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more notes and tests
authorAlan T. DeKok <aland@freeradius.org>
Wed, 26 Jan 2022 20:24:51 +0000 (15:24 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 29 Jan 2022 16:13:31 +0000 (11:13 -0500)
src/lib/unlang/xlat_expr.c
src/tests/unit/xlat/expr.txt

index 072db28bf81bd2e36681c09f0ea9c2facb6f3d97..e65c36b900f1cc9ddfebbb91c8680d3917409f6d 100644 (file)
@@ -44,6 +44,11 @@ RCSID("$Id$")
  *     doesn't need to interpret the LHS, but just knows its limits.  We perhaps want a "range compare"
  *     function, which just checks ranges on one side against values on the right.
  *
+ *     Even worse, when we do "((bool) 1) < 3", the RHS is cast to the type of the LHS by
+ *     tmpl_afrom_substr(). This is because we pass the LHS data type recursively down, which works most of
+ *     the time, but not all of the time.  There are currently hacks in the "upcast" code here to fix this,
+ *     but it's a hack.
+ *
  *     @todo - Regular expressions are not handled.  This isn't a lot of work, but can be a bit finicky.
  *
  *     @todo - short-circuit && / || need to be updated.  This requires various magic in their instantiation
index f61d6302595ec401705126fbfa51b2843a5be1ad..bac3e29f2b90d74dde401658824edc118329a269 100644 (file)
@@ -106,5 +106,16 @@ match ((1 < 2) < 3)
 xlat_expr (uint32) %(concat:1 2)
 match %(cast_expression:uint32 %(concat:1 2))
 
+#
+# Mashing multiple brackets together.  The brackets are removed as
+# part of the parsing step, because no intermediate nodes are created for them.
+#
+xlat_expr (((1 + 2)))
+match (1 + 2)
+
+xlat_expr (((1 + 2)) * ((3 + 4)))
+match ((1 + 2) * (3 + 4))
+
+
 count
-match 51
+match 55