Documentation
¶
Overview ¶
Package dsl is the boolean rule-expression engine: lexer, parser (! > && > ||), AST, dive splitting.
Index ¶
- func ContainsDiveToken(input string, isRawArg IsRawArgFunc) bool
- func DefaultIsRawArg(name string) bool
- func HasTopLevelOr(input string, isRawArg IsRawArgFunc) bool
- func RemoveTopLevelLeaves(input string, names map[string]bool, isRawArg IsRawArgFunc) string
- func SplitDive(input string, isRawArg IsRawArgFunc) (container, element string, hasDive bool, err error)
- type And
- type IsRawArgFunc
- type Leaf
- type Node
- type Not
- type Or
- type ParseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsDiveToken ¶
func ContainsDiveToken(input string, isRawArg IsRawArgFunc) bool
ContainsDiveToken reports whether a standalone `dive` leaf appears at any depth.
func DefaultIsRawArg ¶
func HasTopLevelOr ¶
func HasTopLevelOr(input string, isRawArg IsRawArgFunc) bool
HasTopLevelOr reports whether input has a `||` outside parentheses. Lex error yields true: safe to wrap a malformed expr before &&-joining.
func RemoveTopLevelLeaves ¶
func RemoveTopLevelLeaves(input string, names map[string]bool, isRawArg IsRawArgFunc) string
RemoveTopLevelLeaves drops top-level bare-leaf segments whose name (or trimmed source) is in names, re-joining survivors with " && ". Lexer-driven so a separator inside a quoted/raw arg isn't mistaken for structural.
Types ¶
type IsRawArgFunc ¶
IsRawArgFunc reports whether a rule reads its argument raw (one arg, commas literal).
type Node ¶
type Node interface {
// contains filtered or unexported methods
}
Node is a node in a parsed rule expression.
type ParseError ¶
ParseError is a lexing/parsing failure with its position.
func (*ParseError) Error ¶
func (e *ParseError) Error() string