UAX #31 identifier validation for catalog entity names, with the
upstream pattern ^[\p{XID_Start}_][\p{XID_Continue}]*$, compiled
like a schema pattern by A2UICore.Schema.ECMA262: exact on
Erlang/OTP 28 and later, an approximation on older PCRE.
Two structural points follow the reference:
- the empty string is invalid;
- a leading
@makes a name invalid, unlessallow_leading_at: true(payload validation, where a call may name a system function such as@index): then one leading@is ignored. Catalog declarations never allow it.
Summary
Functions
Raises A2UICore.Error with category :catalog if name is not a
valid UAX #31 identifier.
Returns whether codepoint (a one-character string) continues an
identifier (XID_Continue, as in valid?/1). Expression and path
scanning use it to find token boundaries.
Returns whether name is a valid UAX #31 identifier.
Functions
Raises A2UICore.Error with category :catalog if name is not a
valid UAX #31 identifier.
Returns whether codepoint (a one-character string) continues an
identifier (XID_Continue, as in valid?/1). Expression and path
scanning use it to find token boundaries.
iex> A2UICore.Identifier.continue?("a")
true
iex> A2UICore.Identifier.continue?("-")
false
Returns whether name is a valid UAX #31 identifier.
Options: allow_leading_at: true ignores one leading @.
iex> A2UICore.Identifier.valid?("submit_form")
true
iex> A2UICore.Identifier.valid?("@index")
false
iex> A2UICore.Identifier.valid?("@index", allow_leading_at: true)
true