Skip to content

libsyntax Parser does not allow parsing view items individually #19024

Closed
@murarth

Description

@murarth

Parser method parse_item will unconditionally fail if it encounters a view item (use or extern crate).
This is desired behavior if parsing the body of a function. However, there are no public methods that allow parsing either of these items individually. This makes it impossible to parse the full range of possible input to a REPL.
If it's acceptable, I could make a pull request for public methods parse_use (which already exists, privately) and parse_extern_crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions