influxdb/query/parser/flux.go

8142 lines
244 KiB
Go

package parser
import (
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"math"
"os"
"sort"
"strings"
"unicode"
"unicode/utf8"
)
// DO NOT EDIT: This file is auto generated by the pigeon PEG parser generator.
var g = &grammar{
rules: []*rule{
{
name: "Start",
pos: position{line: 8, col: 1, offset: 102},
expr: &actionExpr{
pos: position{line: 9, col: 5, offset: 112},
run: (*parser).callonStart1,
expr: &seqExpr{
pos: position{line: 9, col: 5, offset: 112},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 9, col: 8, offset: 115},
label: "program",
expr: &ruleRefExpr{
pos: position{line: 9, col: 16, offset: 123},
name: "Program",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&notExpr{
pos: position{line: 489, col: 5, offset: 8991},
expr: &anyMatcher{
line: 489, col: 6, offset: 8992,
},
},
},
},
},
},
{
name: "Program",
pos: position{line: 13, col: 1, offset: 173},
expr: &actionExpr{
pos: position{line: 14, col: 5, offset: 185},
run: (*parser).callonProgram1,
expr: &labeledExpr{
pos: position{line: 14, col: 5, offset: 185},
label: "body",
expr: &ruleRefExpr{
pos: position{line: 14, col: 10, offset: 190},
name: "SourceElements",
},
},
},
},
{
name: "SourceElements",
pos: position{line: 18, col: 1, offset: 256},
expr: &actionExpr{
pos: position{line: 19, col: 5, offset: 275},
run: (*parser).callonSourceElements1,
expr: &seqExpr{
pos: position{line: 19, col: 5, offset: 275},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 19, col: 5, offset: 275},
label: "head",
expr: &ruleRefExpr{
pos: position{line: 19, col: 10, offset: 280},
name: "SourceElement",
},
},
&labeledExpr{
pos: position{line: 19, col: 24, offset: 294},
label: "tail",
expr: &zeroOrMoreExpr{
pos: position{line: 19, col: 29, offset: 299},
expr: &seqExpr{
pos: position{line: 19, col: 30, offset: 300},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 19, col: 33, offset: 303},
name: "SourceElement",
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
},
},
},
},
{
name: "SourceElement",
pos: position{line: 23, col: 1, offset: 365},
expr: &ruleRefExpr{
pos: position{line: 24, col: 5, offset: 383},
name: "Statement",
},
},
{
name: "Statement",
pos: position{line: 26, col: 1, offset: 394},
expr: &choiceExpr{
pos: position{line: 27, col: 5, offset: 408},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 27, col: 5, offset: 408},
name: "VariableStatement",
},
&ruleRefExpr{
pos: position{line: 28, col: 5, offset: 430},
name: "OptionStatement",
},
&ruleRefExpr{
pos: position{line: 29, col: 5, offset: 450},
name: "ReturnStatement",
},
&ruleRefExpr{
pos: position{line: 30, col: 5, offset: 470},
name: "ExpressionStatement",
},
&ruleRefExpr{
pos: position{line: 31, col: 5, offset: 494},
name: "BlockStatement",
},
},
},
},
{
name: "OptionStatement",
pos: position{line: 34, col: 1, offset: 511},
expr: &actionExpr{
pos: position{line: 35, col: 5, offset: 531},
run: (*parser).callonOptionStatement1,
expr: &seqExpr{
pos: position{line: 35, col: 5, offset: 531},
exprs: []interface{}{
&litMatcher{
pos: position{line: 35, col: 5, offset: 531},
val: "option",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 35, col: 17, offset: 543},
label: "id",
expr: &actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonOptionStatement13,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 35, col: 34, offset: 560},
val: "=",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 35, col: 41, offset: 567},
label: "expr",
expr: &ruleRefExpr{
pos: position{line: 35, col: 46, offset: 572},
name: "Expr",
},
},
},
},
},
},
{
name: "VariableStatement",
pos: position{line: 39, col: 1, offset: 631},
expr: &actionExpr{
pos: position{line: 40, col: 5, offset: 653},
run: (*parser).callonVariableStatement1,
expr: &labeledExpr{
pos: position{line: 40, col: 5, offset: 653},
label: "declaration",
expr: &ruleRefExpr{
pos: position{line: 40, col: 17, offset: 665},
name: "VariableDeclaration",
},
},
},
},
{
name: "ReturnStatement",
pos: position{line: 44, col: 1, offset: 744},
expr: &actionExpr{
pos: position{line: 45, col: 5, offset: 764},
run: (*parser).callonReturnStatement1,
expr: &seqExpr{
pos: position{line: 45, col: 5, offset: 764},
exprs: []interface{}{
&litMatcher{
pos: position{line: 45, col: 5, offset: 764},
val: "return",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 45, col: 17, offset: 776},
label: "argument",
expr: &ruleRefExpr{
pos: position{line: 45, col: 26, offset: 785},
name: "Expr",
},
},
},
},
},
},
{
name: "ExpressionStatement",
pos: position{line: 49, col: 1, offset: 848},
expr: &actionExpr{
pos: position{line: 50, col: 5, offset: 872},
run: (*parser).callonExpressionStatement1,
expr: &labeledExpr{
pos: position{line: 50, col: 5, offset: 872},
label: "expr",
expr: &ruleRefExpr{
pos: position{line: 50, col: 10, offset: 877},
name: "Expr",
},
},
},
},
{
name: "BlockStatement",
pos: position{line: 54, col: 1, offset: 936},
expr: &actionExpr{
pos: position{line: 55, col: 5, offset: 955},
run: (*parser).callonBlockStatement1,
expr: &seqExpr{
pos: position{line: 55, col: 5, offset: 955},
exprs: []interface{}{
&litMatcher{
pos: position{line: 55, col: 5, offset: 955},
val: "{",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 55, col: 12, offset: 962},
label: "body",
expr: &zeroOrMoreExpr{
pos: position{line: 55, col: 17, offset: 967},
expr: &seqExpr{
pos: position{line: 55, col: 19, offset: 969},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 55, col: 22, offset: 972},
name: "Statement",
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 55, col: 41, offset: 991},
val: "}",
ignoreCase: false,
},
},
},
},
},
{
name: "VariableDeclaration",
pos: position{line: 59, col: 1, offset: 1048},
expr: &actionExpr{
pos: position{line: 60, col: 5, offset: 1072},
run: (*parser).callonVariableDeclaration1,
expr: &seqExpr{
pos: position{line: 60, col: 5, offset: 1072},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 60, col: 5, offset: 1072},
label: "id",
expr: &actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonVariableDeclaration4,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 60, col: 22, offset: 1089},
val: "=",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 60, col: 29, offset: 1096},
label: "init",
expr: &ruleRefExpr{
pos: position{line: 60, col: 34, offset: 1101},
name: "Expr",
},
},
},
},
},
},
{
name: "MemberExpressions",
pos: position{line: 65, col: 1, offset: 1162},
expr: &actionExpr{
pos: position{line: 66, col: 5, offset: 1184},
run: (*parser).callonMemberExpressions1,
expr: &seqExpr{
pos: position{line: 66, col: 5, offset: 1184},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 66, col: 5, offset: 1184},
label: "head",
expr: &actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonMemberExpressions4,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 67, col: 5, offset: 1231},
label: "tail",
expr: &zeroOrMoreExpr{
pos: position{line: 67, col: 10, offset: 1236},
expr: &actionExpr{
pos: position{line: 68, col: 10, offset: 1247},
run: (*parser).callonMemberExpressions11,
expr: &seqExpr{
pos: position{line: 68, col: 10, offset: 1247},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 68, col: 13, offset: 1250},
label: "property",
expr: &ruleRefExpr{
pos: position{line: 68, col: 22, offset: 1259},
name: "MemberExpressionProperty",
},
},
},
},
},
},
},
},
},
},
},
{
name: "MemberExpressionProperty",
pos: position{line: 76, col: 1, offset: 1399},
expr: &choiceExpr{
pos: position{line: 77, col: 5, offset: 1428},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 77, col: 5, offset: 1428},
run: (*parser).callonMemberExpressionProperty2,
expr: &seqExpr{
pos: position{line: 77, col: 5, offset: 1428},
exprs: []interface{}{
&litMatcher{
pos: position{line: 77, col: 5, offset: 1428},
val: ".",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 77, col: 12, offset: 1435},
label: "property",
expr: &actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonMemberExpressionProperty14,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 80, col: 7, offset: 1496},
run: (*parser).callonMemberExpressionProperty19,
expr: &seqExpr{
pos: position{line: 80, col: 7, offset: 1496},
exprs: []interface{}{
&litMatcher{
pos: position{line: 80, col: 7, offset: 1496},
val: "[",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 80, col: 14, offset: 1503},
label: "property",
expr: &ruleRefExpr{
pos: position{line: 80, col: 23, offset: 1512},
name: "Primary",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 80, col: 34, offset: 1523},
val: "]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
},
},
{
name: "CallExpression",
pos: position{line: 84, col: 1, offset: 1566},
expr: &actionExpr{
pos: position{line: 85, col: 5, offset: 1585},
run: (*parser).callonCallExpression1,
expr: &seqExpr{
pos: position{line: 85, col: 5, offset: 1585},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 85, col: 5, offset: 1585},
label: "head",
expr: &actionExpr{
pos: position{line: 86, col: 7, offset: 1598},
run: (*parser).callonCallExpression4,
expr: &seqExpr{
pos: position{line: 86, col: 7, offset: 1598},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 86, col: 7, offset: 1598},
label: "callee",
expr: &ruleRefExpr{
pos: position{line: 86, col: 14, offset: 1605},
name: "MemberExpressions",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 86, col: 35, offset: 1626},
label: "args",
expr: &ruleRefExpr{
pos: position{line: 86, col: 40, offset: 1631},
name: "Arguments",
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 90, col: 5, offset: 1714},
label: "tail",
expr: &zeroOrMoreExpr{
pos: position{line: 90, col: 10, offset: 1719},
expr: &choiceExpr{
pos: position{line: 91, col: 9, offset: 1729},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 91, col: 9, offset: 1729},
run: (*parser).callonCallExpression21,
expr: &seqExpr{
pos: position{line: 91, col: 9, offset: 1729},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 91, col: 12, offset: 1732},
label: "args",
expr: &ruleRefExpr{
pos: position{line: 91, col: 17, offset: 1737},
name: "Arguments",
},
},
},
},
},
&actionExpr{
pos: position{line: 94, col: 10, offset: 1820},
run: (*parser).callonCallExpression33,
expr: &seqExpr{
pos: position{line: 94, col: 10, offset: 1820},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 94, col: 13, offset: 1823},
label: "property",
expr: &ruleRefExpr{
pos: position{line: 94, col: 22, offset: 1832},
name: "MemberExpressionProperty",
},
},
},
},
},
},
},
},
},
},
},
},
},
{
name: "PipeExpression",
pos: position{line: 102, col: 1, offset: 1997},
expr: &actionExpr{
pos: position{line: 103, col: 5, offset: 2016},
run: (*parser).callonPipeExpression1,
expr: &seqExpr{
pos: position{line: 103, col: 5, offset: 2016},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 103, col: 5, offset: 2016},
label: "head",
expr: &ruleRefExpr{
pos: position{line: 103, col: 10, offset: 2021},
name: "PipeExpressionHead",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 103, col: 32, offset: 2043},
label: "tail",
expr: &oneOrMoreExpr{
pos: position{line: 103, col: 37, offset: 2048},
expr: &seqExpr{
pos: position{line: 103, col: 38, offset: 2049},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 103, col: 41, offset: 2052},
name: "PipeExpressionPipe",
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
},
},
},
},
{
name: "PipeExpressionHead",
pos: position{line: 107, col: 1, offset: 2135},
expr: &choiceExpr{
pos: position{line: 108, col: 5, offset: 2158},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 108, col: 5, offset: 2158},
name: "CallExpression",
},
&actionExpr{
pos: position{line: 384, col: 5, offset: 7263},
run: (*parser).callonPipeExpressionHead3,
expr: &seqExpr{
pos: position{line: 384, col: 7, offset: 7265},
exprs: []interface{}{
&litMatcher{
pos: position{line: 384, col: 7, offset: 7265},
val: "\"",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 384, col: 11, offset: 7269},
expr: &choiceExpr{
pos: position{line: 392, col: 5, offset: 7478},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 392, col: 5, offset: 7478},
exprs: []interface{}{
&notExpr{
pos: position{line: 392, col: 5, offset: 7478},
expr: &charClassMatcher{
pos: position{line: 392, col: 8, offset: 7481},
val: "[\"\\\\\\n]",
chars: []rune{'"', '\\', '\n'},
ignoreCase: false,
inverted: false,
},
},
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
},
},
&seqExpr{
pos: position{line: 393, col: 5, offset: 7515},
exprs: []interface{}{
&litMatcher{
pos: position{line: 393, col: 5, offset: 7515},
val: "\\",
ignoreCase: false,
},
&choiceExpr{
pos: position{line: 396, col: 5, offset: 7563},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 396, col: 5, offset: 7563},
val: "\"",
ignoreCase: false,
},
&actionExpr{
pos: position{line: 397, col: 5, offset: 7571},
run: (*parser).callonPipeExpressionHead16,
expr: &choiceExpr{
pos: position{line: 397, col: 7, offset: 7573},
alternatives: []interface{}{
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
&notExpr{
pos: position{line: 489, col: 5, offset: 8991},
expr: &anyMatcher{
line: 489, col: 6, offset: 8992,
},
},
},
},
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 384, col: 29, offset: 7287},
val: "\"",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 387, col: 5, offset: 7347},
run: (*parser).callonPipeExpressionHead23,
expr: &seqExpr{
pos: position{line: 387, col: 7, offset: 7349},
exprs: []interface{}{
&litMatcher{
pos: position{line: 387, col: 7, offset: 7349},
val: "\"",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 387, col: 11, offset: 7353},
expr: &choiceExpr{
pos: position{line: 392, col: 5, offset: 7478},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 392, col: 5, offset: 7478},
exprs: []interface{}{
&notExpr{
pos: position{line: 392, col: 5, offset: 7478},
expr: &charClassMatcher{
pos: position{line: 392, col: 8, offset: 7481},
val: "[\"\\\\\\n]",
chars: []rune{'"', '\\', '\n'},
ignoreCase: false,
inverted: false,
},
},
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
},
},
&seqExpr{
pos: position{line: 393, col: 5, offset: 7515},
exprs: []interface{}{
&litMatcher{
pos: position{line: 393, col: 5, offset: 7515},
val: "\\",
ignoreCase: false,
},
&choiceExpr{
pos: position{line: 396, col: 5, offset: 7563},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 396, col: 5, offset: 7563},
val: "\"",
ignoreCase: false,
},
&actionExpr{
pos: position{line: 397, col: 5, offset: 7571},
run: (*parser).callonPipeExpressionHead36,
expr: &choiceExpr{
pos: position{line: 397, col: 7, offset: 7573},
alternatives: []interface{}{
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
&notExpr{
pos: position{line: 489, col: 5, offset: 8991},
expr: &anyMatcher{
line: 489, col: 6, offset: 8992,
},
},
},
},
},
},
},
},
},
},
},
},
&choiceExpr{
pos: position{line: 387, col: 31, offset: 7373},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
&notExpr{
pos: position{line: 489, col: 5, offset: 8991},
expr: &anyMatcher{
line: 489, col: 6, offset: 8992,
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 432, col: 5, offset: 8181},
run: (*parser).callonPipeExpressionHead46,
expr: &seqExpr{
pos: position{line: 432, col: 5, offset: 8181},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 432, col: 8, offset: 8184},
val: "true",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 435, col: 5, offset: 8255},
run: (*parser).callonPipeExpressionHead65,
expr: &seqExpr{
pos: position{line: 435, col: 5, offset: 8255},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 435, col: 8, offset: 8258},
val: "false",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 403, col: 5, offset: 7683},
run: (*parser).callonPipeExpressionHead84,
expr: &seqExpr{
pos: position{line: 403, col: 5, offset: 7683},
exprs: []interface{}{
&litMatcher{
pos: position{line: 403, col: 5, offset: 7683},
val: "/",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 403, col: 9, offset: 7687},
label: "pattern",
expr: &actionExpr{
pos: position{line: 408, col: 5, offset: 7764},
run: (*parser).callonPipeExpressionHead88,
expr: &labeledExpr{
pos: position{line: 408, col: 5, offset: 7764},
label: "chars",
expr: &oneOrMoreExpr{
pos: position{line: 408, col: 11, offset: 7770},
expr: &choiceExpr{
pos: position{line: 413, col: 5, offset: 7854},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 413, col: 5, offset: 7854},
run: (*parser).callonPipeExpressionHead92,
expr: &seqExpr{
pos: position{line: 413, col: 5, offset: 7854},
exprs: []interface{}{
&notExpr{
pos: position{line: 413, col: 5, offset: 7854},
expr: &charClassMatcher{
pos: position{line: 413, col: 6, offset: 7855},
val: "[\\\\/]",
chars: []rune{'\\', '/'},
ignoreCase: false,
inverted: false,
},
},
&labeledExpr{
pos: position{line: 413, col: 12, offset: 7861},
label: "re",
expr: &actionExpr{
pos: position{line: 427, col: 5, offset: 8101},
run: (*parser).callonPipeExpressionHead97,
expr: &seqExpr{
pos: position{line: 427, col: 5, offset: 8101},
exprs: []interface{}{
&notExpr{
pos: position{line: 427, col: 5, offset: 8101},
expr: &charClassMatcher{
pos: position{line: 483, col: 5, offset: 8961},
val: "[\\n\\r]",
chars: []rune{'\n', '\r'},
ignoreCase: false,
inverted: false,
},
},
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 419, col: 5, offset: 7970},
run: (*parser).callonPipeExpressionHead102,
expr: &litMatcher{
pos: position{line: 419, col: 5, offset: 7970},
val: "\\/",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 422, col: 5, offset: 8018},
run: (*parser).callonPipeExpressionHead104,
expr: &seqExpr{
pos: position{line: 422, col: 5, offset: 8018},
exprs: []interface{}{
&litMatcher{
pos: position{line: 422, col: 5, offset: 8018},
val: "\\",
ignoreCase: false,
},
&actionExpr{
pos: position{line: 427, col: 5, offset: 8101},
run: (*parser).callonPipeExpressionHead107,
expr: &seqExpr{
pos: position{line: 427, col: 5, offset: 8101},
exprs: []interface{}{
&notExpr{
pos: position{line: 427, col: 5, offset: 8101},
expr: &charClassMatcher{
pos: position{line: 483, col: 5, offset: 8961},
val: "[\\n\\r]",
chars: []rune{'\n', '\r'},
ignoreCase: false,
inverted: false,
},
},
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
},
},
},
},
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 403, col: 28, offset: 7706},
val: "/",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 459, col: 5, offset: 8592},
run: (*parser).callonPipeExpressionHead113,
expr: &litMatcher{
pos: position{line: 459, col: 5, offset: 8592},
val: "<-",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 379, col: 5, offset: 7176},
run: (*parser).callonPipeExpressionHead115,
expr: &oneOrMoreExpr{
pos: position{line: 379, col: 5, offset: 7176},
expr: &seqExpr{
pos: position{line: 376, col: 5, offset: 7133},
exprs: []interface{}{
&choiceExpr{
pos: position{line: 445, col: 6, offset: 8428},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 445, col: 6, offset: 8428},
val: "0",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 445, col: 12, offset: 8434},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 453, col: 5, offset: 8552},
val: "[1-9]",
ranges: []rune{'1', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 445, col: 25, offset: 8447},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&choiceExpr{
pos: position{line: 367, col: 9, offset: 6983},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 348, col: 5, offset: 6816},
val: "ns",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 351, col: 6, offset: 6844},
val: "us",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 351, col: 13, offset: 6851},
val: "µs",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 351, col: 20, offset: 6859},
val: "μs",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 354, col: 5, offset: 6888},
val: "ms",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 357, col: 5, offset: 6910},
val: "[smh]",
chars: []rune{'s', 'm', 'h'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 343, col: 5, offset: 6728},
run: (*parser).callonPipeExpressionHead131,
expr: &seqExpr{
pos: position{line: 343, col: 5, offset: 6728},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 337, col: 18, offset: 6643},
val: "-",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 337, col: 32, offset: 6657},
val: "-",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 343, col: 14, offset: 6737},
val: "T",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 334, col: 14, offset: 6573},
val: ":",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 334, col: 29, offset: 6588},
val: ":",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrOneExpr{
pos: position{line: 334, col: 44, offset: 6603},
expr: &seqExpr{
pos: position{line: 325, col: 5, offset: 6443},
exprs: []interface{}{
&litMatcher{
pos: position{line: 325, col: 5, offset: 6443},
val: ".",
ignoreCase: false,
},
&oneOrMoreExpr{
pos: position{line: 325, col: 9, offset: 6447},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
&choiceExpr{
pos: position{line: 331, col: 6, offset: 6526},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 331, col: 6, offset: 6526},
val: "Z",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 328, col: 5, offset: 6473},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 328, col: 6, offset: 6474},
val: "[+-]",
chars: []rune{'+', '-'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 328, col: 26, offset: 6494},
val: ":",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 440, col: 5, offset: 8346},
run: (*parser).callonPipeExpressionHead166,
expr: &seqExpr{
pos: position{line: 440, col: 5, offset: 8346},
exprs: []interface{}{
&choiceExpr{
pos: position{line: 445, col: 6, offset: 8428},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 445, col: 6, offset: 8428},
val: "0",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 445, col: 12, offset: 8434},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 453, col: 5, offset: 8552},
val: "[1-9]",
ranges: []rune{'1', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 445, col: 25, offset: 8447},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 440, col: 13, offset: 8354},
val: ".",
ignoreCase: false,
},
&oneOrMoreExpr{
pos: position{line: 440, col: 17, offset: 8358},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
&actionExpr{
pos: position{line: 448, col: 5, offset: 8475},
run: (*parser).callonPipeExpressionHead177,
expr: &choiceExpr{
pos: position{line: 445, col: 6, offset: 8428},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 445, col: 6, offset: 8428},
val: "0",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 445, col: 12, offset: 8434},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 453, col: 5, offset: 8552},
val: "[1-9]",
ranges: []rune{'1', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 445, col: 25, offset: 8447},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 110, col: 5, offset: 2311},
name: "Array",
},
&ruleRefExpr{
pos: position{line: 111, col: 5, offset: 2321},
name: "MemberExpressions",
},
&actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonPipeExpressionHead186,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 113, col: 5, offset: 2358},
name: "ObjectExpression",
},
&ruleRefExpr{
pos: position{line: 114, col: 5, offset: 2379},
name: "ArrowFunctionExpression",
},
&ruleRefExpr{
pos: position{line: 115, col: 5, offset: 2407},
name: "Parens",
},
},
},
},
{
name: "PipeExpressionPipe",
pos: position{line: 117, col: 1, offset: 2415},
expr: &actionExpr{
pos: position{line: 118, col: 5, offset: 2438},
run: (*parser).callonPipeExpressionPipe1,
expr: &seqExpr{
pos: position{line: 118, col: 5, offset: 2438},
exprs: []interface{}{
&litMatcher{
pos: position{line: 118, col: 5, offset: 2438},
val: "|>",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 118, col: 13, offset: 2446},
label: "call",
expr: &ruleRefExpr{
pos: position{line: 118, col: 18, offset: 2451},
name: "CallExpression",
},
},
},
},
},
},
{
name: "Arguments",
pos: position{line: 122, col: 1, offset: 2528},
expr: &actionExpr{
pos: position{line: 123, col: 5, offset: 2542},
run: (*parser).callonArguments1,
expr: &seqExpr{
pos: position{line: 123, col: 5, offset: 2542},
exprs: []interface{}{
&litMatcher{
pos: position{line: 123, col: 5, offset: 2542},
val: "(",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 123, col: 12, offset: 2549},
label: "args",
expr: &zeroOrOneExpr{
pos: position{line: 123, col: 17, offset: 2554},
expr: &ruleRefExpr{
pos: position{line: 123, col: 18, offset: 2555},
name: "ObjectProperties",
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 123, col: 40, offset: 2577},
val: ")",
ignoreCase: false,
},
},
},
},
},
{
name: "ArrowFunctionExpression",
pos: position{line: 127, col: 1, offset: 2613},
expr: &actionExpr{
pos: position{line: 128, col: 5, offset: 2641},
run: (*parser).callonArrowFunctionExpression1,
expr: &seqExpr{
pos: position{line: 128, col: 5, offset: 2641},
exprs: []interface{}{
&litMatcher{
pos: position{line: 128, col: 5, offset: 2641},
val: "(",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 128, col: 12, offset: 2648},
label: "params",
expr: &zeroOrOneExpr{
pos: position{line: 128, col: 19, offset: 2655},
expr: &ruleRefExpr{
pos: position{line: 128, col: 19, offset: 2655},
name: "ArrowFunctionParams",
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 128, col: 43, offset: 2679},
val: ")",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 128, col: 50, offset: 2686},
val: "=>",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 128, col: 58, offset: 2694},
label: "body",
expr: &ruleRefExpr{
pos: position{line: 128, col: 63, offset: 2699},
name: "ArrowFunctionBody",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
{
name: "ArrowFunctionParams",
pos: position{line: 132, col: 1, offset: 2786},
expr: &actionExpr{
pos: position{line: 133, col: 5, offset: 2810},
run: (*parser).callonArrowFunctionParams1,
expr: &seqExpr{
pos: position{line: 133, col: 5, offset: 2810},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 133, col: 5, offset: 2810},
label: "first",
expr: &ruleRefExpr{
pos: position{line: 133, col: 11, offset: 2816},
name: "ArrowFunctionParam",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 133, col: 33, offset: 2838},
label: "rest",
expr: &zeroOrMoreExpr{
pos: position{line: 133, col: 38, offset: 2843},
expr: &ruleRefExpr{
pos: position{line: 133, col: 38, offset: 2843},
name: "ArrowFunctionParamsRest",
},
},
},
&zeroOrOneExpr{
pos: position{line: 133, col: 63, offset: 2868},
expr: &litMatcher{
pos: position{line: 133, col: 63, offset: 2868},
val: ",",
ignoreCase: false,
},
},
},
},
},
},
{
name: "ArrowFunctionParamsRest",
pos: position{line: 137, col: 1, offset: 2953},
expr: &actionExpr{
pos: position{line: 138, col: 5, offset: 2981},
run: (*parser).callonArrowFunctionParamsRest1,
expr: &seqExpr{
pos: position{line: 138, col: 5, offset: 2981},
exprs: []interface{}{
&litMatcher{
pos: position{line: 138, col: 5, offset: 2981},
val: ",",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 138, col: 13, offset: 2989},
label: "arg",
expr: &ruleRefExpr{
pos: position{line: 138, col: 17, offset: 2993},
name: "ArrowFunctionParam",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
{
name: "ArrowFunctionParam",
pos: position{line: 142, col: 1, offset: 3046},
expr: &choiceExpr{
pos: position{line: 143, col: 5, offset: 3069},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 143, col: 5, offset: 3069},
run: (*parser).callonArrowFunctionParam2,
expr: &seqExpr{
pos: position{line: 143, col: 5, offset: 3069},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 143, col: 5, offset: 3069},
label: "key",
expr: &actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonArrowFunctionParam5,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 143, col: 23, offset: 3087},
val: "=",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 143, col: 30, offset: 3094},
label: "value",
expr: &ruleRefExpr{
pos: position{line: 143, col: 36, offset: 3100},
name: "Primary",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 146, col: 5, offset: 3173},
run: (*parser).callonArrowFunctionParam37,
expr: &seqExpr{
pos: position{line: 146, col: 5, offset: 3173},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 146, col: 5, offset: 3173},
label: "key",
expr: &actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonArrowFunctionParam40,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
},
},
{
name: "ArrowFunctionBody",
pos: position{line: 151, col: 1, offset: 3249},
expr: &choiceExpr{
pos: position{line: 152, col: 5, offset: 3271},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 152, col: 5, offset: 3271},
run: (*parser).callonArrowFunctionBody2,
expr: &labeledExpr{
pos: position{line: 152, col: 5, offset: 3271},
label: "body",
expr: &ruleRefExpr{
pos: position{line: 152, col: 10, offset: 3276},
name: "Expr",
},
},
},
&actionExpr{
pos: position{line: 155, col: 5, offset: 3316},
run: (*parser).callonArrowFunctionBody5,
expr: &labeledExpr{
pos: position{line: 155, col: 5, offset: 3316},
label: "body",
expr: &ruleRefExpr{
pos: position{line: 155, col: 10, offset: 3321},
name: "BlockStatement",
},
},
},
},
},
},
{
name: "ObjectExpression",
pos: position{line: 159, col: 1, offset: 3364},
expr: &actionExpr{
pos: position{line: 160, col: 5, offset: 3385},
run: (*parser).callonObjectExpression1,
expr: &seqExpr{
pos: position{line: 160, col: 5, offset: 3385},
exprs: []interface{}{
&litMatcher{
pos: position{line: 160, col: 5, offset: 3385},
val: "{",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 160, col: 12, offset: 3392},
label: "object",
expr: &zeroOrOneExpr{
pos: position{line: 160, col: 19, offset: 3399},
expr: &ruleRefExpr{
pos: position{line: 160, col: 20, offset: 3400},
name: "ObjectProperties",
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 160, col: 42, offset: 3422},
val: "}",
ignoreCase: false,
},
},
},
},
},
{
name: "ObjectProperties",
pos: position{line: 164, col: 1, offset: 3456},
expr: &actionExpr{
pos: position{line: 165, col: 5, offset: 3477},
run: (*parser).callonObjectProperties1,
expr: &seqExpr{
pos: position{line: 165, col: 5, offset: 3477},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 165, col: 5, offset: 3477},
label: "first",
expr: &ruleRefExpr{
pos: position{line: 165, col: 11, offset: 3483},
name: "Property",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 165, col: 23, offset: 3495},
label: "rest",
expr: &zeroOrMoreExpr{
pos: position{line: 165, col: 28, offset: 3500},
expr: &ruleRefExpr{
pos: position{line: 165, col: 28, offset: 3500},
name: "PropertiesRest",
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&zeroOrOneExpr{
pos: position{line: 165, col: 47, offset: 3519},
expr: &litMatcher{
pos: position{line: 165, col: 47, offset: 3519},
val: ",",
ignoreCase: false,
},
},
},
},
},
},
{
name: "PropertiesRest",
pos: position{line: 169, col: 1, offset: 3585},
expr: &actionExpr{
pos: position{line: 170, col: 5, offset: 3604},
run: (*parser).callonPropertiesRest1,
expr: &seqExpr{
pos: position{line: 170, col: 5, offset: 3604},
exprs: []interface{}{
&litMatcher{
pos: position{line: 170, col: 5, offset: 3604},
val: ",",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 170, col: 13, offset: 3612},
label: "arg",
expr: &ruleRefExpr{
pos: position{line: 170, col: 17, offset: 3616},
name: "Property",
},
},
},
},
},
},
{
name: "Property",
pos: position{line: 174, col: 1, offset: 3656},
expr: &actionExpr{
pos: position{line: 175, col: 5, offset: 3669},
run: (*parser).callonProperty1,
expr: &seqExpr{
pos: position{line: 175, col: 5, offset: 3669},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 175, col: 5, offset: 3669},
label: "key",
expr: &actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonProperty4,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 175, col: 24, offset: 3688},
val: ":",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 175, col: 31, offset: 3695},
label: "value",
expr: &ruleRefExpr{
pos: position{line: 175, col: 37, offset: 3701},
name: "Expr",
},
},
},
},
},
},
{
name: "Expr",
pos: position{line: 186, col: 1, offset: 3951},
expr: &ruleRefExpr{
pos: position{line: 187, col: 5, offset: 3960},
name: "LogicalExpression",
},
},
{
name: "LogicalExpression",
pos: position{line: 194, col: 1, offset: 4061},
expr: &actionExpr{
pos: position{line: 195, col: 5, offset: 4083},
run: (*parser).callonLogicalExpression1,
expr: &seqExpr{
pos: position{line: 195, col: 5, offset: 4083},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 195, col: 5, offset: 4083},
label: "head",
expr: &ruleRefExpr{
pos: position{line: 195, col: 10, offset: 4088},
name: "Equality",
},
},
&labeledExpr{
pos: position{line: 195, col: 19, offset: 4097},
label: "tail",
expr: &zeroOrMoreExpr{
pos: position{line: 195, col: 24, offset: 4102},
expr: &seqExpr{
pos: position{line: 195, col: 26, offset: 4104},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&actionExpr{
pos: position{line: 190, col: 5, offset: 4000},
run: (*parser).callonLogicalExpression16,
expr: &choiceExpr{
pos: position{line: 190, col: 6, offset: 4001},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 190, col: 6, offset: 4001},
val: "or",
ignoreCase: true,
},
&litMatcher{
pos: position{line: 190, col: 14, offset: 4009},
val: "and",
ignoreCase: true,
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 195, col: 51, offset: 4129},
name: "Equality",
},
},
},
},
},
},
},
},
},
{
name: "Equality",
pos: position{line: 204, col: 1, offset: 4297},
expr: &actionExpr{
pos: position{line: 205, col: 5, offset: 4310},
run: (*parser).callonEquality1,
expr: &seqExpr{
pos: position{line: 205, col: 5, offset: 4310},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 205, col: 5, offset: 4310},
label: "head",
expr: &ruleRefExpr{
pos: position{line: 205, col: 10, offset: 4315},
name: "Relational",
},
},
&labeledExpr{
pos: position{line: 205, col: 21, offset: 4326},
label: "tail",
expr: &zeroOrMoreExpr{
pos: position{line: 205, col: 26, offset: 4331},
expr: &seqExpr{
pos: position{line: 205, col: 28, offset: 4333},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&actionExpr{
pos: position{line: 200, col: 5, offset: 4230},
run: (*parser).callonEquality16,
expr: &choiceExpr{
pos: position{line: 200, col: 6, offset: 4231},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 200, col: 6, offset: 4231},
val: "==",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 200, col: 13, offset: 4238},
val: "!=",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 200, col: 20, offset: 4245},
val: "=~",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 200, col: 27, offset: 4252},
val: "!~",
ignoreCase: false,
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 205, col: 52, offset: 4357},
name: "Relational",
},
},
},
},
},
},
},
},
},
{
name: "Relational",
pos: position{line: 222, col: 1, offset: 4630},
expr: &actionExpr{
pos: position{line: 223, col: 5, offset: 4645},
run: (*parser).callonRelational1,
expr: &seqExpr{
pos: position{line: 223, col: 5, offset: 4645},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 223, col: 5, offset: 4645},
label: "head",
expr: &ruleRefExpr{
pos: position{line: 223, col: 10, offset: 4650},
name: "Additive",
},
},
&labeledExpr{
pos: position{line: 223, col: 19, offset: 4659},
label: "tail",
expr: &zeroOrMoreExpr{
pos: position{line: 223, col: 24, offset: 4664},
expr: &seqExpr{
pos: position{line: 223, col: 26, offset: 4666},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&actionExpr{
pos: position{line: 210, col: 5, offset: 4461},
run: (*parser).callonRelational16,
expr: &choiceExpr{
pos: position{line: 210, col: 9, offset: 4465},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 210, col: 9, offset: 4465},
val: "<=",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 211, col: 9, offset: 4478},
val: "<",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 212, col: 9, offset: 4490},
val: ">=",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 213, col: 9, offset: 4503},
val: ">",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 214, col: 9, offset: 4515},
val: "startswith",
ignoreCase: true,
},
&litMatcher{
pos: position{line: 215, col: 9, offset: 4537},
val: "in",
ignoreCase: true,
},
&litMatcher{
pos: position{line: 216, col: 9, offset: 4551},
val: "not empty",
ignoreCase: true,
},
&litMatcher{
pos: position{line: 217, col: 9, offset: 4572},
val: "empty",
ignoreCase: true,
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 223, col: 52, offset: 4692},
name: "Additive",
},
},
},
},
},
},
},
},
},
{
name: "Additive",
pos: position{line: 232, col: 1, offset: 4846},
expr: &actionExpr{
pos: position{line: 233, col: 5, offset: 4859},
run: (*parser).callonAdditive1,
expr: &seqExpr{
pos: position{line: 233, col: 5, offset: 4859},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 233, col: 5, offset: 4859},
label: "head",
expr: &ruleRefExpr{
pos: position{line: 233, col: 10, offset: 4864},
name: "Multiplicative",
},
},
&labeledExpr{
pos: position{line: 233, col: 25, offset: 4879},
label: "tail",
expr: &zeroOrMoreExpr{
pos: position{line: 233, col: 30, offset: 4884},
expr: &seqExpr{
pos: position{line: 233, col: 32, offset: 4886},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&actionExpr{
pos: position{line: 228, col: 5, offset: 4791},
run: (*parser).callonAdditive16,
expr: &charClassMatcher{
pos: position{line: 228, col: 6, offset: 4792},
val: "[+-]",
chars: []rune{'+', '-'},
ignoreCase: false,
inverted: false,
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 233, col: 55, offset: 4909},
name: "Multiplicative",
},
},
},
},
},
},
},
},
},
{
name: "Multiplicative",
pos: position{line: 242, col: 1, offset: 5071},
expr: &actionExpr{
pos: position{line: 243, col: 5, offset: 5090},
run: (*parser).callonMultiplicative1,
expr: &seqExpr{
pos: position{line: 243, col: 5, offset: 5090},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 243, col: 5, offset: 5090},
label: "head",
expr: &ruleRefExpr{
pos: position{line: 243, col: 10, offset: 5095},
name: "UnaryExpression",
},
},
&labeledExpr{
pos: position{line: 243, col: 26, offset: 5111},
label: "tail",
expr: &zeroOrMoreExpr{
pos: position{line: 243, col: 31, offset: 5116},
expr: &seqExpr{
pos: position{line: 243, col: 33, offset: 5118},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&actionExpr{
pos: position{line: 238, col: 5, offset: 5020},
run: (*parser).callonMultiplicative16,
expr: &charClassMatcher{
pos: position{line: 238, col: 6, offset: 5021},
val: "[*/]",
chars: []rune{'*', '/'},
ignoreCase: false,
inverted: false,
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 243, col: 62, offset: 5147},
name: "UnaryExpression",
},
},
},
},
},
},
},
},
},
{
name: "UnaryExpression",
pos: position{line: 252, col: 1, offset: 5303},
expr: &choiceExpr{
pos: position{line: 253, col: 5, offset: 5323},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 253, col: 5, offset: 5323},
run: (*parser).callonUnaryExpression2,
expr: &seqExpr{
pos: position{line: 253, col: 5, offset: 5323},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 253, col: 8, offset: 5326},
label: "op",
expr: &actionExpr{
pos: position{line: 248, col: 5, offset: 5250},
run: (*parser).callonUnaryExpression13,
expr: &choiceExpr{
pos: position{line: 248, col: 6, offset: 5251},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 248, col: 6, offset: 5251},
val: "-",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 248, col: 12, offset: 5257},
val: "not",
ignoreCase: false,
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 253, col: 28, offset: 5346},
label: "argument",
expr: &ruleRefExpr{
pos: position{line: 253, col: 37, offset: 5355},
name: "Primary",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 256, col: 5, offset: 5436},
name: "Primary",
},
},
},
},
{
name: "Primary",
pos: position{line: 258, col: 1, offset: 5445},
expr: &choiceExpr{
pos: position{line: 259, col: 5, offset: 5457},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 259, col: 5, offset: 5457},
name: "PipeExpression",
},
&ruleRefExpr{
pos: position{line: 260, col: 5, offset: 5476},
name: "Array",
},
&actionExpr{
pos: position{line: 384, col: 5, offset: 7263},
run: (*parser).callonPrimary4,
expr: &seqExpr{
pos: position{line: 384, col: 7, offset: 7265},
exprs: []interface{}{
&litMatcher{
pos: position{line: 384, col: 7, offset: 7265},
val: "\"",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 384, col: 11, offset: 7269},
expr: &choiceExpr{
pos: position{line: 392, col: 5, offset: 7478},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 392, col: 5, offset: 7478},
exprs: []interface{}{
&notExpr{
pos: position{line: 392, col: 5, offset: 7478},
expr: &charClassMatcher{
pos: position{line: 392, col: 8, offset: 7481},
val: "[\"\\\\\\n]",
chars: []rune{'"', '\\', '\n'},
ignoreCase: false,
inverted: false,
},
},
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
},
},
&seqExpr{
pos: position{line: 393, col: 5, offset: 7515},
exprs: []interface{}{
&litMatcher{
pos: position{line: 393, col: 5, offset: 7515},
val: "\\",
ignoreCase: false,
},
&choiceExpr{
pos: position{line: 396, col: 5, offset: 7563},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 396, col: 5, offset: 7563},
val: "\"",
ignoreCase: false,
},
&actionExpr{
pos: position{line: 397, col: 5, offset: 7571},
run: (*parser).callonPrimary17,
expr: &choiceExpr{
pos: position{line: 397, col: 7, offset: 7573},
alternatives: []interface{}{
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
&notExpr{
pos: position{line: 489, col: 5, offset: 8991},
expr: &anyMatcher{
line: 489, col: 6, offset: 8992,
},
},
},
},
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 384, col: 29, offset: 7287},
val: "\"",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 387, col: 5, offset: 7347},
run: (*parser).callonPrimary24,
expr: &seqExpr{
pos: position{line: 387, col: 7, offset: 7349},
exprs: []interface{}{
&litMatcher{
pos: position{line: 387, col: 7, offset: 7349},
val: "\"",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 387, col: 11, offset: 7353},
expr: &choiceExpr{
pos: position{line: 392, col: 5, offset: 7478},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 392, col: 5, offset: 7478},
exprs: []interface{}{
&notExpr{
pos: position{line: 392, col: 5, offset: 7478},
expr: &charClassMatcher{
pos: position{line: 392, col: 8, offset: 7481},
val: "[\"\\\\\\n]",
chars: []rune{'"', '\\', '\n'},
ignoreCase: false,
inverted: false,
},
},
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
},
},
&seqExpr{
pos: position{line: 393, col: 5, offset: 7515},
exprs: []interface{}{
&litMatcher{
pos: position{line: 393, col: 5, offset: 7515},
val: "\\",
ignoreCase: false,
},
&choiceExpr{
pos: position{line: 396, col: 5, offset: 7563},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 396, col: 5, offset: 7563},
val: "\"",
ignoreCase: false,
},
&actionExpr{
pos: position{line: 397, col: 5, offset: 7571},
run: (*parser).callonPrimary37,
expr: &choiceExpr{
pos: position{line: 397, col: 7, offset: 7573},
alternatives: []interface{}{
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
&notExpr{
pos: position{line: 489, col: 5, offset: 8991},
expr: &anyMatcher{
line: 489, col: 6, offset: 8992,
},
},
},
},
},
},
},
},
},
},
},
},
&choiceExpr{
pos: position{line: 387, col: 31, offset: 7373},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
&notExpr{
pos: position{line: 489, col: 5, offset: 8991},
expr: &anyMatcher{
line: 489, col: 6, offset: 8992,
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 432, col: 5, offset: 8181},
run: (*parser).callonPrimary47,
expr: &seqExpr{
pos: position{line: 432, col: 5, offset: 8181},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 432, col: 8, offset: 8184},
val: "true",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 435, col: 5, offset: 8255},
run: (*parser).callonPrimary66,
expr: &seqExpr{
pos: position{line: 435, col: 5, offset: 8255},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 435, col: 8, offset: 8258},
val: "false",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 403, col: 5, offset: 7683},
run: (*parser).callonPrimary85,
expr: &seqExpr{
pos: position{line: 403, col: 5, offset: 7683},
exprs: []interface{}{
&litMatcher{
pos: position{line: 403, col: 5, offset: 7683},
val: "/",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 403, col: 9, offset: 7687},
label: "pattern",
expr: &actionExpr{
pos: position{line: 408, col: 5, offset: 7764},
run: (*parser).callonPrimary89,
expr: &labeledExpr{
pos: position{line: 408, col: 5, offset: 7764},
label: "chars",
expr: &oneOrMoreExpr{
pos: position{line: 408, col: 11, offset: 7770},
expr: &choiceExpr{
pos: position{line: 413, col: 5, offset: 7854},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 413, col: 5, offset: 7854},
run: (*parser).callonPrimary93,
expr: &seqExpr{
pos: position{line: 413, col: 5, offset: 7854},
exprs: []interface{}{
&notExpr{
pos: position{line: 413, col: 5, offset: 7854},
expr: &charClassMatcher{
pos: position{line: 413, col: 6, offset: 7855},
val: "[\\\\/]",
chars: []rune{'\\', '/'},
ignoreCase: false,
inverted: false,
},
},
&labeledExpr{
pos: position{line: 413, col: 12, offset: 7861},
label: "re",
expr: &actionExpr{
pos: position{line: 427, col: 5, offset: 8101},
run: (*parser).callonPrimary98,
expr: &seqExpr{
pos: position{line: 427, col: 5, offset: 8101},
exprs: []interface{}{
&notExpr{
pos: position{line: 427, col: 5, offset: 8101},
expr: &charClassMatcher{
pos: position{line: 483, col: 5, offset: 8961},
val: "[\\n\\r]",
chars: []rune{'\n', '\r'},
ignoreCase: false,
inverted: false,
},
},
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 419, col: 5, offset: 7970},
run: (*parser).callonPrimary103,
expr: &litMatcher{
pos: position{line: 419, col: 5, offset: 7970},
val: "\\/",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 422, col: 5, offset: 8018},
run: (*parser).callonPrimary105,
expr: &seqExpr{
pos: position{line: 422, col: 5, offset: 8018},
exprs: []interface{}{
&litMatcher{
pos: position{line: 422, col: 5, offset: 8018},
val: "\\",
ignoreCase: false,
},
&actionExpr{
pos: position{line: 427, col: 5, offset: 8101},
run: (*parser).callonPrimary108,
expr: &seqExpr{
pos: position{line: 427, col: 5, offset: 8101},
exprs: []interface{}{
&notExpr{
pos: position{line: 427, col: 5, offset: 8101},
expr: &charClassMatcher{
pos: position{line: 483, col: 5, offset: 8961},
val: "[\\n\\r]",
chars: []rune{'\n', '\r'},
ignoreCase: false,
inverted: false,
},
},
&anyMatcher{
line: 472, col: 5, offset: 8859,
},
},
},
},
},
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 403, col: 28, offset: 7706},
val: "/",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 459, col: 5, offset: 8592},
run: (*parser).callonPrimary114,
expr: &litMatcher{
pos: position{line: 459, col: 5, offset: 8592},
val: "<-",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 379, col: 5, offset: 7176},
run: (*parser).callonPrimary116,
expr: &oneOrMoreExpr{
pos: position{line: 379, col: 5, offset: 7176},
expr: &seqExpr{
pos: position{line: 376, col: 5, offset: 7133},
exprs: []interface{}{
&choiceExpr{
pos: position{line: 445, col: 6, offset: 8428},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 445, col: 6, offset: 8428},
val: "0",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 445, col: 12, offset: 8434},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 453, col: 5, offset: 8552},
val: "[1-9]",
ranges: []rune{'1', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 445, col: 25, offset: 8447},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&choiceExpr{
pos: position{line: 367, col: 9, offset: 6983},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 348, col: 5, offset: 6816},
val: "ns",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 351, col: 6, offset: 6844},
val: "us",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 351, col: 13, offset: 6851},
val: "µs",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 351, col: 20, offset: 6859},
val: "μs",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 354, col: 5, offset: 6888},
val: "ms",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 357, col: 5, offset: 6910},
val: "[smh]",
chars: []rune{'s', 'm', 'h'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 343, col: 5, offset: 6728},
run: (*parser).callonPrimary132,
expr: &seqExpr{
pos: position{line: 343, col: 5, offset: 6728},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 337, col: 18, offset: 6643},
val: "-",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 337, col: 32, offset: 6657},
val: "-",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 343, col: 14, offset: 6737},
val: "T",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 334, col: 14, offset: 6573},
val: ":",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 334, col: 29, offset: 6588},
val: ":",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrOneExpr{
pos: position{line: 334, col: 44, offset: 6603},
expr: &seqExpr{
pos: position{line: 325, col: 5, offset: 6443},
exprs: []interface{}{
&litMatcher{
pos: position{line: 325, col: 5, offset: 6443},
val: ".",
ignoreCase: false,
},
&oneOrMoreExpr{
pos: position{line: 325, col: 9, offset: 6447},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
&choiceExpr{
pos: position{line: 331, col: 6, offset: 6526},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 331, col: 6, offset: 6526},
val: "Z",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 328, col: 5, offset: 6473},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 328, col: 6, offset: 6474},
val: "[+-]",
chars: []rune{'+', '-'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 328, col: 26, offset: 6494},
val: ":",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 440, col: 5, offset: 8346},
run: (*parser).callonPrimary167,
expr: &seqExpr{
pos: position{line: 440, col: 5, offset: 8346},
exprs: []interface{}{
&choiceExpr{
pos: position{line: 445, col: 6, offset: 8428},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 445, col: 6, offset: 8428},
val: "0",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 445, col: 12, offset: 8434},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 453, col: 5, offset: 8552},
val: "[1-9]",
ranges: []rune{'1', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 445, col: 25, offset: 8447},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 440, col: 13, offset: 8354},
val: ".",
ignoreCase: false,
},
&oneOrMoreExpr{
pos: position{line: 440, col: 17, offset: 8358},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
&actionExpr{
pos: position{line: 448, col: 5, offset: 8475},
run: (*parser).callonPrimary178,
expr: &choiceExpr{
pos: position{line: 445, col: 6, offset: 8428},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 445, col: 6, offset: 8428},
val: "0",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 445, col: 12, offset: 8434},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 453, col: 5, offset: 8552},
val: "[1-9]",
ranges: []rune{'1', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 445, col: 25, offset: 8447},
expr: &charClassMatcher{
pos: position{line: 456, col: 5, offset: 8569},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 262, col: 5, offset: 5498},
name: "CallExpression",
},
&ruleRefExpr{
pos: position{line: 263, col: 5, offset: 5517},
name: "MemberExpressions",
},
&actionExpr{
pos: position{line: 466, col: 5, offset: 8778},
run: (*parser).callonPrimary187,
expr: &seqExpr{
pos: position{line: 466, col: 5, offset: 8778},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 466, col: 5, offset: 8778},
val: "[_\\pL]",
chars: []rune{'_'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 466, col: 11, offset: 8784},
expr: &charClassMatcher{
pos: position{line: 466, col: 11, offset: 8784},
val: "[_0-9\\pL]",
chars: []rune{'_'},
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 265, col: 5, offset: 5554},
name: "ObjectExpression",
},
&ruleRefExpr{
pos: position{line: 266, col: 5, offset: 5575},
name: "ArrowFunctionExpression",
},
&ruleRefExpr{
pos: position{line: 267, col: 5, offset: 5603},
name: "Parens",
},
},
},
},
{
name: "Parens",
pos: position{line: 279, col: 1, offset: 5768},
expr: &actionExpr{
pos: position{line: 280, col: 5, offset: 5779},
run: (*parser).callonParens1,
expr: &seqExpr{
pos: position{line: 280, col: 5, offset: 5779},
exprs: []interface{}{
&litMatcher{
pos: position{line: 280, col: 5, offset: 5779},
val: "(",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 280, col: 12, offset: 5786},
label: "expr",
expr: &ruleRefExpr{
pos: position{line: 280, col: 17, offset: 5791},
name: "Expr",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 280, col: 25, offset: 5799},
val: ")",
ignoreCase: false,
},
},
},
},
},
{
name: "Array",
pos: position{line: 284, col: 1, offset: 5835},
expr: &actionExpr{
pos: position{line: 285, col: 5, offset: 5845},
run: (*parser).callonArray1,
expr: &seqExpr{
pos: position{line: 285, col: 5, offset: 5845},
exprs: []interface{}{
&litMatcher{
pos: position{line: 285, col: 5, offset: 5845},
val: "[",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 285, col: 12, offset: 5852},
label: "elements",
expr: &zeroOrOneExpr{
pos: position{line: 285, col: 21, offset: 5861},
expr: &ruleRefExpr{
pos: position{line: 285, col: 21, offset: 5861},
name: "ArrayElements",
},
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 285, col: 39, offset: 5879},
val: "]",
ignoreCase: false,
},
},
},
},
},
{
name: "ArrayElements",
pos: position{line: 289, col: 1, offset: 5919},
expr: &actionExpr{
pos: position{line: 290, col: 5, offset: 5937},
run: (*parser).callonArrayElements1,
expr: &seqExpr{
pos: position{line: 290, col: 5, offset: 5937},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 290, col: 5, offset: 5937},
label: "first",
expr: &ruleRefExpr{
pos: position{line: 290, col: 11, offset: 5943},
name: "Primary",
},
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 290, col: 22, offset: 5954},
label: "rest",
expr: &zeroOrMoreExpr{
pos: position{line: 290, col: 27, offset: 5959},
expr: &ruleRefExpr{
pos: position{line: 290, col: 27, offset: 5959},
name: "ArrayRest",
},
},
},
},
},
},
},
{
name: "ArrayRest",
pos: position{line: 294, col: 1, offset: 6031},
expr: &actionExpr{
pos: position{line: 295, col: 5, offset: 6045},
run: (*parser).callonArrayRest1,
expr: &seqExpr{
pos: position{line: 295, col: 5, offset: 6045},
exprs: []interface{}{
&litMatcher{
pos: position{line: 295, col: 5, offset: 6045},
val: ",",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 474, col: 5, offset: 8868},
expr: &choiceExpr{
pos: position{line: 474, col: 7, offset: 8870},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 480, col: 5, offset: 8931},
val: "[ \\t\\r\\n]",
chars: []rune{' ', '\t', '\r', '\n'},
ignoreCase: false,
inverted: false,
},
&seqExpr{
pos: position{line: 477, col: 5, offset: 8905},
exprs: []interface{}{
&litMatcher{
pos: position{line: 477, col: 5, offset: 8905},
val: "//",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 477, col: 10, offset: 8910},
expr: &charClassMatcher{
pos: position{line: 477, col: 10, offset: 8910},
val: "[^\\r\\n]",
chars: []rune{'\r', '\n'},
ignoreCase: false,
inverted: true,
},
},
&litMatcher{
pos: position{line: 486, col: 5, offset: 8977},
val: "\n",
ignoreCase: false,
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 295, col: 12, offset: 6052},
label: "element",
expr: &ruleRefExpr{
pos: position{line: 295, col: 20, offset: 6060},
name: "Primary",
},
},
},
},
},
},
},
}
func (c *current) onStart1(program interface{}) (interface{}, error) {
return program, nil
}
func (p *parser) callonStart1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onStart1(stack["program"])
}
func (c *current) onProgram1(body interface{}) (interface{}, error) {
return program(body, c.text, c.pos)
}
func (p *parser) callonProgram1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onProgram1(stack["body"])
}
func (c *current) onSourceElements1(head, tail interface{}) (interface{}, error) {
return srcElems(head, tail)
}
func (p *parser) callonSourceElements1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSourceElements1(stack["head"], stack["tail"])
}
func (c *current) onOptionStatement13() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonOptionStatement13() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOptionStatement13()
}
func (c *current) onOptionStatement1(id, expr interface{}) (interface{}, error) {
return optionstmt(id, expr, c.text, c.pos)
}
func (p *parser) callonOptionStatement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOptionStatement1(stack["id"], stack["expr"])
}
func (c *current) onVariableStatement1(declaration interface{}) (interface{}, error) {
return varstmt(declaration, c.text, c.pos)
}
func (p *parser) callonVariableStatement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVariableStatement1(stack["declaration"])
}
func (c *current) onReturnStatement1(argument interface{}) (interface{}, error) {
return returnstmt(argument, c.text, c.pos)
}
func (p *parser) callonReturnStatement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onReturnStatement1(stack["argument"])
}
func (c *current) onExpressionStatement1(expr interface{}) (interface{}, error) {
return exprstmt(expr, c.text, c.pos)
}
func (p *parser) callonExpressionStatement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onExpressionStatement1(stack["expr"])
}
func (c *current) onBlockStatement1(body interface{}) (interface{}, error) {
return blockstmt(body, c.text, c.pos)
}
func (p *parser) callonBlockStatement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onBlockStatement1(stack["body"])
}
func (c *current) onVariableDeclaration4() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonVariableDeclaration4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVariableDeclaration4()
}
func (c *current) onVariableDeclaration1(id, init interface{}) (interface{}, error) {
return vardecl(id, init, c.text, c.pos)
}
func (p *parser) callonVariableDeclaration1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVariableDeclaration1(stack["id"], stack["init"])
}
func (c *current) onMemberExpressions4() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonMemberExpressions4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMemberExpressions4()
}
func (c *current) onMemberExpressions11(property interface{}) (interface{}, error) {
return property, nil
}
func (p *parser) callonMemberExpressions11() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMemberExpressions11(stack["property"])
}
func (c *current) onMemberExpressions1(head, tail interface{}) (interface{}, error) {
return memberexprs(head, tail, c.text, c.pos)
}
func (p *parser) callonMemberExpressions1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMemberExpressions1(stack["head"], stack["tail"])
}
func (c *current) onMemberExpressionProperty14() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonMemberExpressionProperty14() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMemberExpressionProperty14()
}
func (c *current) onMemberExpressionProperty2(property interface{}) (interface{}, error) {
return property, nil
}
func (p *parser) callonMemberExpressionProperty2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMemberExpressionProperty2(stack["property"])
}
func (c *current) onMemberExpressionProperty19(property interface{}) (interface{}, error) {
return property, nil
}
func (p *parser) callonMemberExpressionProperty19() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMemberExpressionProperty19(stack["property"])
}
func (c *current) onCallExpression4(callee, args interface{}) (interface{}, error) {
return callexpr(callee, args, c.text, c.pos)
}
func (p *parser) callonCallExpression4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onCallExpression4(stack["callee"], stack["args"])
}
func (c *current) onCallExpression21(args interface{}) (interface{}, error) {
return callexpr(nil, args, c.text, c.pos)
}
func (p *parser) callonCallExpression21() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onCallExpression21(stack["args"])
}
func (c *current) onCallExpression33(property interface{}) (interface{}, error) {
return memberexpr(nil, property, c.text, c.pos)
}
func (p *parser) callonCallExpression33() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onCallExpression33(stack["property"])
}
func (c *current) onCallExpression1(head, tail interface{}) (interface{}, error) {
return callexprs(head, tail, c.text, c.pos)
}
func (p *parser) callonCallExpression1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onCallExpression1(stack["head"], stack["tail"])
}
func (c *current) onPipeExpression1(head, tail interface{}) (interface{}, error) {
return pipeExprs(head, tail, c.text, c.pos)
}
func (p *parser) callonPipeExpression1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpression1(stack["head"], stack["tail"])
}
func (c *current) onPipeExpressionHead16() (interface{}, error) {
return nil, errors.New("invalid escape character")
}
func (p *parser) callonPipeExpressionHead16() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead16()
}
func (c *current) onPipeExpressionHead3() (interface{}, error) {
return stringLiteral(c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead3() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead3()
}
func (c *current) onPipeExpressionHead36() (interface{}, error) {
return nil, errors.New("invalid escape character")
}
func (p *parser) callonPipeExpressionHead36() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead36()
}
func (c *current) onPipeExpressionHead23() (interface{}, error) {
return "", errors.New("string literal not terminated")
}
func (p *parser) callonPipeExpressionHead23() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead23()
}
func (c *current) onPipeExpressionHead46() (interface{}, error) {
return booleanLiteral(true, c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead46() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead46()
}
func (c *current) onPipeExpressionHead65() (interface{}, error) {
return booleanLiteral(false, c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead65() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead65()
}
func (c *current) onPipeExpressionHead97() (interface{}, error) {
return c.text, nil
}
func (p *parser) callonPipeExpressionHead97() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead97()
}
func (c *current) onPipeExpressionHead92(re interface{}) (interface{}, error) {
return re, nil
}
func (p *parser) callonPipeExpressionHead92() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead92(stack["re"])
}
func (c *current) onPipeExpressionHead102() (interface{}, error) {
return []byte{'/'}, nil
}
func (p *parser) callonPipeExpressionHead102() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead102()
}
func (c *current) onPipeExpressionHead107() (interface{}, error) {
return c.text, nil
}
func (p *parser) callonPipeExpressionHead107() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead107()
}
func (c *current) onPipeExpressionHead104() (interface{}, error) {
return c.text, nil
}
func (p *parser) callonPipeExpressionHead104() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead104()
}
func (c *current) onPipeExpressionHead88(chars interface{}) (interface{}, error) {
return regexLiteral(chars, c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead88() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead88(stack["chars"])
}
func (c *current) onPipeExpressionHead84(pattern interface{}) (interface{}, error) {
return pattern, nil
}
func (p *parser) callonPipeExpressionHead84() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead84(stack["pattern"])
}
func (c *current) onPipeExpressionHead113() (interface{}, error) {
return pipeLiteral(c.text, c.pos), nil
}
func (p *parser) callonPipeExpressionHead113() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead113()
}
func (c *current) onPipeExpressionHead115() (interface{}, error) {
return durationLiteral(c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead115() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead115()
}
func (c *current) onPipeExpressionHead131() (interface{}, error) {
return datetime(c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead131() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead131()
}
func (c *current) onPipeExpressionHead166() (interface{}, error) {
return numberLiteral(c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead166() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead166()
}
func (c *current) onPipeExpressionHead177() (interface{}, error) {
return integerLiteral(c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead177() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead177()
}
func (c *current) onPipeExpressionHead186() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonPipeExpressionHead186() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionHead186()
}
func (c *current) onPipeExpressionPipe1(call interface{}) (interface{}, error) {
return incompletePipeExpr(call, c.text, c.pos)
}
func (p *parser) callonPipeExpressionPipe1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPipeExpressionPipe1(stack["call"])
}
func (c *current) onArguments1(args interface{}) (interface{}, error) {
return args, nil
}
func (p *parser) callonArguments1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArguments1(stack["args"])
}
func (c *current) onArrowFunctionExpression1(params, body interface{}) (interface{}, error) {
return arrowfunc(params, body, c.text, c.pos), nil
}
func (p *parser) callonArrowFunctionExpression1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionExpression1(stack["params"], stack["body"])
}
func (c *current) onArrowFunctionParams1(first, rest interface{}) (interface{}, error) {
return append([]interface{}{first}, toIfaceSlice(rest)...), nil
}
func (p *parser) callonArrowFunctionParams1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionParams1(stack["first"], stack["rest"])
}
func (c *current) onArrowFunctionParamsRest1(arg interface{}) (interface{}, error) {
return arg, nil
}
func (p *parser) callonArrowFunctionParamsRest1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionParamsRest1(stack["arg"])
}
func (c *current) onArrowFunctionParam5() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonArrowFunctionParam5() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionParam5()
}
func (c *current) onArrowFunctionParam2(key, value interface{}) (interface{}, error) {
return property(key, value, c.text, c.pos)
}
func (p *parser) callonArrowFunctionParam2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionParam2(stack["key"], stack["value"])
}
func (c *current) onArrowFunctionParam40() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonArrowFunctionParam40() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionParam40()
}
func (c *current) onArrowFunctionParam37(key interface{}) (interface{}, error) {
return property(key, nil, c.text, c.pos)
}
func (p *parser) callonArrowFunctionParam37() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionParam37(stack["key"])
}
func (c *current) onArrowFunctionBody2(body interface{}) (interface{}, error) {
return body, nil
}
func (p *parser) callonArrowFunctionBody2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionBody2(stack["body"])
}
func (c *current) onArrowFunctionBody5(body interface{}) (interface{}, error) {
return body, nil
}
func (p *parser) callonArrowFunctionBody5() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrowFunctionBody5(stack["body"])
}
func (c *current) onObjectExpression1(object interface{}) (interface{}, error) {
return object, nil
}
func (p *parser) callonObjectExpression1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onObjectExpression1(stack["object"])
}
func (c *current) onObjectProperties1(first, rest interface{}) (interface{}, error) {
return objectexpr(first, rest, c.text, c.pos)
}
func (p *parser) callonObjectProperties1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onObjectProperties1(stack["first"], stack["rest"])
}
func (c *current) onPropertiesRest1(arg interface{}) (interface{}, error) {
return arg, nil
}
func (p *parser) callonPropertiesRest1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPropertiesRest1(stack["arg"])
}
func (c *current) onProperty4() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonProperty4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onProperty4()
}
func (c *current) onProperty1(key, value interface{}) (interface{}, error) {
return property(key, value, c.text, c.pos)
}
func (p *parser) callonProperty1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onProperty1(stack["key"], stack["value"])
}
func (c *current) onLogicalExpression16() (interface{}, error) {
return logicalOp(c.text)
}
func (p *parser) callonLogicalExpression16() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLogicalExpression16()
}
func (c *current) onLogicalExpression1(head, tail interface{}) (interface{}, error) {
return logicalExpression(head, tail, c.text, c.pos)
}
func (p *parser) callonLogicalExpression1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLogicalExpression1(stack["head"], stack["tail"])
}
func (c *current) onEquality16() (interface{}, error) {
return operator(c.text)
}
func (p *parser) callonEquality16() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEquality16()
}
func (c *current) onEquality1(head, tail interface{}) (interface{}, error) {
return binaryExpression(head, tail, c.text, c.pos)
}
func (p *parser) callonEquality1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEquality1(stack["head"], stack["tail"])
}
func (c *current) onRelational16() (interface{}, error) {
return operator(c.text)
}
func (p *parser) callonRelational16() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onRelational16()
}
func (c *current) onRelational1(head, tail interface{}) (interface{}, error) {
return binaryExpression(head, tail, c.text, c.pos)
}
func (p *parser) callonRelational1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onRelational1(stack["head"], stack["tail"])
}
func (c *current) onAdditive16() (interface{}, error) {
return operator(c.text)
}
func (p *parser) callonAdditive16() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAdditive16()
}
func (c *current) onAdditive1(head, tail interface{}) (interface{}, error) {
return binaryExpression(head, tail, c.text, c.pos)
}
func (p *parser) callonAdditive1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAdditive1(stack["head"], stack["tail"])
}
func (c *current) onMultiplicative16() (interface{}, error) {
return operator(c.text)
}
func (p *parser) callonMultiplicative16() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultiplicative16()
}
func (c *current) onMultiplicative1(head, tail interface{}) (interface{}, error) {
return binaryExpression(head, tail, c.text, c.pos)
}
func (p *parser) callonMultiplicative1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultiplicative1(stack["head"], stack["tail"])
}
func (c *current) onUnaryExpression13() (interface{}, error) {
return operator(c.text)
}
func (p *parser) callonUnaryExpression13() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnaryExpression13()
}
func (c *current) onUnaryExpression2(op, argument interface{}) (interface{}, error) {
return unaryExpression(op, argument, c.text, c.pos)
}
func (p *parser) callonUnaryExpression2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnaryExpression2(stack["op"], stack["argument"])
}
func (c *current) onPrimary17() (interface{}, error) {
return nil, errors.New("invalid escape character")
}
func (p *parser) callonPrimary17() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary17()
}
func (c *current) onPrimary4() (interface{}, error) {
return stringLiteral(c.text, c.pos)
}
func (p *parser) callonPrimary4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary4()
}
func (c *current) onPrimary37() (interface{}, error) {
return nil, errors.New("invalid escape character")
}
func (p *parser) callonPrimary37() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary37()
}
func (c *current) onPrimary24() (interface{}, error) {
return "", errors.New("string literal not terminated")
}
func (p *parser) callonPrimary24() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary24()
}
func (c *current) onPrimary47() (interface{}, error) {
return booleanLiteral(true, c.text, c.pos)
}
func (p *parser) callonPrimary47() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary47()
}
func (c *current) onPrimary66() (interface{}, error) {
return booleanLiteral(false, c.text, c.pos)
}
func (p *parser) callonPrimary66() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary66()
}
func (c *current) onPrimary98() (interface{}, error) {
return c.text, nil
}
func (p *parser) callonPrimary98() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary98()
}
func (c *current) onPrimary93(re interface{}) (interface{}, error) {
return re, nil
}
func (p *parser) callonPrimary93() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary93(stack["re"])
}
func (c *current) onPrimary103() (interface{}, error) {
return []byte{'/'}, nil
}
func (p *parser) callonPrimary103() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary103()
}
func (c *current) onPrimary108() (interface{}, error) {
return c.text, nil
}
func (p *parser) callonPrimary108() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary108()
}
func (c *current) onPrimary105() (interface{}, error) {
return c.text, nil
}
func (p *parser) callonPrimary105() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary105()
}
func (c *current) onPrimary89(chars interface{}) (interface{}, error) {
return regexLiteral(chars, c.text, c.pos)
}
func (p *parser) callonPrimary89() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary89(stack["chars"])
}
func (c *current) onPrimary85(pattern interface{}) (interface{}, error) {
return pattern, nil
}
func (p *parser) callonPrimary85() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary85(stack["pattern"])
}
func (c *current) onPrimary114() (interface{}, error) {
return pipeLiteral(c.text, c.pos), nil
}
func (p *parser) callonPrimary114() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary114()
}
func (c *current) onPrimary116() (interface{}, error) {
return durationLiteral(c.text, c.pos)
}
func (p *parser) callonPrimary116() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary116()
}
func (c *current) onPrimary132() (interface{}, error) {
return datetime(c.text, c.pos)
}
func (p *parser) callonPrimary132() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary132()
}
func (c *current) onPrimary167() (interface{}, error) {
return numberLiteral(c.text, c.pos)
}
func (p *parser) callonPrimary167() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary167()
}
func (c *current) onPrimary178() (interface{}, error) {
return integerLiteral(c.text, c.pos)
}
func (p *parser) callonPrimary178() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary178()
}
func (c *current) onPrimary187() (interface{}, error) {
return identifier(c.text, c.pos)
}
func (p *parser) callonPrimary187() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPrimary187()
}
func (c *current) onParens1(expr interface{}) (interface{}, error) {
return expr, nil
}
func (p *parser) callonParens1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParens1(stack["expr"])
}
func (c *current) onArray1(elements interface{}) (interface{}, error) {
return elements, nil
}
func (p *parser) callonArray1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArray1(stack["elements"])
}
func (c *current) onArrayElements1(first, rest interface{}) (interface{}, error) {
return array(first, rest, c.text, c.pos), nil
}
func (p *parser) callonArrayElements1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrayElements1(stack["first"], stack["rest"])
}
func (c *current) onArrayRest1(element interface{}) (interface{}, error) {
return element, nil
}
func (p *parser) callonArrayRest1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onArrayRest1(stack["element"])
}
var (
// errNoRule is returned when the grammar to parse has no rule.
errNoRule = errors.New("grammar has no rule")
// errInvalidEntrypoint is returned when the specified entrypoint rule
// does not exit.
errInvalidEntrypoint = errors.New("invalid entrypoint")
// errInvalidEncoding is returned when the source is not properly
// utf8-encoded.
errInvalidEncoding = errors.New("invalid encoding")
// errMaxExprCnt is used to signal that the maximum number of
// expressions have been parsed.
errMaxExprCnt = errors.New("max number of expresssions parsed")
)
// Option is a function that can set an option on the parser. It returns
// the previous setting as an Option.
type Option func(*parser) Option
// MaxExpressions creates an Option to stop parsing after the provided
// number of expressions have been parsed, if the value is 0 then the parser will
// parse for as many steps as needed (possibly an infinite number).
//
// The default for maxExprCnt is 0.
func MaxExpressions(maxExprCnt uint64) Option {
return func(p *parser) Option {
oldMaxExprCnt := p.maxExprCnt
p.maxExprCnt = maxExprCnt
return MaxExpressions(oldMaxExprCnt)
}
}
// Entrypoint creates an Option to set the rule name to use as entrypoint.
// The rule name must have been specified in the -alternate-entrypoints
// if generating the parser with the -optimize-grammar flag, otherwise
// it may have been optimized out. Passing an empty string sets the
// entrypoint to the first rule in the grammar.
//
// The default is to start parsing at the first rule in the grammar.
func Entrypoint(ruleName string) Option {
return func(p *parser) Option {
oldEntrypoint := p.entrypoint
p.entrypoint = ruleName
if ruleName == "" {
p.entrypoint = g.rules[0].name
}
return Entrypoint(oldEntrypoint)
}
}
// AllowInvalidUTF8 creates an Option to allow invalid UTF-8 bytes.
// Every invalid UTF-8 byte is treated as a utf8.RuneError (U+FFFD)
// by character class matchers and is matched by the any matcher.
// The returned matched value, c.text and c.offset are NOT affected.
//
// The default is false.
func AllowInvalidUTF8(b bool) Option {
return func(p *parser) Option {
old := p.allowInvalidUTF8
p.allowInvalidUTF8 = b
return AllowInvalidUTF8(old)
}
}
// Recover creates an Option to set the recover flag to b. When set to
// true, this causes the parser to recover from panics and convert it
// to an error. Setting it to false can be useful while debugging to
// access the full stack trace.
//
// The default is true.
func Recover(b bool) Option {
return func(p *parser) Option {
old := p.recover
p.recover = b
return Recover(old)
}
}
// GlobalStore creates an Option to set a key to a certain value in
// the globalStore.
func GlobalStore(key string, value interface{}) Option {
return func(p *parser) Option {
old := p.cur.globalStore[key]
p.cur.globalStore[key] = value
return GlobalStore(key, old)
}
}
// ParseFile parses the file identified by filename.
func ParseFile(filename string, opts ...Option) (i interface{}, err error) {
f, err := os.Open(filename)
if err != nil {
return nil, err
}
defer func() {
if closeErr := f.Close(); closeErr != nil {
err = closeErr
}
}()
return ParseReader(filename, f, opts...)
}
// ParseReader parses the data from r using filename as information in the
// error messages.
func ParseReader(filename string, r io.Reader, opts ...Option) (interface{}, error) {
b, err := ioutil.ReadAll(r)
if err != nil {
return nil, err
}
return Parse(filename, b, opts...)
}
// Parse parses the data from b using filename as information in the
// error messages.
func Parse(filename string, b []byte, opts ...Option) (interface{}, error) {
return newParser(filename, b, opts...).parse(g)
}
// position records a position in the text.
type position struct {
line, col, offset int
}
func (p position) String() string {
return fmt.Sprintf("%d:%d [%d]", p.line, p.col, p.offset)
}
// savepoint stores all state required to go back to this point in the
// parser.
type savepoint struct {
position
rn rune
w int
}
type current struct {
pos position // start position of the match
text []byte // raw text of the match
// globalStore is a general store for the user to store arbitrary key-value
// pairs that they need to manage and that they do not want tied to the
// backtracking of the parser. This is only modified by the user and never
// rolled back by the parser. It is always up to the user to keep this in a
// consistent state.
globalStore storeDict
}
type storeDict map[string]interface{}
// the AST types...
type grammar struct {
pos position
rules []*rule
}
type rule struct {
pos position
name string
displayName string
expr interface{}
}
type choiceExpr struct {
pos position
alternatives []interface{}
}
type actionExpr struct {
pos position
expr interface{}
run func(*parser) (interface{}, error)
}
type recoveryExpr struct {
pos position
expr interface{}
recoverExpr interface{}
failureLabel []string
}
type seqExpr struct {
pos position
exprs []interface{}
}
type throwExpr struct {
pos position
label string
}
type labeledExpr struct {
pos position
label string
expr interface{}
}
type expr struct {
pos position
expr interface{}
}
type andExpr expr
type notExpr expr
type zeroOrOneExpr expr
type zeroOrMoreExpr expr
type oneOrMoreExpr expr
type ruleRefExpr struct {
pos position
name string
}
type andCodeExpr struct {
pos position
run func(*parser) (bool, error)
}
type notCodeExpr struct {
pos position
run func(*parser) (bool, error)
}
type litMatcher struct {
pos position
val string
ignoreCase bool
}
type charClassMatcher struct {
pos position
val string
basicLatinChars [128]bool
chars []rune
ranges []rune
classes []*unicode.RangeTable
ignoreCase bool
inverted bool
}
type anyMatcher position
// errList cumulates the errors found by the parser.
type errList []error
func (e *errList) add(err error) {
*e = append(*e, err)
}
func (e errList) err() error {
if len(e) == 0 {
return nil
}
e.dedupe()
return e
}
func (e *errList) dedupe() {
var cleaned []error
set := make(map[string]bool)
for _, err := range *e {
if msg := err.Error(); !set[msg] {
set[msg] = true
cleaned = append(cleaned, err)
}
}
*e = cleaned
}
func (e errList) Error() string {
switch len(e) {
case 0:
return ""
case 1:
return e[0].Error()
default:
var buf bytes.Buffer
for i, err := range e {
if i > 0 {
buf.WriteRune('\n')
}
buf.WriteString(err.Error())
}
return buf.String()
}
}
// parserError wraps an error with a prefix indicating the rule in which
// the error occurred. The original error is stored in the Inner field.
type parserError struct {
Inner error
pos position
prefix string
expected []string
}
// Error returns the error message.
func (p *parserError) Error() string {
return p.prefix + ": " + p.Inner.Error()
}
// newParser creates a parser with the specified input source and options.
func newParser(filename string, b []byte, opts ...Option) *parser {
stats := Stats{
ChoiceAltCnt: make(map[string]map[string]int),
}
p := &parser{
filename: filename,
errs: new(errList),
data: b,
pt: savepoint{position: position{line: 1}},
recover: true,
cur: current{
globalStore: make(storeDict),
},
maxFailPos: position{col: 1, line: 1},
maxFailExpected: make([]string, 0, 20),
Stats: &stats,
// start rule is rule [0] unless an alternate entrypoint is specified
entrypoint: g.rules[0].name,
}
p.setOptions(opts)
if p.maxExprCnt == 0 {
p.maxExprCnt = math.MaxUint64
}
return p
}
// setOptions applies the options to the parser.
func (p *parser) setOptions(opts []Option) {
for _, opt := range opts {
opt(p)
}
}
type resultTuple struct {
v interface{}
b bool
end savepoint
}
const choiceNoMatch = -1
// Stats stores some statistics, gathered during parsing
type Stats struct {
// ExprCnt counts the number of expressions processed during parsing
// This value is compared to the maximum number of expressions allowed
// (set by the MaxExpressions option).
ExprCnt uint64
// ChoiceAltCnt is used to count for each ordered choice expression,
// which alternative is used how may times.
// These numbers allow to optimize the order of the ordered choice expression
// to increase the performance of the parser
//
// The outer key of ChoiceAltCnt is composed of the name of the rule as well
// as the line and the column of the ordered choice.
// The inner key of ChoiceAltCnt is the number (one-based) of the matching alternative.
// For each alternative the number of matches are counted. If an ordered choice does not
// match, a special counter is incremented. The name of this counter is set with
// the parser option Statistics.
// For an alternative to be included in ChoiceAltCnt, it has to match at least once.
ChoiceAltCnt map[string]map[string]int
}
type parser struct {
filename string
pt savepoint
cur current
data []byte
errs *errList
depth int
recover bool
// rules table, maps the rule identifier to the rule node
rules map[string]*rule
// variables stack, map of label to value
vstack []map[string]interface{}
// rule stack, allows identification of the current rule in errors
rstack []*rule
// parse fail
maxFailPos position
maxFailExpected []string
maxFailInvertExpected bool
// max number of expressions to be parsed
maxExprCnt uint64
// entrypoint for the parser
entrypoint string
allowInvalidUTF8 bool
*Stats
choiceNoMatch string
// recovery expression stack, keeps track of the currently available recovery expression, these are traversed in reverse
recoveryStack []map[string]interface{}
// emptyState contains an empty storeDict, which is used to optimize cloneState if global "state" store is not used.
emptyState storeDict
}
// push a variable set on the vstack.
func (p *parser) pushV() {
if cap(p.vstack) == len(p.vstack) {
// create new empty slot in the stack
p.vstack = append(p.vstack, nil)
} else {
// slice to 1 more
p.vstack = p.vstack[:len(p.vstack)+1]
}
// get the last args set
m := p.vstack[len(p.vstack)-1]
if m != nil && len(m) == 0 {
// empty map, all good
return
}
m = make(map[string]interface{})
p.vstack[len(p.vstack)-1] = m
}
// pop a variable set from the vstack.
func (p *parser) popV() {
// if the map is not empty, clear it
m := p.vstack[len(p.vstack)-1]
if len(m) > 0 {
// GC that map
p.vstack[len(p.vstack)-1] = nil
}
p.vstack = p.vstack[:len(p.vstack)-1]
}
// push a recovery expression with its labels to the recoveryStack
func (p *parser) pushRecovery(labels []string, expr interface{}) {
if cap(p.recoveryStack) == len(p.recoveryStack) {
// create new empty slot in the stack
p.recoveryStack = append(p.recoveryStack, nil)
} else {
// slice to 1 more
p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)+1]
}
m := make(map[string]interface{}, len(labels))
for _, fl := range labels {
m[fl] = expr
}
p.recoveryStack[len(p.recoveryStack)-1] = m
}
// pop a recovery expression from the recoveryStack
func (p *parser) popRecovery() {
// GC that map
p.recoveryStack[len(p.recoveryStack)-1] = nil
p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)-1]
}
func (p *parser) addErr(err error) {
p.addErrAt(err, p.pt.position, []string{})
}
func (p *parser) addErrAt(err error, pos position, expected []string) {
var buf bytes.Buffer
if p.filename != "" {
buf.WriteString(p.filename)
}
if buf.Len() > 0 {
buf.WriteString(":")
}
buf.WriteString(fmt.Sprintf("%d:%d (%d)", pos.line, pos.col, pos.offset))
if len(p.rstack) > 0 {
if buf.Len() > 0 {
buf.WriteString(": ")
}
rule := p.rstack[len(p.rstack)-1]
if rule.displayName != "" {
buf.WriteString("rule " + rule.displayName)
} else {
buf.WriteString("rule " + rule.name)
}
}
pe := &parserError{Inner: err, pos: pos, prefix: buf.String(), expected: expected}
p.errs.add(pe)
}
func (p *parser) failAt(fail bool, pos position, want string) {
// process fail if parsing fails and not inverted or parsing succeeds and invert is set
if fail == p.maxFailInvertExpected {
if pos.offset < p.maxFailPos.offset {
return
}
if pos.offset > p.maxFailPos.offset {
p.maxFailPos = pos
p.maxFailExpected = p.maxFailExpected[:0]
}
if p.maxFailInvertExpected {
want = "!" + want
}
p.maxFailExpected = append(p.maxFailExpected, want)
}
}
// read advances the parser to the next rune.
func (p *parser) read() {
p.pt.offset += p.pt.w
rn, n := utf8.DecodeRune(p.data[p.pt.offset:])
p.pt.rn = rn
p.pt.w = n
p.pt.col++
if rn == '\n' {
p.pt.line++
p.pt.col = 0
}
if rn == utf8.RuneError && n == 1 { // see utf8.DecodeRune
if !p.allowInvalidUTF8 {
p.addErr(errInvalidEncoding)
}
}
}
// restore parser position to the savepoint pt.
func (p *parser) restore(pt savepoint) {
if pt.offset == p.pt.offset {
return
}
p.pt = pt
}
// get the slice of bytes from the savepoint start to the current position.
func (p *parser) sliceFrom(start savepoint) []byte {
return p.data[start.position.offset:p.pt.position.offset]
}
func (p *parser) buildRulesTable(g *grammar) {
p.rules = make(map[string]*rule, len(g.rules))
for _, r := range g.rules {
p.rules[r.name] = r
}
}
func (p *parser) parse(g *grammar) (val interface{}, err error) {
if len(g.rules) == 0 {
p.addErr(errNoRule)
return nil, p.errs.err()
}
// TODO : not super critical but this could be generated
p.buildRulesTable(g)
if p.recover {
// panic can be used in action code to stop parsing immediately
// and return the panic as an error.
defer func() {
if e := recover(); e != nil {
val = nil
switch e := e.(type) {
case error:
p.addErr(e)
default:
p.addErr(fmt.Errorf("%v", e))
}
err = p.errs.err()
}
}()
}
startRule, ok := p.rules[p.entrypoint]
if !ok {
p.addErr(errInvalidEntrypoint)
return nil, p.errs.err()
}
p.read() // advance to first rune
val, ok = p.parseRule(startRule)
if !ok {
if len(*p.errs) == 0 {
// If parsing fails, but no errors have been recorded, the expected values
// for the farthest parser position are returned as error.
maxFailExpectedMap := make(map[string]struct{}, len(p.maxFailExpected))
for _, v := range p.maxFailExpected {
maxFailExpectedMap[v] = struct{}{}
}
expected := make([]string, 0, len(maxFailExpectedMap))
eof := false
if _, ok := maxFailExpectedMap["!."]; ok {
delete(maxFailExpectedMap, "!.")
eof = true
}
for k := range maxFailExpectedMap {
expected = append(expected, k)
}
sort.Strings(expected)
if eof {
expected = append(expected, "EOF")
}
p.addErrAt(errors.New("no match found, expected: "+listJoin(expected, ", ", "or")), p.maxFailPos, expected)
}
return nil, p.errs.err()
}
return val, p.errs.err()
}
func listJoin(list []string, sep string, lastSep string) string {
switch len(list) {
case 0:
return ""
case 1:
return list[0]
default:
return fmt.Sprintf("%s %s %s", strings.Join(list[:len(list)-1], sep), lastSep, list[len(list)-1])
}
}
func (p *parser) parseRule(rule *rule) (interface{}, bool) {
p.rstack = append(p.rstack, rule)
p.pushV()
val, ok := p.parseExpr(rule.expr)
p.popV()
p.rstack = p.rstack[:len(p.rstack)-1]
return val, ok
}
func (p *parser) parseExpr(expr interface{}) (interface{}, bool) {
p.ExprCnt++
if p.ExprCnt > p.maxExprCnt {
panic(errMaxExprCnt)
}
var val interface{}
var ok bool
switch expr := expr.(type) {
case *actionExpr:
val, ok = p.parseActionExpr(expr)
case *andCodeExpr:
val, ok = p.parseAndCodeExpr(expr)
case *andExpr:
val, ok = p.parseAndExpr(expr)
case *anyMatcher:
val, ok = p.parseAnyMatcher(expr)
case *charClassMatcher:
val, ok = p.parseCharClassMatcher(expr)
case *choiceExpr:
val, ok = p.parseChoiceExpr(expr)
case *labeledExpr:
val, ok = p.parseLabeledExpr(expr)
case *litMatcher:
val, ok = p.parseLitMatcher(expr)
case *notCodeExpr:
val, ok = p.parseNotCodeExpr(expr)
case *notExpr:
val, ok = p.parseNotExpr(expr)
case *oneOrMoreExpr:
val, ok = p.parseOneOrMoreExpr(expr)
case *recoveryExpr:
val, ok = p.parseRecoveryExpr(expr)
case *ruleRefExpr:
val, ok = p.parseRuleRefExpr(expr)
case *seqExpr:
val, ok = p.parseSeqExpr(expr)
case *throwExpr:
val, ok = p.parseThrowExpr(expr)
case *zeroOrMoreExpr:
val, ok = p.parseZeroOrMoreExpr(expr)
case *zeroOrOneExpr:
val, ok = p.parseZeroOrOneExpr(expr)
default:
panic(fmt.Sprintf("unknown expression type %T", expr))
}
return val, ok
}
func (p *parser) parseActionExpr(act *actionExpr) (interface{}, bool) {
start := p.pt
val, ok := p.parseExpr(act.expr)
if ok {
p.cur.pos = start.position
p.cur.text = p.sliceFrom(start)
actVal, err := act.run(p)
if err != nil {
p.addErrAt(err, start.position, []string{})
}
val = actVal
}
return val, ok
}
func (p *parser) parseAndCodeExpr(and *andCodeExpr) (interface{}, bool) {
ok, err := and.run(p)
if err != nil {
p.addErr(err)
}
return nil, ok
}
func (p *parser) parseAndExpr(and *andExpr) (interface{}, bool) {
pt := p.pt
p.pushV()
_, ok := p.parseExpr(and.expr)
p.popV()
p.restore(pt)
return nil, ok
}
func (p *parser) parseAnyMatcher(any *anyMatcher) (interface{}, bool) {
if p.pt.rn == utf8.RuneError && p.pt.w == 0 {
// EOF - see utf8.DecodeRune
p.failAt(false, p.pt.position, ".")
return nil, false
}
start := p.pt
p.read()
p.failAt(true, start.position, ".")
return p.sliceFrom(start), true
}
func (p *parser) parseCharClassMatcher(chr *charClassMatcher) (interface{}, bool) {
cur := p.pt.rn
start := p.pt
// can't match EOF
if cur == utf8.RuneError && p.pt.w == 0 { // see utf8.DecodeRune
p.failAt(false, start.position, chr.val)
return nil, false
}
if chr.ignoreCase {
cur = unicode.ToLower(cur)
}
// try to match in the list of available chars
for _, rn := range chr.chars {
if rn == cur {
if chr.inverted {
p.failAt(false, start.position, chr.val)
return nil, false
}
p.read()
p.failAt(true, start.position, chr.val)
return p.sliceFrom(start), true
}
}
// try to match in the list of ranges
for i := 0; i < len(chr.ranges); i += 2 {
if cur >= chr.ranges[i] && cur <= chr.ranges[i+1] {
if chr.inverted {
p.failAt(false, start.position, chr.val)
return nil, false
}
p.read()
p.failAt(true, start.position, chr.val)
return p.sliceFrom(start), true
}
}
// try to match in the list of Unicode classes
for _, cl := range chr.classes {
if unicode.Is(cl, cur) {
if chr.inverted {
p.failAt(false, start.position, chr.val)
return nil, false
}
p.read()
p.failAt(true, start.position, chr.val)
return p.sliceFrom(start), true
}
}
if chr.inverted {
p.read()
p.failAt(true, start.position, chr.val)
return p.sliceFrom(start), true
}
p.failAt(false, start.position, chr.val)
return nil, false
}
func (p *parser) parseChoiceExpr(ch *choiceExpr) (interface{}, bool) {
for altI, alt := range ch.alternatives {
// dummy assignment to prevent compile error if optimized
_ = altI
p.pushV()
val, ok := p.parseExpr(alt)
p.popV()
if ok {
return val, ok
}
}
return nil, false
}
func (p *parser) parseLabeledExpr(lab *labeledExpr) (interface{}, bool) {
p.pushV()
val, ok := p.parseExpr(lab.expr)
p.popV()
if ok && lab.label != "" {
m := p.vstack[len(p.vstack)-1]
m[lab.label] = val
}
return val, ok
}
func (p *parser) parseLitMatcher(lit *litMatcher) (interface{}, bool) {
ignoreCase := ""
if lit.ignoreCase {
ignoreCase = "i"
}
val := fmt.Sprintf("%q%s", lit.val, ignoreCase)
start := p.pt
for _, want := range lit.val {
cur := p.pt.rn
if lit.ignoreCase {
cur = unicode.ToLower(cur)
}
if cur != want {
p.failAt(false, start.position, val)
p.restore(start)
return nil, false
}
p.read()
}
p.failAt(true, start.position, val)
return p.sliceFrom(start), true
}
func (p *parser) parseNotCodeExpr(not *notCodeExpr) (interface{}, bool) {
ok, err := not.run(p)
if err != nil {
p.addErr(err)
}
return nil, !ok
}
func (p *parser) parseNotExpr(not *notExpr) (interface{}, bool) {
pt := p.pt
p.pushV()
p.maxFailInvertExpected = !p.maxFailInvertExpected
_, ok := p.parseExpr(not.expr)
p.maxFailInvertExpected = !p.maxFailInvertExpected
p.popV()
p.restore(pt)
return nil, !ok
}
func (p *parser) parseOneOrMoreExpr(expr *oneOrMoreExpr) (interface{}, bool) {
var vals []interface{}
for {
p.pushV()
val, ok := p.parseExpr(expr.expr)
p.popV()
if !ok {
if len(vals) == 0 {
// did not match once, no match
return nil, false
}
return vals, true
}
vals = append(vals, val)
}
}
func (p *parser) parseRecoveryExpr(recover *recoveryExpr) (interface{}, bool) {
p.pushRecovery(recover.failureLabel, recover.recoverExpr)
val, ok := p.parseExpr(recover.expr)
p.popRecovery()
return val, ok
}
func (p *parser) parseRuleRefExpr(ref *ruleRefExpr) (interface{}, bool) {
if ref.name == "" {
panic(fmt.Sprintf("%s: invalid rule: missing name", ref.pos))
}
rule := p.rules[ref.name]
if rule == nil {
p.addErr(fmt.Errorf("undefined rule: %s", ref.name))
return nil, false
}
return p.parseRule(rule)
}
func (p *parser) parseSeqExpr(seq *seqExpr) (interface{}, bool) {
vals := make([]interface{}, 0, len(seq.exprs))
pt := p.pt
for _, expr := range seq.exprs {
val, ok := p.parseExpr(expr)
if !ok {
p.restore(pt)
return nil, false
}
vals = append(vals, val)
}
return vals, true
}
func (p *parser) parseThrowExpr(expr *throwExpr) (interface{}, bool) {
for i := len(p.recoveryStack) - 1; i >= 0; i-- {
if recoverExpr, ok := p.recoveryStack[i][expr.label]; ok {
if val, ok := p.parseExpr(recoverExpr); ok {
return val, ok
}
}
}
return nil, false
}
func (p *parser) parseZeroOrMoreExpr(expr *zeroOrMoreExpr) (interface{}, bool) {
var vals []interface{}
for {
p.pushV()
val, ok := p.parseExpr(expr.expr)
p.popV()
if !ok {
return vals, true
}
vals = append(vals, val)
}
}
func (p *parser) parseZeroOrOneExpr(expr *zeroOrOneExpr) (interface{}, bool) {
p.pushV()
val, _ := p.parseExpr(expr.expr)
p.popV()
// whether it matched or not, consider it a match
return val, true
}
func rangeTable(class string) *unicode.RangeTable {
if rt, ok := unicode.Categories[class]; ok {
return rt
}
if rt, ok := unicode.Properties[class]; ok {
return rt
}
if rt, ok := unicode.Scripts[class]; ok {
return rt
}
// cannot happen
panic(fmt.Sprintf("invalid Unicode class: %s", class))
}