increase property

  1. @Deprecated('Use `during` instead to properly track the indentation state')
Parser<String> increase
latefinal

Parser that increases the indentation.

The parser performs the following actions in sequence:

  1. verifies that the new indentation is deeper than the previous one,
  2. pushes the previous indentation to the stack,
  3. updates the current indentation with the new one, and
  4. returns the new indentation without consuming it.

Prefer using during instead to properly track the indentation state and ensure rollback on parse failure.

Implementation

@Deprecated('Use `during` instead to properly track the indentation state')
late final Parser<String> increase = parser
    .plusString(message: message)
    .where((value) {
      if (value.startsWith(current) && value.length > current.length) {
        stack.add(current);
        current = value;
        return true;
      } else {
        return false;
      }
    })
    .and();