Schooner.Lexer.Error exception (schooner v1.2.0)

Copy Markdown View Source

Exception raised by the lexer on malformed source.

Each error carries:

  • :reason — a structured term identifying the failure mode (atom or tagged tuple); meant to be machine-matchable in tests
  • :position — {line, column} of the offending input
  • :location — the same position as a Schooner.Location, naming the file when the caller supplied one

:message is derived from :reason and :position, so tests can assert on those fields without coupling to the wording. When the location names a file, the message is file:line:col: followed by the description instead.