Constructors

Properties

code: CodeFile

The code file being parsed.

currentToken: number = 0
errorCollector: ErrorCollector

The ErrorCollector for this parser. All the errors encountered by the parser will be put there, since it does not throw on non-fatal errors.

tokens: Token[]

The tokens being parsed. They have to be provided from the lexer

[[Lexer.scan]]

Methods

  • Parses an argument list including the finishing paren. Can handle trailing and extra commas as well as an empty arguments list. The initial paren must be consumed.

    Parameters

    • allowPositional: boolean = false

      Set to true when in call mode, positional arguments will be allowed.

    • forceType: null | AssignmentNodeRole = null

    Returns AssignmentNode[]

  • Consumes redundant commas and returns true if it consumed any.

    You can also pass an array of tokens to which all the comma tokens will be pushed.

    Parameters

    • OptionaltrailingArr: Token[]

    Returns boolean

  • Parses arguments from the 'for' loop comprehension. The initial paren must be consumed. Stops on semicolon or right paren, but does not consume them.

    Returns AssignmentNode[]