const eof … const leftDelim … const rightDelim … type Parser … var ErrSyntax … var dictKeyRex … var sliceOperatorRex … // Parse parsed the given text and return a node Parser. // If an error is encountered, parsing stops and an empty // Parser is returned with the error func Parse(name, text string) (*Parser, error) { … } func NewParser(name string) *Parser { … } // parseAction parsed the expression inside delimiter func parseAction(name, text string) (*Parser, error) { … } func (p *Parser) Parse(text string) error { … } // consumeText return the parsed text since last cosumeText func (p *Parser) consumeText() string { … } // next returns the next rune in the input. func (p *Parser) next() rune { … } // peek returns but does not consume the next rune in the input. func (p *Parser) peek() rune { … } // backup steps back one rune. Can only be called once per call of next. func (p *Parser) backup() { … } func (p *Parser) parseText(cur *ListNode) error { … } // parseLeftDelim scans the left delimiter, which is known to be present. func (p *Parser) parseLeftDelim(cur *ListNode) error { … } func (p *Parser) parseInsideAction(cur *ListNode) error { … } // parseRightDelim scans the right delimiter, which is known to be present. func (p *Parser) parseRightDelim(cur *ListNode) error { … } // parseIdentifier scans build-in keywords, like "range" "end" func (p *Parser) parseIdentifier(cur *ListNode) error { … } // parseRecursive scans the recursive descent operator .. func (p *Parser) parseRecursive(cur *ListNode) error { … } // parseNumber scans number func (p *Parser) parseNumber(cur *ListNode) error { … } // parseArray scans array index selection func (p *Parser) parseArray(cur *ListNode) error { … } // parseFilter scans filter inside array selection func (p *Parser) parseFilter(cur *ListNode) error { … } // parseQuote unquotes string inside double or single quote func (p *Parser) parseQuote(cur *ListNode, end rune) error { … } // parseField scans a field until a terminator func (p *Parser) parseField(cur *ListNode) error { … } // advance scans until next non-escaped terminator func (p *Parser) advance() bool { … } // isTerminator reports whether the input is at valid termination character to appear after an identifier. func isTerminator(r rune) bool { … } // isSpace reports whether r is a space character. func isSpace(r rune) bool { … } // isEndOfLine reports whether r is an end-of-line character. func isEndOfLine(r rune) bool { … } // isAlphaNumeric reports whether r is an alphabetic, digit, or underscore. func isAlphaNumeric(r rune) bool { … } // isBool reports whether s is a boolean value. func isBool(s string) bool { … } // UnquoteExtend is almost same as strconv.Unquote(), but it support parse single quotes as a string func UnquoteExtend(s string) (string, error) { … } func contains(s string, c byte) bool { … }