Documentation ¶
Overview ¶
Package parser translates the linear stream of tokens into ast structures based on the syntax of the ok language.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { Funcs map[string]*ast.Func Tests []*ast.Test Imports map[string]string Comments []*ast.Comment Tokens []lexer.Token }
File contains the output state of the parser for a single input.
type Parser ¶
type Parser struct { File *File // contains filtered or unexported fields }
func ParseString ¶
ParseString parses source code and returns the AST for the file.
func (*Parser) AppendError ¶ added in v0.13.1
AppendError adds an error to the stack.
func (*Parser) AppendErrorAt ¶ added in v0.13.1
AppendError adds an error to the stack.
func (*Parser) AppendErrorf ¶ added in v0.13.1
AppendErrorf adds an error to the stack.
func (*Parser) AppendFinally ¶ added in v0.15.3
AppendFinally will track finalizers until the function is finished, then it will be reset.
Source Files ¶
- array.go
- assert.go
- assign.go
- assignable.go
- block.go
- call.go
- consume.go
- doc.go
- error.go
- error_scope.go
- expr.go
- file.go
- for.go
- func.go
- group.go
- identifier.go
- if.go
- import.go
- interpolate.go
- key_value.go
- literal.go
- map.go
- parse.go
- parser.go
- raise.go
- return.go
- statement.go
- switch.go
- test.go
- type.go
- unary.go
Click to show internal directories.
Click to hide internal directories.