Class: QgsEsriArcadeScript

Parses and encapsulates an entire Esri Arcade script.

Added in version 4.4.

List of all members, including inherited members

Constructor

__init__

Methods

acceptVisitor

Accepts a visitor to traverse the script abstract syntax tree.

dump

Dumps the abstract syntax tree back into an Arcade script string.

hasParserError

Returns True if a parsing error occurred.

parserErrorString

Returns parser error description.

rootBlock

Returns the root block statement node, or None if parsing failed.

script

Returns the original script text.

Static Methods

quotedString

Returns a properly quoted string literal (enclosed in double quotes with escape sequences).

class qgis.core.QgsEsriArcadeScript[source]

Bases: object

__init__(scriptText: str | None = '')

Creates a new script from scriptText.

Parameters:

scriptText (str|None = '')

__init__(other: QgsEsriArcadeScript)
Parameters:

other (QgsEsriArcadeScript)

acceptVisitor(self, visitor: QgsEsriArcadeVisitor)[source]

Accepts a visitor to traverse the script abstract syntax tree.

Parameters:

visitor (QgsEsriArcadeVisitor)

dump(self) → str[source]

Dumps the abstract syntax tree back into an Arcade script string.

Return type:

str

hasParserError(self) → bool[source]

Returns True if a parsing error occurred.

Return type:

bool

parserErrorString(self) → str[source]

Returns parser error description.

Return type:

str

static quotedString(text: str | None) → str[source]

Returns a properly quoted string literal (enclosed in double quotes with escape sequences).

Parameters:

text (str|None)

Return type:

str

rootBlock(self) → QgsEsriArcadeBlockStatement | None[source]

Returns the root block statement node, or None if parsing failed.

Return type:

QgsEsriArcadeBlockStatement|None

script(self) → str[source]

Returns the original script text.

Return type:

str