robot.parsing.model package¶
Submodules¶
robot.parsing.model.blocks module¶
-
class
robot.parsing.model.blocks.
Container
[source]¶ Bases:
robot.parsing.model.statements.Node
,abc.ABC
-
lineno
¶
-
col_offset
¶
-
end_lineno
¶
-
end_col_offset
¶
-
errors
= ()¶
-
-
class
robot.parsing.model.blocks.
File
(sections: Sequence[robot.parsing.model.blocks.Section] = (), source: pathlib.Path | None[pathlib.Path, None] = None, languages: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Container
-
save
(output: pathlib.Path | str | typing.TextIO | None[pathlib.Path, str, TextIO, None] = None)[source]¶ Save model to the given
output
or to the original source file.The
output
can be a path to a file or an already opened file object. Ifoutput
is not given, the original source file will be overwritten.
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
Block
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Container
,abc.ABC
-
errors
= ()¶
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
Section
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Block
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
SettingSection
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Section
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
VariableSection
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Section
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
TestCaseSection
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Section
-
tasks
¶
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
KeywordSection
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Section
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
CommentSection
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Section
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
ImplicitCommentSection
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None] = None, body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.CommentSection
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
InvalidSection
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Section
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
TestCase
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Block
-
name
¶
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
Keyword
(header: robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None], body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Block
-
name
¶
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
NestedBlock
(header: robot.parsing.model.statements.Statement, body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), end: robot.parsing.model.statements.End | None[robot.parsing.model.statements.End, None] = None, errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.Block
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate
(ctx: robot.parsing.model.blocks.ValidationContext)¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
If
(header: robot.parsing.model.statements.Statement, body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), orelse: robot.parsing.model.blocks.If | None[robot.parsing.model.blocks.If, None] = None, end: robot.parsing.model.statements.End | None[robot.parsing.model.statements.End, None] = None, errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.NestedBlock
Represents IF structures in the model.
Used with IF, Inline IF, ELSE IF and ELSE nodes. The
type
attribute specifies the type.-
type
¶
-
condition
¶
-
assign
¶
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
For
(header: robot.parsing.model.statements.Statement, body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), end: robot.parsing.model.statements.End | None[robot.parsing.model.statements.End, None] = None, errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.NestedBlock
-
variables
¶
-
values
¶
-
flavor
¶
-
start
¶
-
mode
¶
-
fill
¶
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
Try
(header: robot.parsing.model.statements.Statement, body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), next: robot.parsing.model.blocks.Try | None[robot.parsing.model.blocks.Try, None] = None, end: robot.parsing.model.statements.End | None[robot.parsing.model.statements.End, None] = None, errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.NestedBlock
-
type
¶
-
patterns
¶
-
pattern_type
¶
-
variable
¶
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
While
(header: robot.parsing.model.statements.Statement, body: Sequence[Union[robot.parsing.model.statements.Statement, Block]] = (), end: robot.parsing.model.statements.End | None[robot.parsing.model.statements.End, None] = None, errors: Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.blocks.NestedBlock
-
condition
¶
-
limit
¶
-
on_limit
¶
-
on_limit_message
¶
-
col_offset
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
lineno
¶
-
validate_model
()¶
-
-
class
robot.parsing.model.blocks.
ModelWriter
(output: pathlib.Path | str | typing.TextIO[pathlib.Path, str, TextIO])[source]¶ Bases:
robot.parsing.model.visitor.ModelVisitor
-
generic_visit
(node)¶ Called if no explicit visitor function exists for a node.
-
visit
(node: robot.parsing.model.statements.Node)¶ Visit a node.
-
visit_Constant
(node)¶
-
-
class
robot.parsing.model.blocks.
ModelValidator
[source]¶ Bases:
robot.parsing.model.visitor.ModelVisitor
-
generic_visit
(node)¶ Called if no explicit visitor function exists for a node.
-
visit
(node: robot.parsing.model.statements.Node)¶ Visit a node.
-
visit_Constant
(node)¶
-
-
class
robot.parsing.model.blocks.
ValidationContext
[source]¶ Bases:
object
-
parent_block
¶
-
tasks
¶
-
in_keyword
¶
-
in_loop
¶
-
in_finally
¶
-
-
class
robot.parsing.model.blocks.
FirstStatementFinder
[source]¶ Bases:
robot.parsing.model.visitor.ModelVisitor
-
classmethod
find_from
(model: robot.parsing.model.statements.Node) → robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None][source]¶
-
generic_visit
(node: robot.parsing.model.statements.Node)[source]¶ Called if no explicit visitor function exists for a node.
-
visit
(node: robot.parsing.model.statements.Node)¶ Visit a node.
-
visit_Constant
(node)¶
-
classmethod
-
class
robot.parsing.model.blocks.
LastStatementFinder
[source]¶ Bases:
robot.parsing.model.visitor.ModelVisitor
-
classmethod
find_from
(model: robot.parsing.model.statements.Node) → robot.parsing.model.statements.Statement | None[robot.parsing.model.statements.Statement, None][source]¶
-
generic_visit
(node)¶ Called if no explicit visitor function exists for a node.
-
visit
(node: robot.parsing.model.statements.Node)¶ Visit a node.
-
visit_Constant
(node)¶
-
classmethod
robot.parsing.model.statements module¶
-
class
robot.parsing.model.statements.
Statement
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Node
,abc.ABC
-
handles_types
= ()¶
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
errors
= ()¶
-
lineno
¶
-
col_offset
¶
-
end_lineno
¶
-
end_col_offset
¶
-
classmethod
register
(subcls: Type[T]) → Type[T][source]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement[source]¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
classmethod
from_params
(*args, **kwargs) → robot.parsing.model.statements.Statement[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
data_tokens
¶
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None][source]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None][source]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None][source]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
lines
¶
-
-
class
robot.parsing.model.statements.
DocumentationOrMetadata
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
,abc.ABC
-
value
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(*args, **kwargs) → robot.parsing.model.statements.Statement¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
SingleValue
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
,abc.ABC
-
value
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(*args, **kwargs) → robot.parsing.model.statements.Statement¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
MultiValue
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
,abc.ABC
-
values
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(*args, **kwargs) → robot.parsing.model.statements.Statement¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
Fixture
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
,abc.ABC
-
name
¶
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(*args, **kwargs) → robot.parsing.model.statements.Statement¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
SectionHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
handles_types
= ('SETTING HEADER', 'VARIABLE HEADER', 'TESTCASE HEADER', 'TASK HEADER', 'KEYWORD HEADER', 'COMMENT HEADER', 'INVALID HEADER')¶
-
classmethod
from_params
(type: str, name: str | None[str, None] = None, eol: str = '\n') → robot.parsing.model.statements.SectionHeader[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
type
¶
-
name
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
LibraryImport
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'LIBRARY'¶
-
classmethod
from_params
(name: str, args: collections.abc.Sequence[str] = (), alias: str | None[str, None] = None, separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.LibraryImport[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
name
¶
-
args
¶
-
alias
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
ResourceImport
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'RESOURCE'¶
-
classmethod
from_params
(name: str, separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.ResourceImport[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
name
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
VariablesImport
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'VARIABLES'¶
-
classmethod
from_params
(name: str, args: collections.abc.Sequence[str] = (), separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.VariablesImport[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
name
¶
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
Documentation
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.DocumentationOrMetadata
-
type
= 'DOCUMENTATION'¶
-
classmethod
from_params
(value: str, indent: str = ' ', separator: str = ' ', eol: str = '\n', settings_section: bool = True) → robot.parsing.model.statements.Documentation[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
value
¶
-
-
class
robot.parsing.model.statements.
Metadata
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.DocumentationOrMetadata
-
type
= 'METADATA'¶
-
classmethod
from_params
(name: str, value: str, separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Metadata[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
name
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
value
¶
-
-
class
robot.parsing.model.statements.
ForceTags
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.MultiValue
-
type
= 'FORCE TAGS'¶
-
classmethod
from_params
(values: collections.abc.Sequence[str], separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.ForceTags[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
DefaultTags
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.MultiValue
-
type
= 'DEFAULT TAGS'¶
-
classmethod
from_params
(values: collections.abc.Sequence[str], separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.DefaultTags[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
KeywordTags
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.MultiValue
-
type
= 'KEYWORD TAGS'¶
-
classmethod
from_params
(values: collections.abc.Sequence[str], separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.KeywordTags[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
SuiteName
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.SingleValue
-
type
= 'SUITE NAME'¶
-
classmethod
from_params
(value: str, separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.SuiteName[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
value
¶
-
-
class
robot.parsing.model.statements.
SuiteSetup
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Fixture
-
type
= 'SUITE SETUP'¶
-
classmethod
from_params
(name: str, args: collections.abc.Sequence[str] = (), separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.SuiteSetup[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
name
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
SuiteTeardown
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Fixture
-
type
= 'SUITE TEARDOWN'¶
-
classmethod
from_params
(name: str, args: collections.abc.Sequence[str] = (), separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.SuiteTeardown[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
name
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
TestSetup
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Fixture
-
type
= 'TEST SETUP'¶
-
classmethod
from_params
(name: str, args: collections.abc.Sequence[str] = (), separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.TestSetup[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
name
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
TestTeardown
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Fixture
-
type
= 'TEST TEARDOWN'¶
-
classmethod
from_params
(name: str, args: collections.abc.Sequence[str] = (), separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.TestTeardown[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
name
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
TestTemplate
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.SingleValue
-
type
= 'TEST TEMPLATE'¶
-
classmethod
from_params
(value: str, separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.TestTemplate[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
value
¶
-
-
class
robot.parsing.model.statements.
TestTimeout
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.SingleValue
-
type
= 'TEST TIMEOUT'¶
-
classmethod
from_params
(value: str, separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.TestTimeout[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
value
¶
-
-
class
robot.parsing.model.statements.
Variable
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'VARIABLE'¶
-
classmethod
from_params
(name: str, value: str | collections.abc.Sequence[str][str, collections.abc.Sequence[str]], separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Variable[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
name
¶
-
value
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
TestCaseName
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'TESTCASE NAME'¶
-
classmethod
from_params
(name: str, eol: str = '\n') → robot.parsing.model.statements.TestCaseName[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
name
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
KeywordName
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'KEYWORD NAME'¶
-
classmethod
from_params
(name: str, eol: str = '\n') → robot.parsing.model.statements.KeywordName[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
name
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
Setup
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Fixture
-
type
= 'SETUP'¶
-
classmethod
from_params
(name: str, args: collections.abc.Sequence[str] = (), indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Setup[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
name
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
Teardown
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Fixture
-
type
= 'TEARDOWN'¶
-
classmethod
from_params
(name: str, args: collections.abc.Sequence[str] = (), indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Teardown[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
name
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
Tags
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.MultiValue
-
type
= 'TAGS'¶
-
classmethod
from_params
(values: collections.abc.Sequence[str], indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Tags[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
Template
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.SingleValue
-
type
= 'TEMPLATE'¶
-
classmethod
from_params
(value: str, indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Template[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
value
¶
-
-
class
robot.parsing.model.statements.
Timeout
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.SingleValue
-
type
= 'TIMEOUT'¶
-
classmethod
from_params
(value: str, indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Timeout[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
value
¶
-
-
class
robot.parsing.model.statements.
Arguments
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.MultiValue
-
type
= 'ARGUMENTS'¶
-
classmethod
from_params
(args: collections.abc.Sequence[str], indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Arguments[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
values
¶
-
-
class
robot.parsing.model.statements.
Return
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.MultiValue
Represents the deprecated
[Return]
setting.In addition to the
[Return]
setting itself, also theReturn
node in the parsing model is deprecated andReturnSetting
(new in Robot Framework 6.1) should be used instead.ReturnStatement
will be renamed toReturn
in Robot Framework 7.0.Eventually
[Return]
andReturnSetting
will be removed altogether.-
type
= 'RETURN'¶
-
classmethod
from_params
(args: collections.abc.Sequence[str], indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Return[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
robot.parsing.model.statements.
ReturnSetting
¶
-
class
robot.parsing.model.statements.
KeywordCall
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'KEYWORD'¶
-
classmethod
from_params
(name: str, assign: collections.abc.Sequence[str] = (), args: collections.abc.Sequence[str] = (), indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.KeywordCall[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
keyword
¶
-
args
¶
-
assign
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
TemplateArguments
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'ARGUMENT'¶
-
classmethod
from_params
(args: collections.abc.Sequence[str], indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.TemplateArguments[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
args
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
ForHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'FOR'¶
-
classmethod
from_params
(variables: collections.abc.Sequence[str], values: collections.abc.Sequence[str], flavor: str = 'IN', indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.ForHeader[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
variables
¶
-
values
¶
-
flavor
¶
-
start
¶
-
mode
¶
-
fill
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
IfElseHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
,abc.ABC
-
condition
¶
-
assign
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(*args, **kwargs) → robot.parsing.model.statements.Statement¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
IfHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.IfElseHeader
-
type
= 'IF'¶
-
classmethod
from_params
(condition: str, indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.IfHeader[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
assign
¶
-
col_offset
¶
-
condition
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
InlineIfHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.IfElseHeader
-
type
= 'INLINE IF'¶
-
classmethod
from_params
(condition: str, assign: collections.abc.Sequence[str] = (), indent: str = ' ', separator: str = ' ') → robot.parsing.model.statements.InlineIfHeader[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
assign
¶
-
col_offset
¶
-
condition
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
ElseIfHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.IfElseHeader
-
type
= 'ELSE IF'¶
-
classmethod
from_params
(condition: str, indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.ElseIfHeader[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
assign
¶
-
col_offset
¶
-
condition
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
ElseHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.IfElseHeader
-
type
= 'ELSE'¶
-
classmethod
from_params
(indent: str = ' ', eol: str = '\n') → robot.parsing.model.statements.ElseHeader[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
assign
¶
-
col_offset
¶
-
condition
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
NoArgumentHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
,abc.ABC
-
classmethod
from_params
(indent: str = ' ', eol: str = '\n')[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
values
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
classmethod
-
class
robot.parsing.model.statements.
TryHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.NoArgumentHeader
-
type
= 'TRY'¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(indent: str = ' ', eol: str = '\n')¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
ExceptHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'EXCEPT'¶
-
classmethod
from_params
(patterns: collections.abc.Sequence[str] = (), type: str | None[str, None] = None, variable: str | None[str, None] = None, indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.ExceptHeader[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
patterns
¶
-
pattern_type
¶
-
variable
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
FinallyHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.NoArgumentHeader
-
type
= 'FINALLY'¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(indent: str = ' ', eol: str = '\n')¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
End
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.NoArgumentHeader
-
type
= 'END'¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(indent: str = ' ', eol: str = '\n')¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
WhileHeader
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'WHILE'¶
-
classmethod
from_params
(condition: str, limit: str | None[str, None] = None, on_limit: str | None[str, None] = None, on_limit_message: str | None[str, None] = None, indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.WhileHeader[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
condition
¶
-
limit
¶
-
on_limit
¶
-
on_limit_message
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
ReturnStatement
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'RETURN STATEMENT'¶
-
values
¶
-
classmethod
from_params
(values: collections.abc.Sequence[str] = (), indent: str = ' ', separator: str = ' ', eol: str = '\n') → robot.parsing.model.statements.ReturnStatement[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
-
class
robot.parsing.model.statements.
LoopControl
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.NoArgumentHeader
,abc.ABC
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(indent: str = ' ', eol: str = '\n')¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
values
¶
-
-
class
robot.parsing.model.statements.
Continue
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.LoopControl
-
type
= 'CONTINUE'¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(indent: str = ' ', eol: str = '\n')¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
Break
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.LoopControl
-
type
= 'BREAK'¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_params
(indent: str = ' ', eol: str = '\n')¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
values
¶
-
-
class
robot.parsing.model.statements.
Comment
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'COMMENT'¶
-
classmethod
from_params
(comment: str, indent: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Comment[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
Config
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'CONFIG'¶
-
classmethod
from_params
(config: str, eol: str = '\n') → robot.parsing.model.statements.Config[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
language
¶
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
Error
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
type
= 'ERROR'¶
-
classmethod
from_params
(error: str, value: str = '', indent: str = ' ', eol: str = '\n') → robot.parsing.model.statements.Error[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
values
¶
-
errors
¶ Errors got from the underlying ``ERROR``token.
Errors can be set also explicitly. When accessing errors, they are returned along with errors got from tokens.
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
-
class
robot.parsing.model.statements.
EmptyLine
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token], errors: collections.abc.Sequence[str] = ())[source]¶ Bases:
robot.parsing.model.statements.Statement
-
col_offset
¶
-
data_tokens
¶
-
end_col_offset
¶
-
end_lineno
¶
-
errors
= ()¶
-
classmethod
from_tokens
(tokens: collections.abc.Sequence[robot.parsing.lexer.tokens.Token]) → robot.parsing.model.statements.Statement¶ Create a statement from given tokens.
Statement type is got automatically from token types.
This classmethod should be called from
Statement
, not from its subclasses. If you know the subclass to use, simply create an instance of it directly.
-
get_option
(name: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a configuration option with the given
name
.If the option has not been used, return
default
.If the option has been used multiple times, values are joined together. This is typically an error situation and validated elsewhere.
New in Robot Framework 6.1.
-
get_token
(*types) → robot.parsing.lexer.tokens.Token | None[robot.parsing.lexer.tokens.Token, None]¶ Return a token with any of the given
types
.If there are no matches, return
None
. If there are multiple matches, return the first match.
-
get_tokens
(*types) → list¶ Return tokens having any of the given
types
.
-
get_value
(type: str, default: str | None[str, None] = None) → str | None[str, None]¶ Return value of a token with the given
type
.If there are no matches, return
default
. If there are multiple matches, return the value of the first match.
-
get_values
(*types) → tuple¶ Return values of tokens having any of the given
types
.
-
handles_types
= ()¶
-
lineno
¶
-
lines
¶
-
classmethod
register
(subcls: Type[T]) → Type[T]¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
statement_handlers
= {'ARGUMENT': <class 'robot.parsing.model.statements.TemplateArguments'>, 'ARGUMENTS': <class 'robot.parsing.model.statements.Arguments'>, 'BREAK': <class 'robot.parsing.model.statements.Break'>, 'COMMENT': <class 'robot.parsing.model.statements.Comment'>, 'COMMENT HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'CONFIG': <class 'robot.parsing.model.statements.Config'>, 'CONTINUE': <class 'robot.parsing.model.statements.Continue'>, 'DEFAULT TAGS': <class 'robot.parsing.model.statements.DefaultTags'>, 'DOCUMENTATION': <class 'robot.parsing.model.statements.Documentation'>, 'ELSE': <class 'robot.parsing.model.statements.ElseHeader'>, 'ELSE IF': <class 'robot.parsing.model.statements.ElseIfHeader'>, 'END': <class 'robot.parsing.model.statements.End'>, 'ERROR': <class 'robot.parsing.model.statements.Error'>, 'EXCEPT': <class 'robot.parsing.model.statements.ExceptHeader'>, 'FINALLY': <class 'robot.parsing.model.statements.FinallyHeader'>, 'FOR': <class 'robot.parsing.model.statements.ForHeader'>, 'FORCE TAGS': <class 'robot.parsing.model.statements.ForceTags'>, 'IF': <class 'robot.parsing.model.statements.IfHeader'>, 'INLINE IF': <class 'robot.parsing.model.statements.InlineIfHeader'>, 'INVALID HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD': <class 'robot.parsing.model.statements.KeywordCall'>, 'KEYWORD HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'KEYWORD NAME': <class 'robot.parsing.model.statements.KeywordName'>, 'KEYWORD TAGS': <class 'robot.parsing.model.statements.KeywordTags'>, 'LIBRARY': <class 'robot.parsing.model.statements.LibraryImport'>, 'METADATA': <class 'robot.parsing.model.statements.Metadata'>, 'RESOURCE': <class 'robot.parsing.model.statements.ResourceImport'>, 'RETURN': <class 'robot.parsing.model.statements.Return'>, 'RETURN STATEMENT': <class 'robot.parsing.model.statements.ReturnStatement'>, 'SETTING HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'SETUP': <class 'robot.parsing.model.statements.Setup'>, 'SUITE NAME': <class 'robot.parsing.model.statements.SuiteName'>, 'SUITE SETUP': <class 'robot.parsing.model.statements.SuiteSetup'>, 'SUITE TEARDOWN': <class 'robot.parsing.model.statements.SuiteTeardown'>, 'TAGS': <class 'robot.parsing.model.statements.Tags'>, 'TASK HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TEARDOWN': <class 'robot.parsing.model.statements.Teardown'>, 'TEMPLATE': <class 'robot.parsing.model.statements.Template'>, 'TEST SETUP': <class 'robot.parsing.model.statements.TestSetup'>, 'TEST TEARDOWN': <class 'robot.parsing.model.statements.TestTeardown'>, 'TEST TEMPLATE': <class 'robot.parsing.model.statements.TestTemplate'>, 'TEST TIMEOUT': <class 'robot.parsing.model.statements.TestTimeout'>, 'TESTCASE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'TESTCASE NAME': <class 'robot.parsing.model.statements.TestCaseName'>, 'TIMEOUT': <class 'robot.parsing.model.statements.Timeout'>, 'TRY': <class 'robot.parsing.model.statements.TryHeader'>, 'VARIABLE': <class 'robot.parsing.model.statements.Variable'>, 'VARIABLE HEADER': <class 'robot.parsing.model.statements.SectionHeader'>, 'VARIABLES': <class 'robot.parsing.model.statements.VariablesImport'>, 'WHILE': <class 'robot.parsing.model.statements.WhileHeader'>}¶
-
validate
(ctx: ValidationContext)¶
-
type
= 'EOL'¶
-
classmethod
from_params
(eol: str = '\n')[source]¶ Create a statement from passed parameters.
Required and optional arguments in general match class properties. Values are used to create matching tokens.
Most implementations support following general properties:
separator
whitespace inserted between each token. Default is four spaces.indent
whitespace inserted before first token. Default is four spaces.eol
end of line sign. Default is'\n'
.
This classmethod should be called from the
Statement
subclass to create, not from theStatement
class itself.
-
robot.parsing.model.visitor module¶
-
class
robot.parsing.model.visitor.
ModelVisitor
[source]¶ Bases:
ast.NodeVisitor
,robot.parsing.model.visitor.VisitorFinder
NodeVisitor that supports matching nodes based on their base classes.
In other ways identical to the standard ast.NodeVisitor, but allows creating
visit_ClassName
methods so that theClassName
is one of the base classes of the node. For example, this visitor method matches allStatement
nodes:def visit_Statement(self, node): ...
-
generic_visit
(node)¶ Called if no explicit visitor function exists for a node.
-
visit_Constant
(node)¶
-
-
class
robot.parsing.model.visitor.
ModelTransformer
[source]¶ Bases:
ast.NodeTransformer
,robot.parsing.model.visitor.VisitorFinder
NodeTransformer that supports matching nodes based on their base classes.
See
ModelVisitor
for explanation how this is different compared to the standard ast.NodeTransformer.-
generic_visit
(node)¶ Called if no explicit visitor function exists for a node.
-
visit_Constant
(node)¶
-