query

package
v0.0.0-...-952fa56 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package query implements CSS/jQuery-esque selectors over a PHP AST

Currently, the only supported selectors are:

"node", where node is the type name of an AST node (e.g. EchoStmt)

"parent child", where the descendance may skip levels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Node   ast.Node
	Parent *Node
}

type NodeRule

type NodeRule struct {
	// Type is the node type represented as a string, without the package name. For example: ReturnStmt.
	Type string
}

func (NodeRule) Pass

func (r NodeRule) Pass(n Node) bool

type Q

type Q []Node

func Select

func Select(nodes []ast.Node) Q

func (Q) Select

func (q Q) Select(s string) (Q, error)

type Rule

type Rule interface {
	Pass(n Node) bool
}

type Selector

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

func ParseSelector

func ParseSelector(s string) (*Selector, error)

func (Selector) Pass

func (s Selector) Pass(n Node, local bool) bool

Directories

Path Synopsis
cmd
query command
Command query implements a simple CLI for querying a PHP AST.
Command query implements a simple CLI for querying a PHP AST.

Jump to

Keyboard shortcuts

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