Expand description

Contains the StateContext struct and the other structs used to track state in the finite state machine.

Structs

  • Represents an input string and an output string, along with an index into the input string. This is used for running the individual characters of the input through the finite state machine to produce filtered output.
  • Represents being in a block comment.
  • Implementation of the state machine. This maintains the context in which the state machine runs.
  • StateDone 🔒
    Represents being done with input.
  • Represents being inside a double-quote string where filtering is essentially turned off until the end of the string is reached.
  • Represents possibly being at the end of a block comment.
  • Represents being in an escaped character sequence inside a double-quoted string. We don’t do anything with the escaped character other than output it. Handling escaped characters allows us to more accurately detect the end of the string.
  • Represents being in an escaped character sequence inside a single-quoted string. We don’t do anything with the escaped character other than output it. Handling escaped characters allows us to more accurately detect the end of the string.
  • Represents the initial state. Technically, this struct and its implementation is not needed but Rust demands all avenues through code handle all elements of an enum (see StateContext::get_behavior()).
  • Represents being in a line comment.
  • Represents normal text behavior.
  • Represents being inside a single-quoted string where filtering is effectively turned off until the end of the string is reached.
  • Represents the possible start of a line or block comment.