Update documentation for supported letters in variable names in SpEL

Closes gh-32138
This commit is contained in:
Sam Brannen 2024-01-26 16:42:09 +01:00
parent 68cf3b928b
commit 86266b3d67
2 changed files with 10 additions and 7 deletions

View File

@ -6,11 +6,14 @@ are set by using the `setVariable()` method in `EvaluationContext` implementatio
[NOTE]
====
Valid variable names must be composed of one or more of the following supported
Variable names must be begin with a letter (as defined below), an underscore, or a dollar
sign.
Variable names must be composed of one or more of the following supported types of
characters.
* letters: `A` to `Z` and `a` to `z`
* digits: `0` to `9`
* letter: any character for which `java.lang.Character.isLetter(char)` returns `true`
* digit: `0` to `9`
* underscore: `_`
* dollar sign: `$`
====

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -93,8 +93,8 @@ class Tokenizer {
pushCharToken(TokenKind.PLUS);
}
break;
case '_': // the other way to start an identifier
lexIdentifier();
case '_':
lexIdentifier(); // '_' is another way to start an identifier
break;
case '-':
if (isTwoCharToken(TokenKind.DEC)) {
@ -206,7 +206,7 @@ class Tokenizer {
pushPairToken(TokenKind.SELECT_LAST);
}
else {
lexIdentifier();
lexIdentifier(); // '$' is another way to start an identifier
}
break;
case '>':