From fdf0a6f6c79c8526ef47fb3435592f6546267252 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Fri, 26 Jan 2024 16:53:44 +0100 Subject: [PATCH] Polishing --- .../modules/ROOT/pages/core/expressions.adoc | 13 +++++-------- .../core/expressions/language-ref/operators.adoc | 2 ++ .../core/expressions/language-ref/variables.adoc | 2 ++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/core/expressions.adoc b/framework-docs/modules/ROOT/pages/core/expressions.adoc index 13aaedd89be..95a017bd1c2 100644 --- a/framework-docs/modules/ROOT/pages/core/expressions.adoc +++ b/framework-docs/modules/ROOT/pages/core/expressions.adoc @@ -33,8 +33,10 @@ populate them are listed at the end of the chapter. The expression language supports the following functionality: * Literal expressions -* Boolean and relational operators +* Boolean, relational, and logical operators * Regular expressions +* String operators +* Mathematical operators * Class expressions * Accessing properties, arrays, lists, and maps * Method invocation @@ -44,15 +46,10 @@ The expression language supports the following functionality: * Array construction * Inline lists * Inline maps -* Ternary operator +* Ternary and Elvis operators * Variables -* User-defined functions added to the context - * reflective invocation of `Method` - * various cases of `MethodHandle` +* User-defined functions * Collection projection * Collection selection * Templated expressions - - - diff --git a/framework-docs/modules/ROOT/pages/core/expressions/language-ref/operators.adoc b/framework-docs/modules/ROOT/pages/core/expressions/language-ref/operators.adoc index 7d9d6ece8e4..850710c11ce 100644 --- a/framework-docs/modules/ROOT/pages/core/expressions/language-ref/operators.adoc +++ b/framework-docs/modules/ROOT/pages/core/expressions/language-ref/operators.adoc @@ -167,6 +167,7 @@ Java:: boolean falseValue = parser.parseExpression("!true").getValue(Boolean.class); // -- AND and NOT -- + String expression = "isMember('Nikola Tesla') and !isMember('Mihajlo Pupin')"; boolean falseValue = parser.parseExpression(expression).getValue(societyContext, Boolean.class); ---- @@ -199,6 +200,7 @@ Kotlin:: val falseValue = parser.parseExpression("!true").getValue(Boolean::class.java) // -- AND and NOT -- + val expression = "isMember('Nikola Tesla') and !isMember('Mihajlo Pupin')" val falseValue = parser.parseExpression(expression).getValue(societyContext, Boolean::class.java) ---- diff --git a/framework-docs/modules/ROOT/pages/core/expressions/language-ref/variables.adoc b/framework-docs/modules/ROOT/pages/core/expressions/language-ref/variables.adoc index 96d75477d83..3516cac84ed 100644 --- a/framework-docs/modules/ROOT/pages/core/expressions/language-ref/variables.adoc +++ b/framework-docs/modules/ROOT/pages/core/expressions/language-ref/variables.adoc @@ -13,6 +13,8 @@ Variable names must be composed of one or more of the following supported types characters. * letter: any character for which `java.lang.Character.isLetter(char)` returns `true` + - This includes letters such as `A` to `Z`, `a` to `z`, `ü`, `ñ`, and `é` as well as + letters from other character sets such as Chinese, Japanese, Cyrillic, etc. * digit: `0` to `9` * underscore: `_` * dollar sign: `$`