Skip to content

apollo-parser@0.8.6

Choose a tag to compare

@tninesling tninesling released this 14 May 16:06
· 13 commits to main since this release
e36ca6d

Fixes

  • Correct EOF location reporting for empty input - Abdel-Monaam-Aouini, pull/1021

    When lexing an empty input, the parser reported the EOF token one byte past
    the end of the source. This caused downstream consumers (error reporters,
    span lookups) to point past the file when surfacing diagnostics for empty
    documents. The lexer now reports EOF at the actual end of the input.

Maintenance

  • Use peek_token() instead of peek_data().unwrap() - surajk-m, pull/1028, pull/900

    There were a few places where we called peek() to check an upcoming token's
    kind, and then peek_data().unwrap() to check its value. For example, to
    identify what type of definition is coming up: type, union, or something
    else, like in this code snippet
    here
    .

    The unwrap() call was valid in those cases, but it can be improved. For it
    to continue to be valid, the current token must not change between those
    calls, and this is not statically verifiable. A mistake in a refactor could
    disconnect the peek() and peek_data() calls and the unwrap could panic.

    This change replaces these specific uses of peek_data().unwrap() with
    peek_token().

  • Fix collapsible-match clippy warnings - lrlna, pull/1035