Type MethodSwiftGrammar

parse(_:)

Attempts to parse an instance of Construction from the given parsing input.

static func parse<Diagnostics>(_ input: inout ParsingInput<Diagnostics>) -> [Element.Construction] where Diagnostics : ParsingDiagnostics, Element.Location == Diagnostics.Source.Index, Element.Terminal == Diagnostics.Source.Element

Overview

The implementation is not required to clean up the state of the input upon throwing an error; this is handled by the library.

Implementations should interact with the given ParsingInput by calling its methods and subscripts. Don’t overwrite the inout binding or its mutable stored properties (index and diagnostics) unless you really know what you’re doing.