lscl.parser
– LSCL parser definition¶
This file bases itself on the LSCL Grammar. All of the weirdness in the parsing comes from said grammar, in order to reproduce the constraints of the original language without adding too much.
- lscl.parser.parse_lscl(raw: str, /, *, accept_trailing_commas: bool = False, support_escapes: bool = False, field_reference_escape_style: Literal['percent', 'ampersand', 'none'] = 'none') LsclContent ¶
Parse a string as an Logstash Configuration Language block.
- Parameters:
raw (str) – Text to parse as an LSCL block.
accept_trailing_commas (bool) – Whether to accept trailing commas in the input.
support_escapes (bool) – Whether to support escape sequences in strings.
field_reference_escape_style (Literal['percent', 'ampersand', 'none']) – Accepted escaping style in selector elements.
- Returns:
Obtained blocks, attributes and conditions.
- Raises:
DecodeError – A decode error.
- Return type:
LsclContent