precedence

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Example
p := func(s string) *ast.Parser {
	p, _ := ast.New([]byte(s))
	return p
}
fmt.Println(Plus(p("5")))
fmt.Println(Plus(p("5 + 2")))
fmt.Println(Plus(p("5 + 2 * 0")))
Output:

["Plus",[["Mult",[["Value","5"]]]]] <nil>
["Plus",[["Mult",[["Value","5"]]],["Mult",[["Value","2"]]]]] <nil>
["Plus",[["Mult",[["Value","5"]]],["Mult",[["Value","2"],["Value","0"]]]]] <nil>

Index

Examples

Constants

View Source
const SP = ' '

Variables

This section is empty.

Functions

func Mult

func Mult(p *ast.Parser) (*ast.Node, error)

func Plus

func Plus(p *ast.Parser) (*ast.Node, error)

func Rule

func Rule(p *ast.Parser) (*ast.Node, error)

func Value

func Value(p *ast.Parser) (*ast.Node, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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