p

package
v0.0.0-...-51ce559 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayItem

func ArrayItem(s string) string

ArrayItem is a reverse function to ArrayType, formating type present in the array.

func ArrayType

func ArrayType(s string) string

ArrayType formats array type name for given type. The convention is simple, it is package name "array" and exported s.

func FirstLower

func FirstLower(s string) string

FirstLower lowercases first letter in s.

func FirstUpper

func FirstUpper(s string) string

FirstUpper uppercases first letter in s.

func IsArray

func IsArray(s string) bool

IsArray checks, if the s is a name suitable for array type.

func NewLabelTranslator

func NewLabelTranslator() *labelTranslator

func NewParser

func NewParser(v, f NameTranslation) *parser

Types

type FileFunc

type FileFunc struct {
	*Func
	// contains filtered or unexported fields
}

func (*FileFunc) Add

func (fn *FileFunc) Add(name string, f *lang.Function, missingArgs int)

Adds a function to the universe so it is recognized when calling the function using Func.Namespace(string).Call(string, []lang.Expression) First argument is a real name of the function. It goes well with the missingArgs argument, goal is to found the correct function. Functions in PHP can have variable amount of arguments.

func (*FileFunc) Namespace

func (f *FileFunc) Namespace(n string) *FunctionCaller

type Func

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

func NewFunc

func NewFunc(gc *lang.GlobalContext) *Func

type FunctionCaller

type FunctionCaller struct {
	Func *map[string][]*lang.Function
	// contains filtered or unexported fields
}

func (*FunctionCaller) Call

func (fc *FunctionCaller) Call(name string, args []lang.Expression) (*lang.FunctionCall, error)

func (*FunctionCaller) NeedsGlobal

func (fc *FunctionCaller) NeedsGlobal(name string)

type NameTranslation

type NameTranslation interface {
	Translate(string) string
}

func NewFunctionTranslator

func NewFunctionTranslator() NameTranslation

func NewNameTranslator

func NewNameTranslator() NameTranslation

Directories

Path Synopsis
Package test brings z7zmey/php-parser nodes to the p package.
Package test brings z7zmey/php-parser nodes to the p package.

Jump to

Keyboard shortcuts

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