Lexer constructor

Lexer(
  1. String input, {
  2. int spanOffset = 0,
  3. bool paragraphs = false,
  4. bool undoubleBackslashes = false,
})

Creates a lexer over input. spanOffset is added to every span, for lexing macro bodies that do not come from the user's source.

With paragraphs, whitespace holding an empty line is a \par control word, as in TeX. With undoubleBackslashes, every \\ is read as one \ (source whose backslashes were all doubled, as in a JSON string written twice).

Implementation

Lexer(
  this.input, {
  this.spanOffset = 0,
  this.paragraphs = false,
  this.undoubleBackslashes = false,
});