Polishing

This commit is contained in:
Sam Brannen 2024-01-26 16:53:44 +01:00
parent 86266b3d67
commit fdf0a6f6c7
3 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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)
----

View File

@ -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: `$`