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) 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.

Returns:

Obtained blocks, attributes and conditions.

Raises:

DecodeError – A decode error.

Return type:

LsclContent