RedSeaCLIExecutable Class¶
Represents a RSML.CLI executable.
Hierarchy¶
flowchart TB
RedSeaCLIExecutable --> object
Constructor¶
RedSeaCLIExecutable.__init__(path_to_executable: str | None = None)
Creates a new executable given a path. If a path isn't given at this stage, it may not be given later.
Parameters¶
path_to_executable (str) = None-
The path to the executable, defaults to
None.
Instance Methods¶
RedSeaCLIExecutable contains 4 instance methods.
evaluate_document(custom_rid: str | None = None, primary_only: bool = False, fallbacks: tuple[str | None, str] = (None, "[WARNING] No match was found."), expand_any: bool = False)¶
Evaluates a document, using the official-25 Language Standard.
Parameters¶
custom_rid (str | None) = None-
A custom RID to pass to the parser, instead of the host's RID. If set to
None, uses the host's RID. primary_only (bool) = False-
If set to
True, only executes the primary operator. fallbacks (tuple[str | None, str]) = (None, "[WARNING] No match was found.")-
The error and null message fallbacks, respectively. Defaults to
RSML.CLI's messages expand_any (bool) = False-
If set to
True, expandsanyinto Regex expression.+, indicating that any RID will be a match.
Exceptions¶
ValueError-
The executable was not loaded.
Returns¶
str-
The match (if any) or one of the specified fallbacks.
evaluate_document_as_mfroad()¶
Evaluates a document, using the roadlike Language Standard.
Exceptions¶
ValueError-
The executable was not loaded.
Returns¶
str-
The match (if any) or one of the CLI's fallbacks.
get_runtime_id()¶
Retrieves the host's RID.
Exceptions¶
ValueError-
The executable was not loaded.
Returns¶
str-
The host's RID.
load_document(document: RedSeaDocument)¶
Loads a document into the executable.
Parameters¶
document (RedSeaDocument)-
The document to load.
Exceptions¶
ValueError-
The executable was not loaded.
Returns¶
str-
The host's RID.
Properties¶
RedSeaCLIExecutable contains 3 properties.
repository -> str¶
Returns the link to RSML's repository (https://github.com/OceanApocalypseStudios/RedSeaMarkupLanguage).
Exceptions¶
ValueError-
The executable was not loaded.
repository_python -> str¶
Returns the link to the module's repository (https://github.com/OceanApocalypseStudios/RSML.Python).
version -> str¶
Returns the parser's version - not the CLI's version and not the module's version.
The returned string is in vX.X.X format.
Exceptions¶
ValueError-
The executable was not loaded.