parse

package
v0.3.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2025 License: BSD-3-Clause Imports: 13 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DemoRunner added in v0.1.4

func DemoRunner(userInput io.Reader, userOutput io.Writer) io.Writer

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser stores the state for the ivy parser.

func NewParser

func NewParser(fileName string, scanner *scan.Scanner, context value.Context) *Parser

NewParser returns a new parser that will read from the scanner. The context must have been created by this package's NewContext function.

func (*Parser) Line

func (p *Parser) Line() ([]value.Expr, bool)

Line reads a line of input and returns the values it evaluates. A nil returned slice means there were no values. The boolean reports whether the line is valid.

Line

) special command '\n'
op function definition
expressionList '\n'

func (*Parser) Loc

func (p *Parser) Loc() string

Loc returns the current input location in the form "name:line: ". If the name is <stdin>, it returns the empty string.

func (*Parser) Printf

func (p *Parser) Printf(format string, args ...interface{})

Printf formats the args and writes them to the configured output writer.

func (*Parser) Println

func (p *Parser) Println(args ...interface{})

Println prints the args and writes them to the configured output writer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL