2018-04-25 12:38:41 -04:00
|
|
|
[[painless-identifiers]]
|
|
|
|
=== Identifiers
|
|
|
|
|
2018-05-23 16:36:58 -04:00
|
|
|
Use an identifier as a named token to specify a
|
|
|
|
<<painless-variables, variable>>, <<painless-types, type>>,
|
Painless: Restructure/Clean Up of Spec Documentation (#31013)
Full restructure of the spec into new sections for operators, statements, scripts, functions, lambdas, and regexes. Split of operators into 6 sections, a table, reference, array, numeric, boolean, and general. Clean up of all operators sections. Sporadic clean up else where.
2018-06-07 20:11:56 -04:00
|
|
|
<<field-access-operator, field>>, <<method-call-operator, method>>, or
|
|
|
|
<<painless-functions, function>>.
|
|
|
|
|
|
|
|
*Errors*
|
|
|
|
|
|
|
|
If a <<painless-keywords, keyword>> is used as an identifier.
|
2018-04-25 12:38:41 -04:00
|
|
|
|
|
|
|
*Grammar*
|
|
|
|
[source,ANTLR4]
|
|
|
|
----
|
|
|
|
ID: [_a-zA-Z] [_a-zA-Z-0-9]*;
|
|
|
|
----
|
|
|
|
|
|
|
|
*Examples*
|
|
|
|
|
|
|
|
* Variations of identifiers.
|
|
|
|
+
|
|
|
|
[source,Painless]
|
|
|
|
----
|
|
|
|
a
|
|
|
|
Z
|
|
|
|
id
|
|
|
|
list
|
|
|
|
list0
|
|
|
|
MAP25
|
|
|
|
_map25
|
|
|
|
Map_25
|
|
|
|
----
|