lscl.lang – Language-related definitions

lscl.lang.LsclData = LsclData

Type representing a document to process.

lscl.lang.LsclRValue = LsclRValue

Value that can be evaluated.

lscl.lang.LsclCondition = LsclCondition

Condition.

pydantic model lscl.lang.LsclSelector

Bases: BaseModel

Selector for evaluating a variable within a condition.

Fields:
field names: Annotated[list[Annotated[str, StringConstraints(pattern='^[^\\[\\]\\,]+$')]], Len(min_length=1)] [Required]

Name of the variable to evaluate.

pydantic model lscl.lang.LsclMethodCall

Bases: BaseModel

Method call.

Fields:
field name: str [Required]

Name of the function to call.

field params: list[LsclRValue] = []

Parameters.

pydantic model lscl.lang.LsclAnd

Bases: BaseModel

And condition.

Fields:
field conditions: list[LsclCondition] [Required]

List of conditions.

pydantic model lscl.lang.LsclOr

Bases: BaseModel

Or condition.

Fields:
field conditions: list[LsclCondition] [Required]

List of conditions.

pydantic model lscl.lang.LsclXor

Bases: BaseModel

Xor condition.

Fields:
field conditions: list[LsclCondition] [Required]

List of conditions.

pydantic model lscl.lang.LsclNand

Bases: BaseModel

Nand condition.

Fields:
field conditions: list[LsclCondition] [Required]

Condition to inverse the result of the and of.

pydantic model lscl.lang.LsclNot

Bases: BaseModel

Not condition.

Fields:
field condition: LsclCondition [Required]

Condition to inverse the result of.

pydantic model lscl.lang.LsclIn

Bases: BaseModel

In condition.

Fields:
field haystack: LsclRValue [Required]

Haystack in which to look for the needle.

field needle: LsclRValue [Required]

Needle to look for.

pydantic model lscl.lang.LsclNotIn

Bases: BaseModel

Not in condition.

Fields:
field haystack: LsclRValue [Required]

Haystack in which to look for the needle.

field needle: LsclRValue [Required]

Needle to look for.

pydantic model lscl.lang.LsclEqualTo

Bases: BaseModel

Equal condition.

Fields:
field first: LsclRValue [Required]

First value.

field second: LsclRValue [Required]

Second value.

pydantic model lscl.lang.LsclNotEqualTo

Bases: BaseModel

Not equal condition.

Fields:
field first: LsclRValue [Required]

First value.

field second: LsclRValue [Required]

Second value.

pydantic model lscl.lang.LsclGreaterThan

Bases: BaseModel

Greater than condition.

Fields:
field first: LsclRValue [Required]

First value.

field second: LsclRValue [Required]

Second value.

pydantic model lscl.lang.LsclGreaterThanOrEqualTo

Bases: BaseModel

Greater than condition.

Fields:
field first: LsclRValue [Required]

First value.

field second: LsclRValue [Required]

Second value.

pydantic model lscl.lang.LsclLessThan

Bases: BaseModel

Greater than condition.

Fields:
field first: LsclRValue [Required]

First value.

field second: LsclRValue [Required]

Second value.

pydantic model lscl.lang.LsclLessThanOrEqualTo

Bases: BaseModel

Greater than condition.

Fields:
field first: LsclRValue [Required]

First value.

field second: LsclRValue [Required]

Second value.

pydantic model lscl.lang.LsclMatch

Bases: BaseModel

Condition to see if an rvalue matches a pattern.

Fields:
field pattern: re.Pattern [Required]

Pattern.

field value: LsclRValue [Required]

Value to match.

pydantic model lscl.lang.LsclNotMatch

Bases: BaseModel

Condition to see if an rvalue does not match a pattern.

Fields:
field pattern: re.Pattern [Required]

Pattern.

field value: LsclRValue [Required]

Value to match.

lscl.lang.LsclContent = LsclContent

Content, as a list of named blocks, named data, and conditions.

pydantic model lscl.lang.LsclConditions

Bases: BaseModel

Condition with content.

Fields:
field conditions: Annotated[list[tuple[LsclCondition, LsclContent]], Len(min_length=1)] [Required]

Conditions to check sequentially.

field default: LsclContent | None = None

Block to consider if none of the above conditions match.

pydantic model lscl.lang.LsclAttribute

Bases: BaseModel

Data with a name.

Fields:
field content: LsclData = {}

Data being named.

field name: Annotated[str, StringConstraints(pattern='^[A-Za-z0-9_-]+$')] [Required]

Name of the data.

pydantic model lscl.lang.LsclBlock

Bases: BaseModel

Block with a name.

Fields:
field content: LsclContent = []

Content, as a list of named blocks, named data, and conditions.

field name: Annotated[str, StringConstraints(pattern='^[A-Za-z0-9_-]+$')] [Required]

Name of the block.