Documentation ¶
Overview ¶
Package parser implements a parser used by the Elk interpreter.
Parser expects a slice of bytes containing Elk source code parses it, registering any encountered errors, and returns an Abstract Syntax Tree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Holds the current state of the parsing process.
func (*Parser) IsIncomplete ¶
Returns true when the parser had finished early because of an END_OF_FILE token.
func (*Parser) Parse ¶
func (p *Parser) Parse() (*ast.ProgramNode, errors.ErrorList)
Start the parsing process from the top.
func (*Parser) ShouldIndent ¶
Returns true when the parser had finished early because of an END_OF_FILE token and the following code should be indented.
Click to show internal directories.
Click to hide internal directories.