From b53f25480843556f6959a86fcdaa2e127bc78333 Mon Sep 17 00:00:00 2001 From: aswan Date: Wed, 18 Mar 2020 13:06:27 -0600 Subject: [PATCH] Function calls (#429) This is mostly the framework for calling functions. It includes the implementation of one function: Math.sqrt(). Additional functions to be added in subsequent PRs. --- ast/ast.go | 7 + expr/expr.go | 34 ++ expr/expr_test.go | 2 +- expr/functions.go | 46 ++ expr/functions_test.go | 27 + zql/parser-support.go | 13 + zql/parser-support.js | 4 + zql/zql.go | 1139 ++++++++++++++++++++++++---------------- zql/zql.js | 982 +++++++++++++++++++++------------- zql/zql.peg | 25 +- 10 files changed, 1427 insertions(+), 852 deletions(-) create mode 100644 expr/functions.go create mode 100644 expr/functions_test.go diff --git a/ast/ast.go b/ast/ast.go index b4f8dde53b..82fe07f8e6 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -132,7 +132,14 @@ type BinaryExpression struct { RHS Expression `json:"rhs"` } +type FunctionCall struct { + Node + Function string `json:"function"` + Args []Expression `json:"args"` +} + func (*BinaryExpression) exprNode() {} +func (*FunctionCall) exprNode() {} func (*Literal) exprNode() {} func (*FieldRead) exprNode() {} diff --git a/expr/expr.go b/expr/expr.go index 3c34989854..7a9dadfe9e 100644 --- a/expr/expr.go +++ b/expr/expr.go @@ -17,6 +17,7 @@ type ExpressionEvaluator func(*zng.Record) (zng.Value, error) var ErrNoSuchField = errors.New("field is not present") var ErrIncompatibleTypes = errors.New("incompatible types") var ErrIndexOutOfBounds = errors.New("array index out of bounds") +var ErrNoSuchFunction = errors.New("no such function") type NativeValue struct { typ zng.Type @@ -275,6 +276,9 @@ func compileNative(node ast.Expression) (NativeEvaluator, error) { return nil, fmt.Errorf("invalid binary operator %s", n.Operator) } + case *ast.FunctionCall: + return compileFunctionCall(*n) + default: return nil, fmt.Errorf("invalid expression type %T", node) } @@ -912,3 +916,33 @@ func compileFieldReference(lhsFunc, rhsFunc NativeEvaluator, operator string) (N return toNativeValue(zng.Value{rType.Columns[idx].Type, zv}) }, nil } + +func compileFunctionCall(node ast.FunctionCall) (NativeEvaluator, error) { + fn := allFns[node.Function] + if fn == nil { + return nil, fmt.Errorf("%s: %w", node.Function, ErrNoSuchFunction) + } + + nargs := len(node.Args) + exprs := make([]NativeEvaluator, nargs) + for i, expr := range node.Args { + eval, err := compileNative(expr) + if err != nil { + return nil, err + } + exprs[i] = eval + } + + return func(r *zng.Record) (NativeValue, error) { + args := make([]NativeValue, 0, nargs) + for _, a := range exprs { + val, err := a(r) + if err != nil { + return NativeValue{}, err + } + args = append(args, val) + } + + return fn(args) + }, nil +} diff --git a/expr/expr_test.go b/expr/expr_test.go index d7f890ced1..edf9fc459f 100644 --- a/expr/expr_test.go +++ b/expr/expr_test.go @@ -85,7 +85,7 @@ func testError(t *testing.T, e string, record *zng.Record, expectErr error, desc t.Run(description, func(t *testing.T) { _, err := evaluate(e, record) assert.Errorf(t, err, "got error when %s", description) - assert.Equalf(t, expectErr, err, "got correct error when %s", description) + assert.True(t, errors.Is(err, expectErr), "got correct error when %s", description) }) } diff --git a/expr/functions.go b/expr/functions.go new file mode 100644 index 0000000000..46699fc222 --- /dev/null +++ b/expr/functions.go @@ -0,0 +1,46 @@ +package expr + +import ( + "errors" + "fmt" + "math" + + "github.com/brimsec/zq/zng" +) + +type Function func([]NativeValue) (NativeValue, error) + +var ErrWrongArgc = errors.New("wrong number of arguments") +var ErrBadArgument = errors.New("bad argument") + +var allFns = map[string]Function{ + "Math.sqrt": mathSqrt, +} + +func mathSqrt(args []NativeValue) (NativeValue, error) { + if len(args) < 1 || len(args) > 1 { + return NativeValue{}, fmt.Errorf("Math.sqrt: %w", ErrWrongArgc) + } + + var x float64 + switch args[0].typ.ID() { + case zng.IdFloat64: + x = args[0].value.(float64) + case zng.IdInt16, zng.IdInt32, zng.IdInt64: + x = float64(args[0].value.(int64)) + case zng.IdByte, zng.IdUint16, zng.IdUint32, zng.IdUint64: + x = float64(args[0].value.(uint64)) + default: + return NativeValue{}, fmt.Errorf("Math.sqrt: %w", ErrBadArgument) + } + + r := math.Sqrt(x) + if math.IsNaN(r) { + // For now we can't represent non-numeric values in a float64, + // we will revisit this but it has implications for file + // formats, zql, etc. + return NativeValue{}, fmt.Errorf("Math.sqrt: %w", ErrBadArgument) + } + + return NativeValue{zng.TypeFloat64, r}, nil +} diff --git a/expr/functions_test.go b/expr/functions_test.go new file mode 100644 index 0000000000..578a0afd0f --- /dev/null +++ b/expr/functions_test.go @@ -0,0 +1,27 @@ +package expr_test + +import ( + "testing" + + "github.com/brimsec/zq/expr" + "github.com/stretchr/testify/require" +) + +func TestBadFunction(t *testing.T) { + testError(t, "notafunction()", nil, expr.ErrNoSuchFunction, "calling nonexistent function") +} + +func TestSqrt(t *testing.T) { + record, err := parseOneRecord(` +#0:record[f:float64,i:int32] +0:[6.25;9;]`) + require.NoError(t, err) + + testSuccessful(t, "Math.sqrt(4.0)", record, zfloat64(2.0)) + testSuccessful(t, "Math.sqrt(f)", record, zfloat64(2.5)) + testSuccessful(t, "Math.sqrt(i)", record, zfloat64(3.0)) + + testError(t, "Math.sqrt()", record, expr.ErrWrongArgc, "sqrt with no args") + testError(t, "Math.sqrt(1, 2)", record, expr.ErrWrongArgc, "sqrt with too many args") + testError(t, "Math.sqrt(-1)", record, expr.ErrBadArgument, "sqrt of negative") +} diff --git a/zql/parser-support.go b/zql/parser-support.go index d970500ba5..1b69932083 100644 --- a/zql/parser-support.go +++ b/zql/parser-support.go @@ -312,6 +312,19 @@ func makeBinaryExprChain(firstIn, restIn interface{}) ast.Expression { return result } +func makeFunctionCall(fn, argsIn interface{}) ast.Expression { + argArray := argsIn.([]interface{}) + args := make([]ast.Expression, len(argArray)) + for i, a := range argArray { + args[i] = a.(ast.Expression) + } + return &ast.FunctionCall{ + ast.Node{"FunctionCall"}, + fn.(string), + args, + } +} + func joinChars(in interface{}) string { str := bytes.Buffer{} for _, i := range in.([]interface{}) { diff --git a/zql/parser-support.js b/zql/parser-support.js index b21dea7fd3..4f2f3a8078 100644 --- a/zql/parser-support.js +++ b/zql/parser-support.js @@ -116,6 +116,10 @@ function makeBinaryExprChain(first, rest) { return ret } +function makeFunctionCall(fn, args) { + return { op: "FunctionCall", function: fn, args }; +} + function joinChars(chars) { return chars.join(""); } diff --git a/zql/zql.go b/zql/zql.go index 292a3a80a8..832f141744 100644 --- a/zql/zql.go +++ b/zql/zql.go @@ -3442,96 +3442,267 @@ var g = &grammar{ }, { name: "CallExpression", - pos: position{line: 468, col: 1, offset: 11803}, - expr: &ruleRefExpr{ - pos: position{line: 468, col: 18, offset: 11820}, - name: "DereferenceExpression", + pos: position{line: 466, col: 1, offset: 11801}, + expr: &choiceExpr{ + pos: position{line: 467, col: 5, offset: 11820}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 467, col: 5, offset: 11820}, + run: (*parser).callonCallExpression2, + expr: &seqExpr{ + pos: position{line: 467, col: 5, offset: 11820}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 467, col: 5, offset: 11820}, + label: "fn", + expr: &ruleRefExpr{ + pos: position{line: 467, col: 8, offset: 11823}, + name: "FunctionName", + }, + }, + &ruleRefExpr{ + pos: position{line: 467, col: 21, offset: 11836}, + name: "__", + }, + &litMatcher{ + pos: position{line: 467, col: 24, offset: 11839}, + val: "(", + ignoreCase: false, + }, + &labeledExpr{ + pos: position{line: 467, col: 28, offset: 11843}, + label: "args", + expr: &ruleRefExpr{ + pos: position{line: 467, col: 33, offset: 11848}, + name: "ArgumentList", + }, + }, + &litMatcher{ + pos: position{line: 467, col: 46, offset: 11861}, + val: ")", + ignoreCase: false, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 470, col: 5, offset: 11924}, + name: "DereferenceExpression", + }, + }, + }, + }, + { + name: "FunctionName", + pos: position{line: 472, col: 1, offset: 11947}, + expr: &actionExpr{ + pos: position{line: 473, col: 5, offset: 11964}, + run: (*parser).callonFunctionName1, + expr: &seqExpr{ + pos: position{line: 473, col: 5, offset: 11964}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 473, col: 5, offset: 11964}, + name: "FunctionNameStart", + }, + &zeroOrMoreExpr{ + pos: position{line: 473, col: 23, offset: 11982}, + expr: &ruleRefExpr{ + pos: position{line: 473, col: 23, offset: 11982}, + name: "FunctionNameRest", + }, + }, + }, + }, + }, + }, + { + name: "FunctionNameStart", + pos: position{line: 475, col: 1, offset: 12032}, + expr: &charClassMatcher{ + pos: position{line: 475, col: 21, offset: 12052}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + { + name: "FunctionNameRest", + pos: position{line: 476, col: 1, offset: 12061}, + expr: &choiceExpr{ + pos: position{line: 476, col: 20, offset: 12080}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 476, col: 20, offset: 12080}, + name: "FunctionNameStart", + }, + &charClassMatcher{ + pos: position{line: 476, col: 40, offset: 12100}, + val: "[.0-9]", + chars: []rune{'.'}, + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + { + name: "ArgumentList", + pos: position{line: 478, col: 1, offset: 12108}, + expr: &choiceExpr{ + pos: position{line: 479, col: 5, offset: 12125}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 479, col: 5, offset: 12125}, + run: (*parser).callonArgumentList2, + expr: &seqExpr{ + pos: position{line: 479, col: 5, offset: 12125}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 479, col: 5, offset: 12125}, + label: "first", + expr: &ruleRefExpr{ + pos: position{line: 479, col: 11, offset: 12131}, + name: "Expression", + }, + }, + &labeledExpr{ + pos: position{line: 479, col: 22, offset: 12142}, + label: "rest", + expr: &zeroOrMoreExpr{ + pos: position{line: 479, col: 27, offset: 12147}, + expr: &actionExpr{ + pos: position{line: 479, col: 28, offset: 12148}, + run: (*parser).callonArgumentList8, + expr: &seqExpr{ + pos: position{line: 479, col: 28, offset: 12148}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 479, col: 28, offset: 12148}, + name: "__", + }, + &litMatcher{ + pos: position{line: 479, col: 31, offset: 12151}, + val: ",", + ignoreCase: false, + }, + &ruleRefExpr{ + pos: position{line: 479, col: 35, offset: 12155}, + name: "__", + }, + &labeledExpr{ + pos: position{line: 479, col: 38, offset: 12158}, + label: "e", + expr: &ruleRefExpr{ + pos: position{line: 479, col: 40, offset: 12160}, + name: "Expression", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 482, col: 5, offset: 12276}, + run: (*parser).callonArgumentList15, + expr: &ruleRefExpr{ + pos: position{line: 482, col: 5, offset: 12276}, + name: "__", + }, + }, + }, }, }, { name: "DereferenceExpression", - pos: position{line: 472, col: 1, offset: 11845}, + pos: position{line: 484, col: 1, offset: 12312}, expr: &actionExpr{ - pos: position{line: 473, col: 5, offset: 11871}, + pos: position{line: 485, col: 5, offset: 12338}, run: (*parser).callonDereferenceExpression1, expr: &seqExpr{ - pos: position{line: 473, col: 5, offset: 11871}, + pos: position{line: 485, col: 5, offset: 12338}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 473, col: 5, offset: 11871}, + pos: position{line: 485, col: 5, offset: 12338}, label: "base", expr: &ruleRefExpr{ - pos: position{line: 473, col: 10, offset: 11876}, + pos: position{line: 485, col: 10, offset: 12343}, name: "PrimaryExpression", }, }, &labeledExpr{ - pos: position{line: 474, col: 5, offset: 11898}, + pos: position{line: 486, col: 5, offset: 12365}, label: "derefs", expr: &zeroOrMoreExpr{ - pos: position{line: 474, col: 12, offset: 11905}, + pos: position{line: 486, col: 12, offset: 12372}, expr: &choiceExpr{ - pos: position{line: 475, col: 9, offset: 11915}, + pos: position{line: 487, col: 9, offset: 12382}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 475, col: 9, offset: 11915}, + pos: position{line: 487, col: 9, offset: 12382}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 475, col: 9, offset: 11915}, + pos: position{line: 487, col: 9, offset: 12382}, name: "__", }, &litMatcher{ - pos: position{line: 475, col: 12, offset: 11918}, + pos: position{line: 487, col: 12, offset: 12385}, val: "[", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 475, col: 16, offset: 11922}, + pos: position{line: 487, col: 16, offset: 12389}, name: "__", }, &labeledExpr{ - pos: position{line: 475, col: 19, offset: 11925}, + pos: position{line: 487, col: 19, offset: 12392}, label: "index", expr: &ruleRefExpr{ - pos: position{line: 475, col: 25, offset: 11931}, + pos: position{line: 487, col: 25, offset: 12398}, name: "Expression", }, }, &ruleRefExpr{ - pos: position{line: 475, col: 36, offset: 11942}, + pos: position{line: 487, col: 36, offset: 12409}, name: "__", }, &litMatcher{ - pos: position{line: 475, col: 39, offset: 11945}, + pos: position{line: 487, col: 39, offset: 12412}, val: "]", ignoreCase: false, }, }, }, &seqExpr{ - pos: position{line: 476, col: 9, offset: 11957}, + pos: position{line: 488, col: 9, offset: 12424}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 476, col: 9, offset: 11957}, + pos: position{line: 488, col: 9, offset: 12424}, name: "__", }, &litMatcher{ - pos: position{line: 476, col: 12, offset: 11960}, + pos: position{line: 488, col: 12, offset: 12427}, val: ".", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 476, col: 16, offset: 11964}, + pos: position{line: 488, col: 16, offset: 12431}, name: "__", }, &actionExpr{ - pos: position{line: 476, col: 20, offset: 11968}, + pos: position{line: 488, col: 20, offset: 12435}, run: (*parser).callonDereferenceExpression20, expr: &labeledExpr{ - pos: position{line: 476, col: 20, offset: 11968}, + pos: position{line: 488, col: 20, offset: 12435}, label: "field", expr: &ruleRefExpr{ - pos: position{line: 476, col: 26, offset: 11974}, + pos: position{line: 488, col: 26, offset: 12441}, name: "fieldName", }, }, @@ -3548,54 +3719,54 @@ var g = &grammar{ }, { name: "duration", - pos: position{line: 481, col: 1, offset: 12109}, + pos: position{line: 493, col: 1, offset: 12576}, expr: &choiceExpr{ - pos: position{line: 482, col: 5, offset: 12122}, + pos: position{line: 494, col: 5, offset: 12589}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 482, col: 5, offset: 12122}, + pos: position{line: 494, col: 5, offset: 12589}, name: "seconds", }, &ruleRefExpr{ - pos: position{line: 483, col: 5, offset: 12134}, + pos: position{line: 495, col: 5, offset: 12601}, name: "minutes", }, &ruleRefExpr{ - pos: position{line: 484, col: 5, offset: 12146}, + pos: position{line: 496, col: 5, offset: 12613}, name: "hours", }, &seqExpr{ - pos: position{line: 485, col: 5, offset: 12156}, + pos: position{line: 497, col: 5, offset: 12623}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 485, col: 5, offset: 12156}, + pos: position{line: 497, col: 5, offset: 12623}, name: "hours", }, &ruleRefExpr{ - pos: position{line: 485, col: 11, offset: 12162}, + pos: position{line: 497, col: 11, offset: 12629}, name: "_", }, &litMatcher{ - pos: position{line: 485, col: 13, offset: 12164}, + pos: position{line: 497, col: 13, offset: 12631}, val: "and", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 485, col: 19, offset: 12170}, + pos: position{line: 497, col: 19, offset: 12637}, name: "_", }, &ruleRefExpr{ - pos: position{line: 485, col: 21, offset: 12172}, + pos: position{line: 497, col: 21, offset: 12639}, name: "minutes", }, }, }, &ruleRefExpr{ - pos: position{line: 486, col: 5, offset: 12184}, + pos: position{line: 498, col: 5, offset: 12651}, name: "days", }, &ruleRefExpr{ - pos: position{line: 487, col: 5, offset: 12193}, + pos: position{line: 499, col: 5, offset: 12660}, name: "weeks", }, }, @@ -3603,32 +3774,32 @@ var g = &grammar{ }, { name: "sec_abbrev", - pos: position{line: 489, col: 1, offset: 12200}, + pos: position{line: 501, col: 1, offset: 12667}, expr: &choiceExpr{ - pos: position{line: 490, col: 5, offset: 12215}, + pos: position{line: 502, col: 5, offset: 12682}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 490, col: 5, offset: 12215}, + pos: position{line: 502, col: 5, offset: 12682}, val: "seconds", ignoreCase: false, }, &litMatcher{ - pos: position{line: 491, col: 5, offset: 12229}, + pos: position{line: 503, col: 5, offset: 12696}, val: "second", ignoreCase: false, }, &litMatcher{ - pos: position{line: 492, col: 5, offset: 12242}, + pos: position{line: 504, col: 5, offset: 12709}, val: "secs", ignoreCase: false, }, &litMatcher{ - pos: position{line: 493, col: 5, offset: 12253}, + pos: position{line: 505, col: 5, offset: 12720}, val: "sec", ignoreCase: false, }, &litMatcher{ - pos: position{line: 494, col: 5, offset: 12263}, + pos: position{line: 506, col: 5, offset: 12730}, val: "s", ignoreCase: false, }, @@ -3637,32 +3808,32 @@ var g = &grammar{ }, { name: "min_abbrev", - pos: position{line: 496, col: 1, offset: 12268}, + pos: position{line: 508, col: 1, offset: 12735}, expr: &choiceExpr{ - pos: position{line: 497, col: 5, offset: 12283}, + pos: position{line: 509, col: 5, offset: 12750}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 497, col: 5, offset: 12283}, + pos: position{line: 509, col: 5, offset: 12750}, val: "minutes", ignoreCase: false, }, &litMatcher{ - pos: position{line: 498, col: 5, offset: 12297}, + pos: position{line: 510, col: 5, offset: 12764}, val: "minute", ignoreCase: false, }, &litMatcher{ - pos: position{line: 499, col: 5, offset: 12310}, + pos: position{line: 511, col: 5, offset: 12777}, val: "mins", ignoreCase: false, }, &litMatcher{ - pos: position{line: 500, col: 5, offset: 12321}, + pos: position{line: 512, col: 5, offset: 12788}, val: "min", ignoreCase: false, }, &litMatcher{ - pos: position{line: 501, col: 5, offset: 12331}, + pos: position{line: 513, col: 5, offset: 12798}, val: "m", ignoreCase: false, }, @@ -3671,32 +3842,32 @@ var g = &grammar{ }, { name: "hour_abbrev", - pos: position{line: 503, col: 1, offset: 12336}, + pos: position{line: 515, col: 1, offset: 12803}, expr: &choiceExpr{ - pos: position{line: 504, col: 5, offset: 12352}, + pos: position{line: 516, col: 5, offset: 12819}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 504, col: 5, offset: 12352}, + pos: position{line: 516, col: 5, offset: 12819}, val: "hours", ignoreCase: false, }, &litMatcher{ - pos: position{line: 505, col: 5, offset: 12364}, + pos: position{line: 517, col: 5, offset: 12831}, val: "hrs", ignoreCase: false, }, &litMatcher{ - pos: position{line: 506, col: 5, offset: 12374}, + pos: position{line: 518, col: 5, offset: 12841}, val: "hr", ignoreCase: false, }, &litMatcher{ - pos: position{line: 507, col: 5, offset: 12383}, + pos: position{line: 519, col: 5, offset: 12850}, val: "h", ignoreCase: false, }, &litMatcher{ - pos: position{line: 508, col: 5, offset: 12391}, + pos: position{line: 520, col: 5, offset: 12858}, val: "hour", ignoreCase: false, }, @@ -3705,22 +3876,22 @@ var g = &grammar{ }, { name: "day_abbrev", - pos: position{line: 510, col: 1, offset: 12399}, + pos: position{line: 522, col: 1, offset: 12866}, expr: &choiceExpr{ - pos: position{line: 510, col: 14, offset: 12412}, + pos: position{line: 522, col: 14, offset: 12879}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 510, col: 14, offset: 12412}, + pos: position{line: 522, col: 14, offset: 12879}, val: "days", ignoreCase: false, }, &litMatcher{ - pos: position{line: 510, col: 21, offset: 12419}, + pos: position{line: 522, col: 21, offset: 12886}, val: "day", ignoreCase: false, }, &litMatcher{ - pos: position{line: 510, col: 27, offset: 12425}, + pos: position{line: 522, col: 27, offset: 12892}, val: "d", ignoreCase: false, }, @@ -3729,32 +3900,32 @@ var g = &grammar{ }, { name: "week_abbrev", - pos: position{line: 511, col: 1, offset: 12429}, + pos: position{line: 523, col: 1, offset: 12896}, expr: &choiceExpr{ - pos: position{line: 511, col: 15, offset: 12443}, + pos: position{line: 523, col: 15, offset: 12910}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 511, col: 15, offset: 12443}, + pos: position{line: 523, col: 15, offset: 12910}, val: "weeks", ignoreCase: false, }, &litMatcher{ - pos: position{line: 511, col: 23, offset: 12451}, + pos: position{line: 523, col: 23, offset: 12918}, val: "week", ignoreCase: false, }, &litMatcher{ - pos: position{line: 511, col: 30, offset: 12458}, + pos: position{line: 523, col: 30, offset: 12925}, val: "wks", ignoreCase: false, }, &litMatcher{ - pos: position{line: 511, col: 36, offset: 12464}, + pos: position{line: 523, col: 36, offset: 12931}, val: "wk", ignoreCase: false, }, &litMatcher{ - pos: position{line: 511, col: 41, offset: 12469}, + pos: position{line: 523, col: 41, offset: 12936}, val: "w", ignoreCase: false, }, @@ -3763,42 +3934,42 @@ var g = &grammar{ }, { name: "seconds", - pos: position{line: 513, col: 1, offset: 12474}, + pos: position{line: 525, col: 1, offset: 12941}, expr: &choiceExpr{ - pos: position{line: 514, col: 5, offset: 12486}, + pos: position{line: 526, col: 5, offset: 12953}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 514, col: 5, offset: 12486}, + pos: position{line: 526, col: 5, offset: 12953}, run: (*parser).callonseconds2, expr: &litMatcher{ - pos: position{line: 514, col: 5, offset: 12486}, + pos: position{line: 526, col: 5, offset: 12953}, val: "second", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 515, col: 5, offset: 12531}, + pos: position{line: 527, col: 5, offset: 12998}, run: (*parser).callonseconds4, expr: &seqExpr{ - pos: position{line: 515, col: 5, offset: 12531}, + pos: position{line: 527, col: 5, offset: 12998}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 515, col: 5, offset: 12531}, + pos: position{line: 527, col: 5, offset: 12998}, label: "num", expr: &ruleRefExpr{ - pos: position{line: 515, col: 9, offset: 12535}, + pos: position{line: 527, col: 9, offset: 13002}, name: "number", }, }, &zeroOrOneExpr{ - pos: position{line: 515, col: 16, offset: 12542}, + pos: position{line: 527, col: 16, offset: 13009}, expr: &ruleRefExpr{ - pos: position{line: 515, col: 16, offset: 12542}, + pos: position{line: 527, col: 16, offset: 13009}, name: "_", }, }, &ruleRefExpr{ - pos: position{line: 515, col: 19, offset: 12545}, + pos: position{line: 527, col: 19, offset: 13012}, name: "sec_abbrev", }, }, @@ -3809,42 +3980,42 @@ var g = &grammar{ }, { name: "minutes", - pos: position{line: 517, col: 1, offset: 12591}, + pos: position{line: 529, col: 1, offset: 13058}, expr: &choiceExpr{ - pos: position{line: 518, col: 5, offset: 12603}, + pos: position{line: 530, col: 5, offset: 13070}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 518, col: 5, offset: 12603}, + pos: position{line: 530, col: 5, offset: 13070}, run: (*parser).callonminutes2, expr: &litMatcher{ - pos: position{line: 518, col: 5, offset: 12603}, + pos: position{line: 530, col: 5, offset: 13070}, val: "minute", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 519, col: 5, offset: 12649}, + pos: position{line: 531, col: 5, offset: 13116}, run: (*parser).callonminutes4, expr: &seqExpr{ - pos: position{line: 519, col: 5, offset: 12649}, + pos: position{line: 531, col: 5, offset: 13116}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 519, col: 5, offset: 12649}, + pos: position{line: 531, col: 5, offset: 13116}, label: "num", expr: &ruleRefExpr{ - pos: position{line: 519, col: 9, offset: 12653}, + pos: position{line: 531, col: 9, offset: 13120}, name: "number", }, }, &zeroOrOneExpr{ - pos: position{line: 519, col: 16, offset: 12660}, + pos: position{line: 531, col: 16, offset: 13127}, expr: &ruleRefExpr{ - pos: position{line: 519, col: 16, offset: 12660}, + pos: position{line: 531, col: 16, offset: 13127}, name: "_", }, }, &ruleRefExpr{ - pos: position{line: 519, col: 19, offset: 12663}, + pos: position{line: 531, col: 19, offset: 13130}, name: "min_abbrev", }, }, @@ -3855,42 +4026,42 @@ var g = &grammar{ }, { name: "hours", - pos: position{line: 521, col: 1, offset: 12718}, + pos: position{line: 533, col: 1, offset: 13185}, expr: &choiceExpr{ - pos: position{line: 522, col: 5, offset: 12728}, + pos: position{line: 534, col: 5, offset: 13195}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 522, col: 5, offset: 12728}, + pos: position{line: 534, col: 5, offset: 13195}, run: (*parser).callonhours2, expr: &litMatcher{ - pos: position{line: 522, col: 5, offset: 12728}, + pos: position{line: 534, col: 5, offset: 13195}, val: "hour", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 523, col: 5, offset: 12774}, + pos: position{line: 535, col: 5, offset: 13241}, run: (*parser).callonhours4, expr: &seqExpr{ - pos: position{line: 523, col: 5, offset: 12774}, + pos: position{line: 535, col: 5, offset: 13241}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 523, col: 5, offset: 12774}, + pos: position{line: 535, col: 5, offset: 13241}, label: "num", expr: &ruleRefExpr{ - pos: position{line: 523, col: 9, offset: 12778}, + pos: position{line: 535, col: 9, offset: 13245}, name: "number", }, }, &zeroOrOneExpr{ - pos: position{line: 523, col: 16, offset: 12785}, + pos: position{line: 535, col: 16, offset: 13252}, expr: &ruleRefExpr{ - pos: position{line: 523, col: 16, offset: 12785}, + pos: position{line: 535, col: 16, offset: 13252}, name: "_", }, }, &ruleRefExpr{ - pos: position{line: 523, col: 19, offset: 12788}, + pos: position{line: 535, col: 19, offset: 13255}, name: "hour_abbrev", }, }, @@ -3901,42 +4072,42 @@ var g = &grammar{ }, { name: "days", - pos: position{line: 525, col: 1, offset: 12846}, + pos: position{line: 537, col: 1, offset: 13313}, expr: &choiceExpr{ - pos: position{line: 526, col: 5, offset: 12855}, + pos: position{line: 538, col: 5, offset: 13322}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 526, col: 5, offset: 12855}, + pos: position{line: 538, col: 5, offset: 13322}, run: (*parser).callondays2, expr: &litMatcher{ - pos: position{line: 526, col: 5, offset: 12855}, + pos: position{line: 538, col: 5, offset: 13322}, val: "day", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 527, col: 5, offset: 12903}, + pos: position{line: 539, col: 5, offset: 13370}, run: (*parser).callondays4, expr: &seqExpr{ - pos: position{line: 527, col: 5, offset: 12903}, + pos: position{line: 539, col: 5, offset: 13370}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 527, col: 5, offset: 12903}, + pos: position{line: 539, col: 5, offset: 13370}, label: "num", expr: &ruleRefExpr{ - pos: position{line: 527, col: 9, offset: 12907}, + pos: position{line: 539, col: 9, offset: 13374}, name: "number", }, }, &zeroOrOneExpr{ - pos: position{line: 527, col: 16, offset: 12914}, + pos: position{line: 539, col: 16, offset: 13381}, expr: &ruleRefExpr{ - pos: position{line: 527, col: 16, offset: 12914}, + pos: position{line: 539, col: 16, offset: 13381}, name: "_", }, }, &ruleRefExpr{ - pos: position{line: 527, col: 19, offset: 12917}, + pos: position{line: 539, col: 19, offset: 13384}, name: "day_abbrev", }, }, @@ -3947,30 +4118,30 @@ var g = &grammar{ }, { name: "weeks", - pos: position{line: 529, col: 1, offset: 12977}, + pos: position{line: 541, col: 1, offset: 13444}, expr: &actionExpr{ - pos: position{line: 530, col: 5, offset: 12987}, + pos: position{line: 542, col: 5, offset: 13454}, run: (*parser).callonweeks1, expr: &seqExpr{ - pos: position{line: 530, col: 5, offset: 12987}, + pos: position{line: 542, col: 5, offset: 13454}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 530, col: 5, offset: 12987}, + pos: position{line: 542, col: 5, offset: 13454}, label: "num", expr: &ruleRefExpr{ - pos: position{line: 530, col: 9, offset: 12991}, + pos: position{line: 542, col: 9, offset: 13458}, name: "number", }, }, &zeroOrOneExpr{ - pos: position{line: 530, col: 16, offset: 12998}, + pos: position{line: 542, col: 16, offset: 13465}, expr: &ruleRefExpr{ - pos: position{line: 530, col: 16, offset: 12998}, + pos: position{line: 542, col: 16, offset: 13465}, name: "_", }, }, &ruleRefExpr{ - pos: position{line: 530, col: 19, offset: 13001}, + pos: position{line: 542, col: 19, offset: 13468}, name: "week_abbrev", }, }, @@ -3979,53 +4150,53 @@ var g = &grammar{ }, { name: "number", - pos: position{line: 532, col: 1, offset: 13064}, + pos: position{line: 544, col: 1, offset: 13531}, expr: &ruleRefExpr{ - pos: position{line: 532, col: 10, offset: 13073}, + pos: position{line: 544, col: 10, offset: 13540}, name: "unsignedInteger", }, }, { name: "addr", - pos: position{line: 536, col: 1, offset: 13119}, + pos: position{line: 548, col: 1, offset: 13586}, expr: &actionExpr{ - pos: position{line: 537, col: 5, offset: 13128}, + pos: position{line: 549, col: 5, offset: 13595}, run: (*parser).callonaddr1, expr: &labeledExpr{ - pos: position{line: 537, col: 5, offset: 13128}, + pos: position{line: 549, col: 5, offset: 13595}, label: "a", expr: &seqExpr{ - pos: position{line: 537, col: 8, offset: 13131}, + pos: position{line: 549, col: 8, offset: 13598}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 537, col: 8, offset: 13131}, + pos: position{line: 549, col: 8, offset: 13598}, name: "unsignedInteger", }, &litMatcher{ - pos: position{line: 537, col: 24, offset: 13147}, + pos: position{line: 549, col: 24, offset: 13614}, val: ".", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 537, col: 28, offset: 13151}, + pos: position{line: 549, col: 28, offset: 13618}, name: "unsignedInteger", }, &litMatcher{ - pos: position{line: 537, col: 44, offset: 13167}, + pos: position{line: 549, col: 44, offset: 13634}, val: ".", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 537, col: 48, offset: 13171}, + pos: position{line: 549, col: 48, offset: 13638}, name: "unsignedInteger", }, &litMatcher{ - pos: position{line: 537, col: 64, offset: 13187}, + pos: position{line: 549, col: 64, offset: 13654}, val: ".", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 537, col: 68, offset: 13191}, + pos: position{line: 549, col: 68, offset: 13658}, name: "unsignedInteger", }, }, @@ -4035,23 +4206,23 @@ var g = &grammar{ }, { name: "port", - pos: position{line: 539, col: 1, offset: 13240}, + pos: position{line: 551, col: 1, offset: 13707}, expr: &actionExpr{ - pos: position{line: 540, col: 5, offset: 13249}, + pos: position{line: 552, col: 5, offset: 13716}, run: (*parser).callonport1, expr: &seqExpr{ - pos: position{line: 540, col: 5, offset: 13249}, + pos: position{line: 552, col: 5, offset: 13716}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 540, col: 5, offset: 13249}, + pos: position{line: 552, col: 5, offset: 13716}, val: ":", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 540, col: 9, offset: 13253}, + pos: position{line: 552, col: 9, offset: 13720}, label: "v", expr: &ruleRefExpr{ - pos: position{line: 540, col: 11, offset: 13255}, + pos: position{line: 552, col: 11, offset: 13722}, name: "suint", }, }, @@ -4061,32 +4232,32 @@ var g = &grammar{ }, { name: "ip6addr", - pos: position{line: 544, col: 1, offset: 13411}, + pos: position{line: 556, col: 1, offset: 13878}, expr: &choiceExpr{ - pos: position{line: 545, col: 5, offset: 13423}, + pos: position{line: 557, col: 5, offset: 13890}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 545, col: 5, offset: 13423}, + pos: position{line: 557, col: 5, offset: 13890}, run: (*parser).callonip6addr2, expr: &seqExpr{ - pos: position{line: 545, col: 5, offset: 13423}, + pos: position{line: 557, col: 5, offset: 13890}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 545, col: 5, offset: 13423}, + pos: position{line: 557, col: 5, offset: 13890}, label: "a", expr: &oneOrMoreExpr{ - pos: position{line: 545, col: 7, offset: 13425}, + pos: position{line: 557, col: 7, offset: 13892}, expr: &ruleRefExpr{ - pos: position{line: 545, col: 8, offset: 13426}, + pos: position{line: 557, col: 8, offset: 13893}, name: "h_prepend", }, }, }, &labeledExpr{ - pos: position{line: 545, col: 20, offset: 13438}, + pos: position{line: 557, col: 20, offset: 13905}, label: "b", expr: &ruleRefExpr{ - pos: position{line: 545, col: 22, offset: 13440}, + pos: position{line: 557, col: 22, offset: 13907}, name: "ip6tail", }, }, @@ -4094,51 +4265,51 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 548, col: 5, offset: 13504}, + pos: position{line: 560, col: 5, offset: 13971}, run: (*parser).callonip6addr9, expr: &seqExpr{ - pos: position{line: 548, col: 5, offset: 13504}, + pos: position{line: 560, col: 5, offset: 13971}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 548, col: 5, offset: 13504}, + pos: position{line: 560, col: 5, offset: 13971}, label: "a", expr: &ruleRefExpr{ - pos: position{line: 548, col: 7, offset: 13506}, + pos: position{line: 560, col: 7, offset: 13973}, name: "h16", }, }, &labeledExpr{ - pos: position{line: 548, col: 11, offset: 13510}, + pos: position{line: 560, col: 11, offset: 13977}, label: "b", expr: &zeroOrMoreExpr{ - pos: position{line: 548, col: 13, offset: 13512}, + pos: position{line: 560, col: 13, offset: 13979}, expr: &ruleRefExpr{ - pos: position{line: 548, col: 14, offset: 13513}, + pos: position{line: 560, col: 14, offset: 13980}, name: "h_append", }, }, }, &litMatcher{ - pos: position{line: 548, col: 25, offset: 13524}, + pos: position{line: 560, col: 25, offset: 13991}, val: "::", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 548, col: 30, offset: 13529}, + pos: position{line: 560, col: 30, offset: 13996}, label: "d", expr: &zeroOrMoreExpr{ - pos: position{line: 548, col: 32, offset: 13531}, + pos: position{line: 560, col: 32, offset: 13998}, expr: &ruleRefExpr{ - pos: position{line: 548, col: 33, offset: 13532}, + pos: position{line: 560, col: 33, offset: 13999}, name: "h_prepend", }, }, }, &labeledExpr{ - pos: position{line: 548, col: 45, offset: 13544}, + pos: position{line: 560, col: 45, offset: 14011}, label: "e", expr: &ruleRefExpr{ - pos: position{line: 548, col: 47, offset: 13546}, + pos: position{line: 560, col: 47, offset: 14013}, name: "ip6tail", }, }, @@ -4146,32 +4317,32 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 551, col: 5, offset: 13645}, + pos: position{line: 563, col: 5, offset: 14112}, run: (*parser).callonip6addr22, expr: &seqExpr{ - pos: position{line: 551, col: 5, offset: 13645}, + pos: position{line: 563, col: 5, offset: 14112}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 551, col: 5, offset: 13645}, + pos: position{line: 563, col: 5, offset: 14112}, val: "::", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 551, col: 10, offset: 13650}, + pos: position{line: 563, col: 10, offset: 14117}, label: "a", expr: &zeroOrMoreExpr{ - pos: position{line: 551, col: 12, offset: 13652}, + pos: position{line: 563, col: 12, offset: 14119}, expr: &ruleRefExpr{ - pos: position{line: 551, col: 13, offset: 13653}, + pos: position{line: 563, col: 13, offset: 14120}, name: "h_prepend", }, }, }, &labeledExpr{ - pos: position{line: 551, col: 25, offset: 13665}, + pos: position{line: 563, col: 25, offset: 14132}, label: "b", expr: &ruleRefExpr{ - pos: position{line: 551, col: 27, offset: 13667}, + pos: position{line: 563, col: 27, offset: 14134}, name: "ip6tail", }, }, @@ -4179,32 +4350,32 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 554, col: 5, offset: 13738}, + pos: position{line: 566, col: 5, offset: 14205}, run: (*parser).callonip6addr30, expr: &seqExpr{ - pos: position{line: 554, col: 5, offset: 13738}, + pos: position{line: 566, col: 5, offset: 14205}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 554, col: 5, offset: 13738}, + pos: position{line: 566, col: 5, offset: 14205}, label: "a", expr: &ruleRefExpr{ - pos: position{line: 554, col: 7, offset: 13740}, + pos: position{line: 566, col: 7, offset: 14207}, name: "h16", }, }, &labeledExpr{ - pos: position{line: 554, col: 11, offset: 13744}, + pos: position{line: 566, col: 11, offset: 14211}, label: "b", expr: &zeroOrMoreExpr{ - pos: position{line: 554, col: 13, offset: 13746}, + pos: position{line: 566, col: 13, offset: 14213}, expr: &ruleRefExpr{ - pos: position{line: 554, col: 14, offset: 13747}, + pos: position{line: 566, col: 14, offset: 14214}, name: "h_append", }, }, }, &litMatcher{ - pos: position{line: 554, col: 25, offset: 13758}, + pos: position{line: 566, col: 25, offset: 14225}, val: "::", ignoreCase: false, }, @@ -4212,10 +4383,10 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 557, col: 5, offset: 13826}, + pos: position{line: 569, col: 5, offset: 14293}, run: (*parser).callonip6addr38, expr: &litMatcher{ - pos: position{line: 557, col: 5, offset: 13826}, + pos: position{line: 569, col: 5, offset: 14293}, val: "::", ignoreCase: false, }, @@ -4225,16 +4396,16 @@ var g = &grammar{ }, { name: "ip6tail", - pos: position{line: 561, col: 1, offset: 13863}, + pos: position{line: 573, col: 1, offset: 14330}, expr: &choiceExpr{ - pos: position{line: 562, col: 5, offset: 13875}, + pos: position{line: 574, col: 5, offset: 14342}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 562, col: 5, offset: 13875}, + pos: position{line: 574, col: 5, offset: 14342}, name: "addr", }, &ruleRefExpr{ - pos: position{line: 563, col: 5, offset: 13884}, + pos: position{line: 575, col: 5, offset: 14351}, name: "h16", }, }, @@ -4242,23 +4413,23 @@ var g = &grammar{ }, { name: "h_append", - pos: position{line: 565, col: 1, offset: 13889}, + pos: position{line: 577, col: 1, offset: 14356}, expr: &actionExpr{ - pos: position{line: 565, col: 12, offset: 13900}, + pos: position{line: 577, col: 12, offset: 14367}, run: (*parser).callonh_append1, expr: &seqExpr{ - pos: position{line: 565, col: 12, offset: 13900}, + pos: position{line: 577, col: 12, offset: 14367}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 565, col: 12, offset: 13900}, + pos: position{line: 577, col: 12, offset: 14367}, val: ":", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 565, col: 16, offset: 13904}, + pos: position{line: 577, col: 16, offset: 14371}, label: "v", expr: &ruleRefExpr{ - pos: position{line: 565, col: 18, offset: 13906}, + pos: position{line: 577, col: 18, offset: 14373}, name: "h16", }, }, @@ -4268,23 +4439,23 @@ var g = &grammar{ }, { name: "h_prepend", - pos: position{line: 566, col: 1, offset: 13943}, + pos: position{line: 578, col: 1, offset: 14410}, expr: &actionExpr{ - pos: position{line: 566, col: 13, offset: 13955}, + pos: position{line: 578, col: 13, offset: 14422}, run: (*parser).callonh_prepend1, expr: &seqExpr{ - pos: position{line: 566, col: 13, offset: 13955}, + pos: position{line: 578, col: 13, offset: 14422}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 566, col: 13, offset: 13955}, + pos: position{line: 578, col: 13, offset: 14422}, label: "v", expr: &ruleRefExpr{ - pos: position{line: 566, col: 15, offset: 13957}, + pos: position{line: 578, col: 15, offset: 14424}, name: "h16", }, }, &litMatcher{ - pos: position{line: 566, col: 19, offset: 13961}, + pos: position{line: 578, col: 19, offset: 14428}, val: ":", ignoreCase: false, }, @@ -4294,43 +4465,43 @@ var g = &grammar{ }, { name: "sub_addr", - pos: position{line: 568, col: 1, offset: 13999}, + pos: position{line: 580, col: 1, offset: 14466}, expr: &choiceExpr{ - pos: position{line: 569, col: 5, offset: 14012}, + pos: position{line: 581, col: 5, offset: 14479}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 569, col: 5, offset: 14012}, + pos: position{line: 581, col: 5, offset: 14479}, name: "addr", }, &actionExpr{ - pos: position{line: 570, col: 5, offset: 14021}, + pos: position{line: 582, col: 5, offset: 14488}, run: (*parser).callonsub_addr3, expr: &labeledExpr{ - pos: position{line: 570, col: 5, offset: 14021}, + pos: position{line: 582, col: 5, offset: 14488}, label: "a", expr: &seqExpr{ - pos: position{line: 570, col: 8, offset: 14024}, + pos: position{line: 582, col: 8, offset: 14491}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 570, col: 8, offset: 14024}, + pos: position{line: 582, col: 8, offset: 14491}, name: "unsignedInteger", }, &litMatcher{ - pos: position{line: 570, col: 24, offset: 14040}, + pos: position{line: 582, col: 24, offset: 14507}, val: ".", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 570, col: 28, offset: 14044}, + pos: position{line: 582, col: 28, offset: 14511}, name: "unsignedInteger", }, &litMatcher{ - pos: position{line: 570, col: 44, offset: 14060}, + pos: position{line: 582, col: 44, offset: 14527}, val: ".", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 570, col: 48, offset: 14064}, + pos: position{line: 582, col: 48, offset: 14531}, name: "unsignedInteger", }, }, @@ -4338,25 +4509,25 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 571, col: 5, offset: 14124}, + pos: position{line: 583, col: 5, offset: 14591}, run: (*parser).callonsub_addr11, expr: &labeledExpr{ - pos: position{line: 571, col: 5, offset: 14124}, + pos: position{line: 583, col: 5, offset: 14591}, label: "a", expr: &seqExpr{ - pos: position{line: 571, col: 8, offset: 14127}, + pos: position{line: 583, col: 8, offset: 14594}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 571, col: 8, offset: 14127}, + pos: position{line: 583, col: 8, offset: 14594}, name: "unsignedInteger", }, &litMatcher{ - pos: position{line: 571, col: 24, offset: 14143}, + pos: position{line: 583, col: 24, offset: 14610}, val: ".", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 571, col: 28, offset: 14147}, + pos: position{line: 583, col: 28, offset: 14614}, name: "unsignedInteger", }, }, @@ -4364,13 +4535,13 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 572, col: 5, offset: 14209}, + pos: position{line: 584, col: 5, offset: 14676}, run: (*parser).callonsub_addr17, expr: &labeledExpr{ - pos: position{line: 572, col: 5, offset: 14209}, + pos: position{line: 584, col: 5, offset: 14676}, label: "a", expr: &ruleRefExpr{ - pos: position{line: 572, col: 7, offset: 14211}, + pos: position{line: 584, col: 7, offset: 14678}, name: "unsignedInteger", }, }, @@ -4380,31 +4551,31 @@ var g = &grammar{ }, { name: "subnet", - pos: position{line: 574, col: 1, offset: 14270}, + pos: position{line: 586, col: 1, offset: 14737}, expr: &actionExpr{ - pos: position{line: 575, col: 5, offset: 14281}, + pos: position{line: 587, col: 5, offset: 14748}, run: (*parser).callonsubnet1, expr: &seqExpr{ - pos: position{line: 575, col: 5, offset: 14281}, + pos: position{line: 587, col: 5, offset: 14748}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 575, col: 5, offset: 14281}, + pos: position{line: 587, col: 5, offset: 14748}, label: "a", expr: &ruleRefExpr{ - pos: position{line: 575, col: 7, offset: 14283}, + pos: position{line: 587, col: 7, offset: 14750}, name: "sub_addr", }, }, &litMatcher{ - pos: position{line: 575, col: 16, offset: 14292}, + pos: position{line: 587, col: 16, offset: 14759}, val: "/", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 575, col: 20, offset: 14296}, + pos: position{line: 587, col: 20, offset: 14763}, label: "m", expr: &ruleRefExpr{ - pos: position{line: 575, col: 22, offset: 14298}, + pos: position{line: 587, col: 22, offset: 14765}, name: "unsignedInteger", }, }, @@ -4414,31 +4585,31 @@ var g = &grammar{ }, { name: "ip6subnet", - pos: position{line: 579, col: 1, offset: 14382}, + pos: position{line: 591, col: 1, offset: 14849}, expr: &actionExpr{ - pos: position{line: 580, col: 5, offset: 14396}, + pos: position{line: 592, col: 5, offset: 14863}, run: (*parser).callonip6subnet1, expr: &seqExpr{ - pos: position{line: 580, col: 5, offset: 14396}, + pos: position{line: 592, col: 5, offset: 14863}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 580, col: 5, offset: 14396}, + pos: position{line: 592, col: 5, offset: 14863}, label: "a", expr: &ruleRefExpr{ - pos: position{line: 580, col: 7, offset: 14398}, + pos: position{line: 592, col: 7, offset: 14865}, name: "ip6addr", }, }, &litMatcher{ - pos: position{line: 580, col: 15, offset: 14406}, + pos: position{line: 592, col: 15, offset: 14873}, val: "/", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 580, col: 19, offset: 14410}, + pos: position{line: 592, col: 19, offset: 14877}, label: "m", expr: &ruleRefExpr{ - pos: position{line: 580, col: 21, offset: 14412}, + pos: position{line: 592, col: 21, offset: 14879}, name: "unsignedInteger", }, }, @@ -4448,15 +4619,15 @@ var g = &grammar{ }, { name: "unsignedInteger", - pos: position{line: 584, col: 1, offset: 14486}, + pos: position{line: 596, col: 1, offset: 14953}, expr: &actionExpr{ - pos: position{line: 585, col: 5, offset: 14506}, + pos: position{line: 597, col: 5, offset: 14973}, run: (*parser).callonunsignedInteger1, expr: &labeledExpr{ - pos: position{line: 585, col: 5, offset: 14506}, + pos: position{line: 597, col: 5, offset: 14973}, label: "s", expr: &ruleRefExpr{ - pos: position{line: 585, col: 7, offset: 14508}, + pos: position{line: 597, col: 7, offset: 14975}, name: "suint", }, }, @@ -4464,14 +4635,14 @@ var g = &grammar{ }, { name: "suint", - pos: position{line: 587, col: 1, offset: 14543}, + pos: position{line: 599, col: 1, offset: 15010}, expr: &actionExpr{ - pos: position{line: 588, col: 5, offset: 14553}, + pos: position{line: 600, col: 5, offset: 15020}, run: (*parser).callonsuint1, expr: &oneOrMoreExpr{ - pos: position{line: 588, col: 5, offset: 14553}, + pos: position{line: 600, col: 5, offset: 15020}, expr: &charClassMatcher{ - pos: position{line: 588, col: 5, offset: 14553}, + pos: position{line: 600, col: 5, offset: 15020}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -4482,15 +4653,15 @@ var g = &grammar{ }, { name: "integer", - pos: position{line: 590, col: 1, offset: 14592}, + pos: position{line: 602, col: 1, offset: 15059}, expr: &actionExpr{ - pos: position{line: 591, col: 5, offset: 14604}, + pos: position{line: 603, col: 5, offset: 15071}, run: (*parser).calloninteger1, expr: &labeledExpr{ - pos: position{line: 591, col: 5, offset: 14604}, + pos: position{line: 603, col: 5, offset: 15071}, label: "s", expr: &ruleRefExpr{ - pos: position{line: 591, col: 7, offset: 14606}, + pos: position{line: 603, col: 7, offset: 15073}, name: "sinteger", }, }, @@ -4498,17 +4669,17 @@ var g = &grammar{ }, { name: "sinteger", - pos: position{line: 593, col: 1, offset: 14644}, + pos: position{line: 605, col: 1, offset: 15111}, expr: &actionExpr{ - pos: position{line: 594, col: 5, offset: 14657}, + pos: position{line: 606, col: 5, offset: 15124}, run: (*parser).callonsinteger1, expr: &seqExpr{ - pos: position{line: 594, col: 5, offset: 14657}, + pos: position{line: 606, col: 5, offset: 15124}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 594, col: 5, offset: 14657}, + pos: position{line: 606, col: 5, offset: 15124}, expr: &charClassMatcher{ - pos: position{line: 594, col: 5, offset: 14657}, + pos: position{line: 606, col: 5, offset: 15124}, val: "[+-]", chars: []rune{'+', '-'}, ignoreCase: false, @@ -4516,7 +4687,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 594, col: 11, offset: 14663}, + pos: position{line: 606, col: 11, offset: 15130}, name: "suint", }, }, @@ -4525,15 +4696,15 @@ var g = &grammar{ }, { name: "double", - pos: position{line: 596, col: 1, offset: 14701}, + pos: position{line: 608, col: 1, offset: 15168}, expr: &actionExpr{ - pos: position{line: 597, col: 5, offset: 14712}, + pos: position{line: 609, col: 5, offset: 15179}, run: (*parser).callondouble1, expr: &labeledExpr{ - pos: position{line: 597, col: 5, offset: 14712}, + pos: position{line: 609, col: 5, offset: 15179}, label: "s", expr: &ruleRefExpr{ - pos: position{line: 597, col: 7, offset: 14714}, + pos: position{line: 609, col: 7, offset: 15181}, name: "sdouble", }, }, @@ -4541,47 +4712,47 @@ var g = &grammar{ }, { name: "sdouble", - pos: position{line: 601, col: 1, offset: 14761}, + pos: position{line: 613, col: 1, offset: 15228}, expr: &choiceExpr{ - pos: position{line: 602, col: 5, offset: 14773}, + pos: position{line: 614, col: 5, offset: 15240}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 602, col: 5, offset: 14773}, + pos: position{line: 614, col: 5, offset: 15240}, run: (*parser).callonsdouble2, expr: &seqExpr{ - pos: position{line: 602, col: 5, offset: 14773}, + pos: position{line: 614, col: 5, offset: 15240}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 602, col: 5, offset: 14773}, + pos: position{line: 614, col: 5, offset: 15240}, expr: &litMatcher{ - pos: position{line: 602, col: 5, offset: 14773}, + pos: position{line: 614, col: 5, offset: 15240}, val: "-", ignoreCase: false, }, }, &oneOrMoreExpr{ - pos: position{line: 602, col: 10, offset: 14778}, + pos: position{line: 614, col: 10, offset: 15245}, expr: &ruleRefExpr{ - pos: position{line: 602, col: 10, offset: 14778}, + pos: position{line: 614, col: 10, offset: 15245}, name: "doubleInteger", }, }, &litMatcher{ - pos: position{line: 602, col: 25, offset: 14793}, + pos: position{line: 614, col: 25, offset: 15260}, val: ".", ignoreCase: false, }, &oneOrMoreExpr{ - pos: position{line: 602, col: 29, offset: 14797}, + pos: position{line: 614, col: 29, offset: 15264}, expr: &ruleRefExpr{ - pos: position{line: 602, col: 29, offset: 14797}, + pos: position{line: 614, col: 29, offset: 15264}, name: "doubleDigit", }, }, &zeroOrOneExpr{ - pos: position{line: 602, col: 42, offset: 14810}, + pos: position{line: 614, col: 42, offset: 15277}, expr: &ruleRefExpr{ - pos: position{line: 602, col: 42, offset: 14810}, + pos: position{line: 614, col: 42, offset: 15277}, name: "exponentPart", }, }, @@ -4589,35 +4760,35 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 605, col: 5, offset: 14869}, + pos: position{line: 617, col: 5, offset: 15336}, run: (*parser).callonsdouble13, expr: &seqExpr{ - pos: position{line: 605, col: 5, offset: 14869}, + pos: position{line: 617, col: 5, offset: 15336}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 605, col: 5, offset: 14869}, + pos: position{line: 617, col: 5, offset: 15336}, expr: &litMatcher{ - pos: position{line: 605, col: 5, offset: 14869}, + pos: position{line: 617, col: 5, offset: 15336}, val: "-", ignoreCase: false, }, }, &litMatcher{ - pos: position{line: 605, col: 10, offset: 14874}, + pos: position{line: 617, col: 10, offset: 15341}, val: ".", ignoreCase: false, }, &oneOrMoreExpr{ - pos: position{line: 605, col: 14, offset: 14878}, + pos: position{line: 617, col: 14, offset: 15345}, expr: &ruleRefExpr{ - pos: position{line: 605, col: 14, offset: 14878}, + pos: position{line: 617, col: 14, offset: 15345}, name: "doubleDigit", }, }, &zeroOrOneExpr{ - pos: position{line: 605, col: 27, offset: 14891}, + pos: position{line: 617, col: 27, offset: 15358}, expr: &ruleRefExpr{ - pos: position{line: 605, col: 27, offset: 14891}, + pos: position{line: 617, col: 27, offset: 15358}, name: "exponentPart", }, }, @@ -4629,29 +4800,29 @@ var g = &grammar{ }, { name: "doubleInteger", - pos: position{line: 609, col: 1, offset: 14947}, + pos: position{line: 621, col: 1, offset: 15414}, expr: &choiceExpr{ - pos: position{line: 610, col: 5, offset: 14965}, + pos: position{line: 622, col: 5, offset: 15432}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 610, col: 5, offset: 14965}, + pos: position{line: 622, col: 5, offset: 15432}, val: "0", ignoreCase: false, }, &seqExpr{ - pos: position{line: 611, col: 5, offset: 14973}, + pos: position{line: 623, col: 5, offset: 15440}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 611, col: 5, offset: 14973}, + pos: position{line: 623, col: 5, offset: 15440}, val: "[1-9]", ranges: []rune{'1', '9'}, ignoreCase: false, inverted: false, }, &zeroOrMoreExpr{ - pos: position{line: 611, col: 11, offset: 14979}, + pos: position{line: 623, col: 11, offset: 15446}, expr: &charClassMatcher{ - pos: position{line: 611, col: 11, offset: 14979}, + pos: position{line: 623, col: 11, offset: 15446}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -4665,9 +4836,9 @@ var g = &grammar{ }, { name: "doubleDigit", - pos: position{line: 613, col: 1, offset: 14987}, + pos: position{line: 625, col: 1, offset: 15454}, expr: &charClassMatcher{ - pos: position{line: 613, col: 15, offset: 15001}, + pos: position{line: 625, col: 15, offset: 15468}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -4676,17 +4847,17 @@ var g = &grammar{ }, { name: "exponentPart", - pos: position{line: 615, col: 1, offset: 15008}, + pos: position{line: 627, col: 1, offset: 15475}, expr: &seqExpr{ - pos: position{line: 615, col: 16, offset: 15023}, + pos: position{line: 627, col: 16, offset: 15490}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 615, col: 16, offset: 15023}, + pos: position{line: 627, col: 16, offset: 15490}, val: "e", ignoreCase: true, }, &ruleRefExpr{ - pos: position{line: 615, col: 21, offset: 15028}, + pos: position{line: 627, col: 21, offset: 15495}, name: "sinteger", }, }, @@ -4694,17 +4865,17 @@ var g = &grammar{ }, { name: "h16", - pos: position{line: 617, col: 1, offset: 15038}, + pos: position{line: 629, col: 1, offset: 15505}, expr: &actionExpr{ - pos: position{line: 617, col: 7, offset: 15044}, + pos: position{line: 629, col: 7, offset: 15511}, run: (*parser).callonh161, expr: &labeledExpr{ - pos: position{line: 617, col: 7, offset: 15044}, + pos: position{line: 629, col: 7, offset: 15511}, label: "chars", expr: &oneOrMoreExpr{ - pos: position{line: 617, col: 13, offset: 15050}, + pos: position{line: 629, col: 13, offset: 15517}, expr: &ruleRefExpr{ - pos: position{line: 617, col: 13, offset: 15050}, + pos: position{line: 629, col: 13, offset: 15517}, name: "hexdigit", }, }, @@ -4713,9 +4884,9 @@ var g = &grammar{ }, { name: "hexdigit", - pos: position{line: 619, col: 1, offset: 15092}, + pos: position{line: 631, col: 1, offset: 15559}, expr: &charClassMatcher{ - pos: position{line: 619, col: 12, offset: 15103}, + pos: position{line: 631, col: 12, offset: 15570}, val: "[0-9a-fA-F]", ranges: []rune{'0', '9', 'a', 'f', 'A', 'F'}, ignoreCase: false, @@ -4724,17 +4895,17 @@ var g = &grammar{ }, { name: "searchWord", - pos: position{line: 621, col: 1, offset: 15116}, + pos: position{line: 633, col: 1, offset: 15583}, expr: &actionExpr{ - pos: position{line: 622, col: 5, offset: 15131}, + pos: position{line: 634, col: 5, offset: 15598}, run: (*parser).callonsearchWord1, expr: &labeledExpr{ - pos: position{line: 622, col: 5, offset: 15131}, + pos: position{line: 634, col: 5, offset: 15598}, label: "chars", expr: &oneOrMoreExpr{ - pos: position{line: 622, col: 11, offset: 15137}, + pos: position{line: 634, col: 11, offset: 15604}, expr: &ruleRefExpr{ - pos: position{line: 622, col: 11, offset: 15137}, + pos: position{line: 634, col: 11, offset: 15604}, name: "searchWordPart", }, }, @@ -4743,33 +4914,33 @@ var g = &grammar{ }, { name: "searchWordPart", - pos: position{line: 624, col: 1, offset: 15187}, + pos: position{line: 636, col: 1, offset: 15654}, expr: &choiceExpr{ - pos: position{line: 625, col: 5, offset: 15206}, + pos: position{line: 637, col: 5, offset: 15673}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 625, col: 5, offset: 15206}, + pos: position{line: 637, col: 5, offset: 15673}, run: (*parser).callonsearchWordPart2, expr: &seqExpr{ - pos: position{line: 625, col: 5, offset: 15206}, + pos: position{line: 637, col: 5, offset: 15673}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 625, col: 5, offset: 15206}, + pos: position{line: 637, col: 5, offset: 15673}, val: "\\", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 625, col: 10, offset: 15211}, + pos: position{line: 637, col: 10, offset: 15678}, label: "s", expr: &choiceExpr{ - pos: position{line: 625, col: 13, offset: 15214}, + pos: position{line: 637, col: 13, offset: 15681}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 625, col: 13, offset: 15214}, + pos: position{line: 637, col: 13, offset: 15681}, name: "escapeSequence", }, &ruleRefExpr{ - pos: position{line: 625, col: 30, offset: 15231}, + pos: position{line: 637, col: 30, offset: 15698}, name: "searchEscape", }, }, @@ -4779,18 +4950,18 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 626, col: 5, offset: 15268}, + pos: position{line: 638, col: 5, offset: 15735}, run: (*parser).callonsearchWordPart9, expr: &seqExpr{ - pos: position{line: 626, col: 5, offset: 15268}, + pos: position{line: 638, col: 5, offset: 15735}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 626, col: 5, offset: 15268}, + pos: position{line: 638, col: 5, offset: 15735}, expr: &choiceExpr{ - pos: position{line: 626, col: 7, offset: 15270}, + pos: position{line: 638, col: 7, offset: 15737}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 626, col: 7, offset: 15270}, + pos: position{line: 638, col: 7, offset: 15737}, val: "[\\x00-\\x1F\\x5C(),!><=\\x22|\\x27;]", chars: []rune{'\\', '(', ')', ',', '!', '>', '<', '=', '"', '|', '\'', ';'}, ranges: []rune{'\x00', '\x1f'}, @@ -4798,14 +4969,14 @@ var g = &grammar{ inverted: false, }, &ruleRefExpr{ - pos: position{line: 626, col: 42, offset: 15305}, + pos: position{line: 638, col: 42, offset: 15772}, name: "ws", }, }, }, }, &anyMatcher{ - line: 626, col: 46, offset: 15309, + line: 638, col: 46, offset: 15776, }, }, }, @@ -4815,34 +4986,34 @@ var g = &grammar{ }, { name: "quotedString", - pos: position{line: 628, col: 1, offset: 15343}, + pos: position{line: 640, col: 1, offset: 15810}, expr: &choiceExpr{ - pos: position{line: 629, col: 5, offset: 15360}, + pos: position{line: 641, col: 5, offset: 15827}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 629, col: 5, offset: 15360}, + pos: position{line: 641, col: 5, offset: 15827}, run: (*parser).callonquotedString2, expr: &seqExpr{ - pos: position{line: 629, col: 5, offset: 15360}, + pos: position{line: 641, col: 5, offset: 15827}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 629, col: 5, offset: 15360}, + pos: position{line: 641, col: 5, offset: 15827}, val: "\"", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 629, col: 9, offset: 15364}, + pos: position{line: 641, col: 9, offset: 15831}, label: "v", expr: &zeroOrMoreExpr{ - pos: position{line: 629, col: 11, offset: 15366}, + pos: position{line: 641, col: 11, offset: 15833}, expr: &ruleRefExpr{ - pos: position{line: 629, col: 11, offset: 15366}, + pos: position{line: 641, col: 11, offset: 15833}, name: "doubleQuotedChar", }, }, }, &litMatcher{ - pos: position{line: 629, col: 29, offset: 15384}, + pos: position{line: 641, col: 29, offset: 15851}, val: "\"", ignoreCase: false, }, @@ -4850,29 +5021,29 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 630, col: 5, offset: 15421}, + pos: position{line: 642, col: 5, offset: 15888}, run: (*parser).callonquotedString9, expr: &seqExpr{ - pos: position{line: 630, col: 5, offset: 15421}, + pos: position{line: 642, col: 5, offset: 15888}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 630, col: 5, offset: 15421}, + pos: position{line: 642, col: 5, offset: 15888}, val: "'", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 630, col: 9, offset: 15425}, + pos: position{line: 642, col: 9, offset: 15892}, label: "v", expr: &zeroOrMoreExpr{ - pos: position{line: 630, col: 11, offset: 15427}, + pos: position{line: 642, col: 11, offset: 15894}, expr: &ruleRefExpr{ - pos: position{line: 630, col: 11, offset: 15427}, + pos: position{line: 642, col: 11, offset: 15894}, name: "singleQuotedChar", }, }, }, &litMatcher{ - pos: position{line: 630, col: 29, offset: 15445}, + pos: position{line: 642, col: 29, offset: 15912}, val: "'", ignoreCase: false, }, @@ -4884,55 +5055,55 @@ var g = &grammar{ }, { name: "doubleQuotedChar", - pos: position{line: 632, col: 1, offset: 15479}, + pos: position{line: 644, col: 1, offset: 15946}, expr: &choiceExpr{ - pos: position{line: 633, col: 5, offset: 15500}, + pos: position{line: 645, col: 5, offset: 15967}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 633, col: 5, offset: 15500}, + pos: position{line: 645, col: 5, offset: 15967}, run: (*parser).callondoubleQuotedChar2, expr: &seqExpr{ - pos: position{line: 633, col: 5, offset: 15500}, + pos: position{line: 645, col: 5, offset: 15967}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 633, col: 5, offset: 15500}, + pos: position{line: 645, col: 5, offset: 15967}, expr: &choiceExpr{ - pos: position{line: 633, col: 7, offset: 15502}, + pos: position{line: 645, col: 7, offset: 15969}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 633, col: 7, offset: 15502}, + pos: position{line: 645, col: 7, offset: 15969}, val: "\"", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 633, col: 13, offset: 15508}, + pos: position{line: 645, col: 13, offset: 15975}, name: "escapedChar", }, }, }, }, &anyMatcher{ - line: 633, col: 26, offset: 15521, + line: 645, col: 26, offset: 15988, }, }, }, }, &actionExpr{ - pos: position{line: 634, col: 5, offset: 15558}, + pos: position{line: 646, col: 5, offset: 16025}, run: (*parser).callondoubleQuotedChar9, expr: &seqExpr{ - pos: position{line: 634, col: 5, offset: 15558}, + pos: position{line: 646, col: 5, offset: 16025}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 634, col: 5, offset: 15558}, + pos: position{line: 646, col: 5, offset: 16025}, val: "\\", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 634, col: 10, offset: 15563}, + pos: position{line: 646, col: 10, offset: 16030}, label: "s", expr: &ruleRefExpr{ - pos: position{line: 634, col: 12, offset: 15565}, + pos: position{line: 646, col: 12, offset: 16032}, name: "escapeSequence", }, }, @@ -4944,55 +5115,55 @@ var g = &grammar{ }, { name: "singleQuotedChar", - pos: position{line: 636, col: 1, offset: 15599}, + pos: position{line: 648, col: 1, offset: 16066}, expr: &choiceExpr{ - pos: position{line: 637, col: 5, offset: 15620}, + pos: position{line: 649, col: 5, offset: 16087}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 637, col: 5, offset: 15620}, + pos: position{line: 649, col: 5, offset: 16087}, run: (*parser).callonsingleQuotedChar2, expr: &seqExpr{ - pos: position{line: 637, col: 5, offset: 15620}, + pos: position{line: 649, col: 5, offset: 16087}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 637, col: 5, offset: 15620}, + pos: position{line: 649, col: 5, offset: 16087}, expr: &choiceExpr{ - pos: position{line: 637, col: 7, offset: 15622}, + pos: position{line: 649, col: 7, offset: 16089}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 637, col: 7, offset: 15622}, + pos: position{line: 649, col: 7, offset: 16089}, val: "'", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 637, col: 13, offset: 15628}, + pos: position{line: 649, col: 13, offset: 16095}, name: "escapedChar", }, }, }, }, &anyMatcher{ - line: 637, col: 26, offset: 15641, + line: 649, col: 26, offset: 16108, }, }, }, }, &actionExpr{ - pos: position{line: 638, col: 5, offset: 15678}, + pos: position{line: 650, col: 5, offset: 16145}, run: (*parser).callonsingleQuotedChar9, expr: &seqExpr{ - pos: position{line: 638, col: 5, offset: 15678}, + pos: position{line: 650, col: 5, offset: 16145}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 638, col: 5, offset: 15678}, + pos: position{line: 650, col: 5, offset: 16145}, val: "\\", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 638, col: 10, offset: 15683}, + pos: position{line: 650, col: 10, offset: 16150}, label: "s", expr: &ruleRefExpr{ - pos: position{line: 638, col: 12, offset: 15685}, + pos: position{line: 650, col: 12, offset: 16152}, name: "escapeSequence", }, }, @@ -5004,38 +5175,38 @@ var g = &grammar{ }, { name: "escapeSequence", - pos: position{line: 640, col: 1, offset: 15719}, + pos: position{line: 652, col: 1, offset: 16186}, expr: &choiceExpr{ - pos: position{line: 641, col: 5, offset: 15738}, + pos: position{line: 653, col: 5, offset: 16205}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 641, col: 5, offset: 15738}, + pos: position{line: 653, col: 5, offset: 16205}, run: (*parser).callonescapeSequence2, expr: &seqExpr{ - pos: position{line: 641, col: 5, offset: 15738}, + pos: position{line: 653, col: 5, offset: 16205}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 641, col: 5, offset: 15738}, + pos: position{line: 653, col: 5, offset: 16205}, val: "x", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 641, col: 9, offset: 15742}, + pos: position{line: 653, col: 9, offset: 16209}, name: "hexdigit", }, &ruleRefExpr{ - pos: position{line: 641, col: 18, offset: 15751}, + pos: position{line: 653, col: 18, offset: 16218}, name: "hexdigit", }, }, }, }, &ruleRefExpr{ - pos: position{line: 642, col: 5, offset: 15802}, + pos: position{line: 654, col: 5, offset: 16269}, name: "singleCharEscape", }, &ruleRefExpr{ - pos: position{line: 643, col: 5, offset: 15823}, + pos: position{line: 655, col: 5, offset: 16290}, name: "unicodeEscape", }, }, @@ -5043,75 +5214,75 @@ var g = &grammar{ }, { name: "singleCharEscape", - pos: position{line: 645, col: 1, offset: 15838}, + pos: position{line: 657, col: 1, offset: 16305}, expr: &choiceExpr{ - pos: position{line: 646, col: 5, offset: 15859}, + pos: position{line: 658, col: 5, offset: 16326}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 646, col: 5, offset: 15859}, + pos: position{line: 658, col: 5, offset: 16326}, val: "'", ignoreCase: false, }, &litMatcher{ - pos: position{line: 647, col: 5, offset: 15867}, + pos: position{line: 659, col: 5, offset: 16334}, val: "\"", ignoreCase: false, }, &litMatcher{ - pos: position{line: 648, col: 5, offset: 15875}, + pos: position{line: 660, col: 5, offset: 16342}, val: "\\", ignoreCase: false, }, &actionExpr{ - pos: position{line: 649, col: 5, offset: 15884}, + pos: position{line: 661, col: 5, offset: 16351}, run: (*parser).callonsingleCharEscape5, expr: &litMatcher{ - pos: position{line: 649, col: 5, offset: 15884}, + pos: position{line: 661, col: 5, offset: 16351}, val: "b", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 650, col: 5, offset: 15913}, + pos: position{line: 662, col: 5, offset: 16380}, run: (*parser).callonsingleCharEscape7, expr: &litMatcher{ - pos: position{line: 650, col: 5, offset: 15913}, + pos: position{line: 662, col: 5, offset: 16380}, val: "f", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 651, col: 5, offset: 15942}, + pos: position{line: 663, col: 5, offset: 16409}, run: (*parser).callonsingleCharEscape9, expr: &litMatcher{ - pos: position{line: 651, col: 5, offset: 15942}, + pos: position{line: 663, col: 5, offset: 16409}, val: "n", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 652, col: 5, offset: 15971}, + pos: position{line: 664, col: 5, offset: 16438}, run: (*parser).callonsingleCharEscape11, expr: &litMatcher{ - pos: position{line: 652, col: 5, offset: 15971}, + pos: position{line: 664, col: 5, offset: 16438}, val: "r", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 653, col: 5, offset: 16000}, + pos: position{line: 665, col: 5, offset: 16467}, run: (*parser).callonsingleCharEscape13, expr: &litMatcher{ - pos: position{line: 653, col: 5, offset: 16000}, + pos: position{line: 665, col: 5, offset: 16467}, val: "t", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 654, col: 5, offset: 16029}, + pos: position{line: 666, col: 5, offset: 16496}, run: (*parser).callonsingleCharEscape15, expr: &litMatcher{ - pos: position{line: 654, col: 5, offset: 16029}, + pos: position{line: 666, col: 5, offset: 16496}, val: "v", ignoreCase: false, }, @@ -5121,24 +5292,24 @@ var g = &grammar{ }, { name: "searchEscape", - pos: position{line: 656, col: 1, offset: 16055}, + pos: position{line: 668, col: 1, offset: 16522}, expr: &choiceExpr{ - pos: position{line: 657, col: 5, offset: 16072}, + pos: position{line: 669, col: 5, offset: 16539}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 657, col: 5, offset: 16072}, + pos: position{line: 669, col: 5, offset: 16539}, run: (*parser).callonsearchEscape2, expr: &litMatcher{ - pos: position{line: 657, col: 5, offset: 16072}, + pos: position{line: 669, col: 5, offset: 16539}, val: "=", ignoreCase: false, }, }, &actionExpr{ - pos: position{line: 658, col: 5, offset: 16100}, + pos: position{line: 670, col: 5, offset: 16567}, run: (*parser).callonsearchEscape4, expr: &litMatcher{ - pos: position{line: 658, col: 5, offset: 16100}, + pos: position{line: 670, col: 5, offset: 16567}, val: "*", ignoreCase: false, }, @@ -5148,41 +5319,41 @@ var g = &grammar{ }, { name: "unicodeEscape", - pos: position{line: 660, col: 1, offset: 16127}, + pos: position{line: 672, col: 1, offset: 16594}, expr: &choiceExpr{ - pos: position{line: 661, col: 5, offset: 16145}, + pos: position{line: 673, col: 5, offset: 16612}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 661, col: 5, offset: 16145}, + pos: position{line: 673, col: 5, offset: 16612}, run: (*parser).callonunicodeEscape2, expr: &seqExpr{ - pos: position{line: 661, col: 5, offset: 16145}, + pos: position{line: 673, col: 5, offset: 16612}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 661, col: 5, offset: 16145}, + pos: position{line: 673, col: 5, offset: 16612}, val: "u", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 661, col: 9, offset: 16149}, + pos: position{line: 673, col: 9, offset: 16616}, label: "chars", expr: &seqExpr{ - pos: position{line: 661, col: 16, offset: 16156}, + pos: position{line: 673, col: 16, offset: 16623}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 661, col: 16, offset: 16156}, + pos: position{line: 673, col: 16, offset: 16623}, name: "hexdigit", }, &ruleRefExpr{ - pos: position{line: 661, col: 25, offset: 16165}, + pos: position{line: 673, col: 25, offset: 16632}, name: "hexdigit", }, &ruleRefExpr{ - pos: position{line: 661, col: 34, offset: 16174}, + pos: position{line: 673, col: 34, offset: 16641}, name: "hexdigit", }, &ruleRefExpr{ - pos: position{line: 661, col: 43, offset: 16183}, + pos: position{line: 673, col: 43, offset: 16650}, name: "hexdigit", }, }, @@ -5192,63 +5363,63 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 664, col: 5, offset: 16246}, + pos: position{line: 676, col: 5, offset: 16713}, run: (*parser).callonunicodeEscape11, expr: &seqExpr{ - pos: position{line: 664, col: 5, offset: 16246}, + pos: position{line: 676, col: 5, offset: 16713}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 664, col: 5, offset: 16246}, + pos: position{line: 676, col: 5, offset: 16713}, val: "u", ignoreCase: false, }, &litMatcher{ - pos: position{line: 664, col: 9, offset: 16250}, + pos: position{line: 676, col: 9, offset: 16717}, val: "{", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 664, col: 13, offset: 16254}, + pos: position{line: 676, col: 13, offset: 16721}, label: "chars", expr: &seqExpr{ - pos: position{line: 664, col: 20, offset: 16261}, + pos: position{line: 676, col: 20, offset: 16728}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 664, col: 20, offset: 16261}, + pos: position{line: 676, col: 20, offset: 16728}, name: "hexdigit", }, &zeroOrOneExpr{ - pos: position{line: 664, col: 29, offset: 16270}, + pos: position{line: 676, col: 29, offset: 16737}, expr: &ruleRefExpr{ - pos: position{line: 664, col: 29, offset: 16270}, + pos: position{line: 676, col: 29, offset: 16737}, name: "hexdigit", }, }, &zeroOrOneExpr{ - pos: position{line: 664, col: 39, offset: 16280}, + pos: position{line: 676, col: 39, offset: 16747}, expr: &ruleRefExpr{ - pos: position{line: 664, col: 39, offset: 16280}, + pos: position{line: 676, col: 39, offset: 16747}, name: "hexdigit", }, }, &zeroOrOneExpr{ - pos: position{line: 664, col: 49, offset: 16290}, + pos: position{line: 676, col: 49, offset: 16757}, expr: &ruleRefExpr{ - pos: position{line: 664, col: 49, offset: 16290}, + pos: position{line: 676, col: 49, offset: 16757}, name: "hexdigit", }, }, &zeroOrOneExpr{ - pos: position{line: 664, col: 59, offset: 16300}, + pos: position{line: 676, col: 59, offset: 16767}, expr: &ruleRefExpr{ - pos: position{line: 664, col: 59, offset: 16300}, + pos: position{line: 676, col: 59, offset: 16767}, name: "hexdigit", }, }, &zeroOrOneExpr{ - pos: position{line: 664, col: 69, offset: 16310}, + pos: position{line: 676, col: 69, offset: 16777}, expr: &ruleRefExpr{ - pos: position{line: 664, col: 69, offset: 16310}, + pos: position{line: 676, col: 69, offset: 16777}, name: "hexdigit", }, }, @@ -5256,7 +5427,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 664, col: 80, offset: 16321}, + pos: position{line: 676, col: 80, offset: 16788}, val: "}", ignoreCase: false, }, @@ -5268,28 +5439,28 @@ var g = &grammar{ }, { name: "reString", - pos: position{line: 668, col: 1, offset: 16375}, + pos: position{line: 680, col: 1, offset: 16842}, expr: &actionExpr{ - pos: position{line: 669, col: 5, offset: 16388}, + pos: position{line: 681, col: 5, offset: 16855}, run: (*parser).callonreString1, expr: &seqExpr{ - pos: position{line: 669, col: 5, offset: 16388}, + pos: position{line: 681, col: 5, offset: 16855}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 669, col: 5, offset: 16388}, + pos: position{line: 681, col: 5, offset: 16855}, val: "/", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 669, col: 9, offset: 16392}, + pos: position{line: 681, col: 9, offset: 16859}, label: "v", expr: &ruleRefExpr{ - pos: position{line: 669, col: 11, offset: 16394}, + pos: position{line: 681, col: 11, offset: 16861}, name: "reBody", }, }, &litMatcher{ - pos: position{line: 669, col: 18, offset: 16401}, + pos: position{line: 681, col: 18, offset: 16868}, val: "/", ignoreCase: false, }, @@ -5299,24 +5470,24 @@ var g = &grammar{ }, { name: "reBody", - pos: position{line: 671, col: 1, offset: 16424}, + pos: position{line: 683, col: 1, offset: 16891}, expr: &actionExpr{ - pos: position{line: 672, col: 5, offset: 16435}, + pos: position{line: 684, col: 5, offset: 16902}, run: (*parser).callonreBody1, expr: &oneOrMoreExpr{ - pos: position{line: 672, col: 5, offset: 16435}, + pos: position{line: 684, col: 5, offset: 16902}, expr: &choiceExpr{ - pos: position{line: 672, col: 6, offset: 16436}, + pos: position{line: 684, col: 6, offset: 16903}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 672, col: 6, offset: 16436}, + pos: position{line: 684, col: 6, offset: 16903}, val: "[^/\\\\]", chars: []rune{'/', '\\'}, ignoreCase: false, inverted: true, }, &litMatcher{ - pos: position{line: 672, col: 13, offset: 16443}, + pos: position{line: 684, col: 13, offset: 16910}, val: "\\/", ignoreCase: false, }, @@ -5327,9 +5498,9 @@ var g = &grammar{ }, { name: "escapedChar", - pos: position{line: 674, col: 1, offset: 16483}, + pos: position{line: 686, col: 1, offset: 16950}, expr: &charClassMatcher{ - pos: position{line: 675, col: 5, offset: 16499}, + pos: position{line: 687, col: 5, offset: 16966}, val: "[\\x00-\\x1f\\\\]", chars: []rune{'\\'}, ranges: []rune{'\x00', '\x1f'}, @@ -5339,37 +5510,37 @@ var g = &grammar{ }, { name: "ws", - pos: position{line: 677, col: 1, offset: 16514}, + pos: position{line: 689, col: 1, offset: 16981}, expr: &choiceExpr{ - pos: position{line: 678, col: 5, offset: 16521}, + pos: position{line: 690, col: 5, offset: 16988}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 678, col: 5, offset: 16521}, + pos: position{line: 690, col: 5, offset: 16988}, val: "\t", ignoreCase: false, }, &litMatcher{ - pos: position{line: 679, col: 5, offset: 16530}, + pos: position{line: 691, col: 5, offset: 16997}, val: "\v", ignoreCase: false, }, &litMatcher{ - pos: position{line: 680, col: 5, offset: 16539}, + pos: position{line: 692, col: 5, offset: 17006}, val: "\f", ignoreCase: false, }, &litMatcher{ - pos: position{line: 681, col: 5, offset: 16548}, + pos: position{line: 693, col: 5, offset: 17015}, val: " ", ignoreCase: false, }, &litMatcher{ - pos: position{line: 682, col: 5, offset: 16556}, + pos: position{line: 694, col: 5, offset: 17023}, val: "\u00a0", ignoreCase: false, }, &litMatcher{ - pos: position{line: 683, col: 5, offset: 16569}, + pos: position{line: 695, col: 5, offset: 17036}, val: "\ufeff", ignoreCase: false, }, @@ -5379,33 +5550,33 @@ var g = &grammar{ { name: "_", displayName: "\"whitespace\"", - pos: position{line: 685, col: 1, offset: 16579}, + pos: position{line: 697, col: 1, offset: 17046}, expr: &oneOrMoreExpr{ - pos: position{line: 685, col: 18, offset: 16596}, + pos: position{line: 697, col: 18, offset: 17063}, expr: &ruleRefExpr{ - pos: position{line: 685, col: 18, offset: 16596}, + pos: position{line: 697, col: 18, offset: 17063}, name: "ws", }, }, }, { name: "__", - pos: position{line: 686, col: 1, offset: 16600}, + pos: position{line: 698, col: 1, offset: 17067}, expr: &zeroOrMoreExpr{ - pos: position{line: 686, col: 6, offset: 16605}, + pos: position{line: 698, col: 6, offset: 17072}, expr: &ruleRefExpr{ - pos: position{line: 686, col: 6, offset: 16605}, + pos: position{line: 698, col: 6, offset: 17072}, name: "ws", }, }, }, { name: "EOF", - pos: position{line: 688, col: 1, offset: 16610}, + pos: position{line: 700, col: 1, offset: 17077}, expr: ¬Expr{ - pos: position{line: 688, col: 7, offset: 16616}, + pos: position{line: 700, col: 7, offset: 17083}, expr: &anyMatcher{ - line: 688, col: 8, offset: 16617, + line: 700, col: 8, offset: 17084, }, }, }, @@ -6673,6 +6844,58 @@ func (p *parser) callonNotExpression2() (interface{}, error) { return p.cur.onNotExpression2(stack["e"]) } +func (c *current) onCallExpression2(fn, args interface{}) (interface{}, error) { + return makeFunctionCall(fn, args), nil + +} + +func (p *parser) callonCallExpression2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCallExpression2(stack["fn"], stack["args"]) +} + +func (c *current) onFunctionName1() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonFunctionName1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFunctionName1() +} + +func (c *current) onArgumentList8(e interface{}) (interface{}, error) { + return e, nil +} + +func (p *parser) callonArgumentList8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onArgumentList8(stack["e"]) +} + +func (c *current) onArgumentList2(first, rest interface{}) (interface{}, error) { + return append([]interface{}{first}, (rest.([]interface{}))...), nil + +} + +func (p *parser) callonArgumentList2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onArgumentList2(stack["first"], stack["rest"]) +} + +func (c *current) onArgumentList15() (interface{}, error) { + return []interface{}{}, nil +} + +func (p *parser) callonArgumentList15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onArgumentList15() +} + func (c *current) onDereferenceExpression20(field interface{}) (interface{}, error) { return makeLiteral("string", string(c.text)), nil } diff --git a/zql/zql.js b/zql/zql.js index 5b7be133e9..d71342b2e2 100644 --- a/zql/zql.js +++ b/zql/zql.js @@ -496,176 +496,188 @@ function peg$parse(input, options) { peg$c208 = function(e) { return makeLogicalNot(e) }, - peg$c209 = function(base, field) { return makeLiteral("string", text()) }, - peg$c210 = function(base, derefs) { + peg$c209 = function(fn, args) { + return makeFunctionCall(fn, args) + }, + peg$c210 = /^[A-Za-z]/, + peg$c211 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false), + peg$c212 = /^[.0-9]/, + peg$c213 = peg$classExpectation([".", ["0", "9"]], false, false), + peg$c214 = function(first, e) { return e }, + peg$c215 = function(first, rest) { + return [first, ... rest] + }, + peg$c216 = function() { return [] }, + peg$c217 = function(base, field) { return makeLiteral("string", text()) }, + peg$c218 = function(base, derefs) { return makeBinaryExprChain(base, derefs) }, - peg$c211 = peg$literalExpectation("and", false), - peg$c212 = "seconds", - peg$c213 = peg$literalExpectation("seconds", false), - peg$c214 = "second", - peg$c215 = peg$literalExpectation("second", false), - peg$c216 = "secs", - peg$c217 = peg$literalExpectation("secs", false), - peg$c218 = "sec", - peg$c219 = peg$literalExpectation("sec", false), - peg$c220 = "s", - peg$c221 = peg$literalExpectation("s", false), - peg$c222 = "minutes", - peg$c223 = peg$literalExpectation("minutes", false), - peg$c224 = "minute", - peg$c225 = peg$literalExpectation("minute", false), - peg$c226 = "mins", - peg$c227 = peg$literalExpectation("mins", false), - peg$c228 = peg$literalExpectation("min", false), - peg$c229 = "m", - peg$c230 = peg$literalExpectation("m", false), - peg$c231 = "hours", - peg$c232 = peg$literalExpectation("hours", false), - peg$c233 = "hrs", - peg$c234 = peg$literalExpectation("hrs", false), - peg$c235 = "hr", - peg$c236 = peg$literalExpectation("hr", false), - peg$c237 = "h", - peg$c238 = peg$literalExpectation("h", false), - peg$c239 = "hour", - peg$c240 = peg$literalExpectation("hour", false), - peg$c241 = "days", - peg$c242 = peg$literalExpectation("days", false), - peg$c243 = "day", - peg$c244 = peg$literalExpectation("day", false), - peg$c245 = "d", - peg$c246 = peg$literalExpectation("d", false), - peg$c247 = "weeks", - peg$c248 = peg$literalExpectation("weeks", false), - peg$c249 = "week", - peg$c250 = peg$literalExpectation("week", false), - peg$c251 = "wks", - peg$c252 = peg$literalExpectation("wks", false), - peg$c253 = "wk", - peg$c254 = peg$literalExpectation("wk", false), - peg$c255 = "w", - peg$c256 = peg$literalExpectation("w", false), - peg$c257 = function() { return makeDuration(1) }, - peg$c258 = function(num) { return makeDuration(num) }, - peg$c259 = function() { return makeDuration(60) }, - peg$c260 = function(num) { return makeDuration(num*60) }, - peg$c261 = function() { return makeDuration(3600) }, - peg$c262 = function(num) { return makeDuration(num*3600) }, - peg$c263 = function() { return makeDuration(3600*24) }, - peg$c264 = function(num) { return makeDuration(num*3600*24) }, - peg$c265 = function(num) { return makeDuration(num*3600*24*7) }, - peg$c266 = function(a) { return text() }, - peg$c267 = ":", - peg$c268 = peg$literalExpectation(":", false), - peg$c269 = function(a, b) { + peg$c219 = peg$literalExpectation("and", false), + peg$c220 = "seconds", + peg$c221 = peg$literalExpectation("seconds", false), + peg$c222 = "second", + peg$c223 = peg$literalExpectation("second", false), + peg$c224 = "secs", + peg$c225 = peg$literalExpectation("secs", false), + peg$c226 = "sec", + peg$c227 = peg$literalExpectation("sec", false), + peg$c228 = "s", + peg$c229 = peg$literalExpectation("s", false), + peg$c230 = "minutes", + peg$c231 = peg$literalExpectation("minutes", false), + peg$c232 = "minute", + peg$c233 = peg$literalExpectation("minute", false), + peg$c234 = "mins", + peg$c235 = peg$literalExpectation("mins", false), + peg$c236 = peg$literalExpectation("min", false), + peg$c237 = "m", + peg$c238 = peg$literalExpectation("m", false), + peg$c239 = "hours", + peg$c240 = peg$literalExpectation("hours", false), + peg$c241 = "hrs", + peg$c242 = peg$literalExpectation("hrs", false), + peg$c243 = "hr", + peg$c244 = peg$literalExpectation("hr", false), + peg$c245 = "h", + peg$c246 = peg$literalExpectation("h", false), + peg$c247 = "hour", + peg$c248 = peg$literalExpectation("hour", false), + peg$c249 = "days", + peg$c250 = peg$literalExpectation("days", false), + peg$c251 = "day", + peg$c252 = peg$literalExpectation("day", false), + peg$c253 = "d", + peg$c254 = peg$literalExpectation("d", false), + peg$c255 = "weeks", + peg$c256 = peg$literalExpectation("weeks", false), + peg$c257 = "week", + peg$c258 = peg$literalExpectation("week", false), + peg$c259 = "wks", + peg$c260 = peg$literalExpectation("wks", false), + peg$c261 = "wk", + peg$c262 = peg$literalExpectation("wk", false), + peg$c263 = "w", + peg$c264 = peg$literalExpectation("w", false), + peg$c265 = function() { return makeDuration(1) }, + peg$c266 = function(num) { return makeDuration(num) }, + peg$c267 = function() { return makeDuration(60) }, + peg$c268 = function(num) { return makeDuration(num*60) }, + peg$c269 = function() { return makeDuration(3600) }, + peg$c270 = function(num) { return makeDuration(num*3600) }, + peg$c271 = function() { return makeDuration(3600*24) }, + peg$c272 = function(num) { return makeDuration(num*3600*24) }, + peg$c273 = function(num) { return makeDuration(num*3600*24*7) }, + peg$c274 = function(a) { return text() }, + peg$c275 = ":", + peg$c276 = peg$literalExpectation(":", false), + peg$c277 = function(a, b) { return joinChars(a) + b }, - peg$c270 = "::", - peg$c271 = peg$literalExpectation("::", false), - peg$c272 = function(a, b, d, e) { + peg$c278 = "::", + peg$c279 = peg$literalExpectation("::", false), + peg$c280 = function(a, b, d, e) { return a + joinChars(b) + "::" + joinChars(d) + e }, - peg$c273 = function(a, b) { + peg$c281 = function(a, b) { return "::" + joinChars(a) + b }, - peg$c274 = function(a, b) { + peg$c282 = function(a, b) { return a + joinChars(b) + "::" }, - peg$c275 = function() { + peg$c283 = function() { return "::" }, - peg$c276 = function(v) { return ":" + v }, - peg$c277 = function(v) { return v + ":" }, - peg$c278 = function(a) { return text() + ".0" }, - peg$c279 = function(a) { return text() + ".0.0" }, - peg$c280 = function(a) { return text() + ".0.0.0" }, - peg$c281 = function(a, m) { + peg$c284 = function(v) { return ":" + v }, + peg$c285 = function(v) { return v + ":" }, + peg$c286 = function(a) { return text() + ".0" }, + peg$c287 = function(a) { return text() + ".0.0" }, + peg$c288 = function(a) { return text() + ".0.0.0" }, + peg$c289 = function(a, m) { return a + "/" + m.toString(); }, - peg$c282 = function(a, m) { + peg$c290 = function(a, m) { return a + "/" + m; }, - peg$c283 = function(s) { return parseInt(s) }, - peg$c284 = /^[+\-]/, - peg$c285 = peg$classExpectation(["+", "-"], false, false), - peg$c286 = function(s) { + peg$c291 = function(s) { return parseInt(s) }, + peg$c292 = /^[+\-]/, + peg$c293 = peg$classExpectation(["+", "-"], false, false), + peg$c294 = function(s) { return parseFloat(s) }, - peg$c287 = function() { + peg$c295 = function() { return text() }, - peg$c288 = "0", - peg$c289 = peg$literalExpectation("0", false), - peg$c290 = /^[1-9]/, - peg$c291 = peg$classExpectation([["1", "9"]], false, false), - peg$c292 = "e", - peg$c293 = peg$literalExpectation("e", true), - peg$c294 = function(chars) { return text() }, - peg$c295 = /^[0-9a-fA-F]/, - peg$c296 = peg$classExpectation([["0", "9"], ["a", "f"], ["A", "F"]], false, false), - peg$c297 = function(chars) { return joinChars(chars) }, - peg$c298 = "\\", - peg$c299 = peg$literalExpectation("\\", false), - peg$c300 = /^[\0-\x1F\\(),!><="|';]/, - peg$c301 = peg$classExpectation([["\0", "\x1F"], "\\", "(", ")", ",", "!", ">", "<", "=", "\"", "|", "'", ";"], false, false), - peg$c302 = peg$anyExpectation(), - peg$c303 = "\"", - peg$c304 = peg$literalExpectation("\"", false), - peg$c305 = function(v) { return joinChars(v) }, - peg$c306 = "'", - peg$c307 = peg$literalExpectation("'", false), - peg$c308 = "x", - peg$c309 = peg$literalExpectation("x", false), - peg$c310 = function() { return "\\" + text() }, - peg$c311 = "b", - peg$c312 = peg$literalExpectation("b", false), - peg$c313 = function() { return "\b" }, - peg$c314 = "f", - peg$c315 = peg$literalExpectation("f", false), - peg$c316 = function() { return "\f" }, - peg$c317 = "n", - peg$c318 = peg$literalExpectation("n", false), - peg$c319 = function() { return "\n" }, - peg$c320 = "r", - peg$c321 = peg$literalExpectation("r", false), - peg$c322 = function() { return "\r" }, - peg$c323 = "t", - peg$c324 = peg$literalExpectation("t", false), - peg$c325 = function() { return "\t" }, - peg$c326 = "v", - peg$c327 = peg$literalExpectation("v", false), - peg$c328 = function() { return "\v" }, - peg$c329 = function() { return "=" }, - peg$c330 = function() { return "\\*" }, - peg$c331 = "u", - peg$c332 = peg$literalExpectation("u", false), - peg$c333 = function(chars) { + peg$c296 = "0", + peg$c297 = peg$literalExpectation("0", false), + peg$c298 = /^[1-9]/, + peg$c299 = peg$classExpectation([["1", "9"]], false, false), + peg$c300 = "e", + peg$c301 = peg$literalExpectation("e", true), + peg$c302 = function(chars) { return text() }, + peg$c303 = /^[0-9a-fA-F]/, + peg$c304 = peg$classExpectation([["0", "9"], ["a", "f"], ["A", "F"]], false, false), + peg$c305 = function(chars) { return joinChars(chars) }, + peg$c306 = "\\", + peg$c307 = peg$literalExpectation("\\", false), + peg$c308 = /^[\0-\x1F\\(),!><="|';]/, + peg$c309 = peg$classExpectation([["\0", "\x1F"], "\\", "(", ")", ",", "!", ">", "<", "=", "\"", "|", "'", ";"], false, false), + peg$c310 = peg$anyExpectation(), + peg$c311 = "\"", + peg$c312 = peg$literalExpectation("\"", false), + peg$c313 = function(v) { return joinChars(v) }, + peg$c314 = "'", + peg$c315 = peg$literalExpectation("'", false), + peg$c316 = "x", + peg$c317 = peg$literalExpectation("x", false), + peg$c318 = function() { return "\\" + text() }, + peg$c319 = "b", + peg$c320 = peg$literalExpectation("b", false), + peg$c321 = function() { return "\b" }, + peg$c322 = "f", + peg$c323 = peg$literalExpectation("f", false), + peg$c324 = function() { return "\f" }, + peg$c325 = "n", + peg$c326 = peg$literalExpectation("n", false), + peg$c327 = function() { return "\n" }, + peg$c328 = "r", + peg$c329 = peg$literalExpectation("r", false), + peg$c330 = function() { return "\r" }, + peg$c331 = "t", + peg$c332 = peg$literalExpectation("t", false), + peg$c333 = function() { return "\t" }, + peg$c334 = "v", + peg$c335 = peg$literalExpectation("v", false), + peg$c336 = function() { return "\v" }, + peg$c337 = function() { return "=" }, + peg$c338 = function() { return "\\*" }, + peg$c339 = "u", + peg$c340 = peg$literalExpectation("u", false), + peg$c341 = function(chars) { return makeUnicodeChar(chars) }, - peg$c334 = "{", - peg$c335 = peg$literalExpectation("{", false), - peg$c336 = "}", - peg$c337 = peg$literalExpectation("}", false), - peg$c338 = /^[^\/\\]/, - peg$c339 = peg$classExpectation(["/", "\\"], true, false), - peg$c340 = "\\/", - peg$c341 = peg$literalExpectation("\\/", false), - peg$c342 = /^[\0-\x1F\\]/, - peg$c343 = peg$classExpectation([["\0", "\x1F"], "\\"], false, false), - peg$c344 = "\t", - peg$c345 = peg$literalExpectation("\t", false), - peg$c346 = "\x0B", - peg$c347 = peg$literalExpectation("\x0B", false), - peg$c348 = "\f", - peg$c349 = peg$literalExpectation("\f", false), - peg$c350 = " ", - peg$c351 = peg$literalExpectation(" ", false), - peg$c352 = "\xA0", - peg$c353 = peg$literalExpectation("\xA0", false), - peg$c354 = "\uFEFF", - peg$c355 = peg$literalExpectation("\uFEFF", false), - peg$c356 = peg$otherExpectation("whitespace"), + peg$c342 = "{", + peg$c343 = peg$literalExpectation("{", false), + peg$c344 = "}", + peg$c345 = peg$literalExpectation("}", false), + peg$c346 = /^[^\/\\]/, + peg$c347 = peg$classExpectation(["/", "\\"], true, false), + peg$c348 = "\\/", + peg$c349 = peg$literalExpectation("\\/", false), + peg$c350 = /^[\0-\x1F\\]/, + peg$c351 = peg$classExpectation([["\0", "\x1F"], "\\"], false, false), + peg$c352 = "\t", + peg$c353 = peg$literalExpectation("\t", false), + peg$c354 = "\x0B", + peg$c355 = peg$literalExpectation("\x0B", false), + peg$c356 = "\f", + peg$c357 = peg$literalExpectation("\f", false), + peg$c358 = " ", + peg$c359 = peg$literalExpectation(" ", false), + peg$c360 = "\xA0", + peg$c361 = peg$literalExpectation("\xA0", false), + peg$c362 = "\uFEFF", + peg$c363 = peg$literalExpectation("\uFEFF", false), + peg$c364 = peg$otherExpectation("whitespace"), peg$currPos = 0, peg$savedPos = 0, @@ -4934,7 +4946,7 @@ function peg$parse(input, options) { if (s1 !== peg$FAILED) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { - s3 = peg$parseDereferenceExpression(); + s3 = peg$parseCallExpression(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c208(s3); @@ -4951,6 +4963,62 @@ function peg$parse(input, options) { peg$currPos = s0; s0 = peg$FAILED; } + if (s0 === peg$FAILED) { + s0 = peg$parseCallExpression(); + } + + return s0; + } + + function peg$parseCallExpression() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseFunctionName(); + if (s1 !== peg$FAILED) { + s2 = peg$parse__(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c19; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parseArgumentList(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c21; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c22); } + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c209(s1, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } if (s0 === peg$FAILED) { s0 = peg$parseDereferenceExpression(); } @@ -4958,6 +5026,168 @@ function peg$parse(input, options) { return s0; } + function peg$parseFunctionName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseFunctionNameStart(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseFunctionNameRest(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseFunctionNameRest(); + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c84(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseFunctionNameStart() { + var s0; + + if (peg$c210.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c211); } + } + + return s0; + } + + function peg$parseFunctionNameRest() { + var s0; + + s0 = peg$parseFunctionNameStart(); + if (s0 === peg$FAILED) { + if (peg$c212.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c213); } + } + } + + return s0; + } + + function peg$parseArgumentList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseLogicalORExpression(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse__(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c108; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse__(); + if (s6 !== peg$FAILED) { + s7 = peg$parseLogicalORExpression(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c214(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse__(); + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c108; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parse__(); + if (s6 !== peg$FAILED) { + s7 = peg$parseLogicalORExpression(); + if (s7 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c214(s1, s7); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c215(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c216(); + } + s0 = s1; + } + + return s0; + } + function peg$parseDereferenceExpression() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; @@ -5034,7 +5264,7 @@ function peg$parse(input, options) { s8 = peg$parsefieldName(); if (s8 !== peg$FAILED) { peg$savedPos = s7; - s8 = peg$c209(s1, s8); + s8 = peg$c217(s1, s8); } s7 = s8; if (s7 !== peg$FAILED) { @@ -5128,7 +5358,7 @@ function peg$parse(input, options) { s8 = peg$parsefieldName(); if (s8 !== peg$FAILED) { peg$savedPos = s7; - s8 = peg$c209(s1, s8); + s8 = peg$c217(s1, s8); } s7 = s8; if (s7 !== peg$FAILED) { @@ -5154,7 +5384,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c210(s1, s2); + s1 = peg$c218(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5187,7 +5417,7 @@ function peg$parse(input, options) { peg$currPos += 3; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c211); } + if (peg$silentFails === 0) { peg$fail(peg$c219); } } if (s3 !== peg$FAILED) { s4 = peg$parse_(); @@ -5232,44 +5462,44 @@ function peg$parse(input, options) { function peg$parsesec_abbrev() { var s0; - if (input.substr(peg$currPos, 7) === peg$c212) { - s0 = peg$c212; + if (input.substr(peg$currPos, 7) === peg$c220) { + s0 = peg$c220; peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c213); } + if (peg$silentFails === 0) { peg$fail(peg$c221); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6) === peg$c214) { - s0 = peg$c214; + if (input.substr(peg$currPos, 6) === peg$c222) { + s0 = peg$c222; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c215); } + if (peg$silentFails === 0) { peg$fail(peg$c223); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c216) { - s0 = peg$c216; + if (input.substr(peg$currPos, 4) === peg$c224) { + s0 = peg$c224; peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c217); } + if (peg$silentFails === 0) { peg$fail(peg$c225); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 3) === peg$c218) { - s0 = peg$c218; + if (input.substr(peg$currPos, 3) === peg$c226) { + s0 = peg$c226; peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c219); } + if (peg$silentFails === 0) { peg$fail(peg$c227); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 115) { - s0 = peg$c220; + s0 = peg$c228; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c221); } + if (peg$silentFails === 0) { peg$fail(peg$c229); } } } } @@ -5282,28 +5512,28 @@ function peg$parse(input, options) { function peg$parsemin_abbrev() { var s0; - if (input.substr(peg$currPos, 7) === peg$c222) { - s0 = peg$c222; + if (input.substr(peg$currPos, 7) === peg$c230) { + s0 = peg$c230; peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c223); } + if (peg$silentFails === 0) { peg$fail(peg$c231); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 6) === peg$c224) { - s0 = peg$c224; + if (input.substr(peg$currPos, 6) === peg$c232) { + s0 = peg$c232; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c225); } + if (peg$silentFails === 0) { peg$fail(peg$c233); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c226) { - s0 = peg$c226; + if (input.substr(peg$currPos, 4) === peg$c234) { + s0 = peg$c234; peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c227); } + if (peg$silentFails === 0) { peg$fail(peg$c235); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c135) { @@ -5311,15 +5541,15 @@ function peg$parse(input, options) { peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c228); } + if (peg$silentFails === 0) { peg$fail(peg$c236); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 109) { - s0 = peg$c229; + s0 = peg$c237; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c230); } + if (peg$silentFails === 0) { peg$fail(peg$c238); } } } } @@ -5332,44 +5562,44 @@ function peg$parse(input, options) { function peg$parsehour_abbrev() { var s0; - if (input.substr(peg$currPos, 5) === peg$c231) { - s0 = peg$c231; + if (input.substr(peg$currPos, 5) === peg$c239) { + s0 = peg$c239; peg$currPos += 5; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c232); } + if (peg$silentFails === 0) { peg$fail(peg$c240); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 3) === peg$c233) { - s0 = peg$c233; + if (input.substr(peg$currPos, 3) === peg$c241) { + s0 = peg$c241; peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c234); } + if (peg$silentFails === 0) { peg$fail(peg$c242); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c235) { - s0 = peg$c235; + if (input.substr(peg$currPos, 2) === peg$c243) { + s0 = peg$c243; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c236); } + if (peg$silentFails === 0) { peg$fail(peg$c244); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 104) { - s0 = peg$c237; + s0 = peg$c245; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c238); } + if (peg$silentFails === 0) { peg$fail(peg$c246); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c239) { - s0 = peg$c239; + if (input.substr(peg$currPos, 4) === peg$c247) { + s0 = peg$c247; peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c240); } + if (peg$silentFails === 0) { peg$fail(peg$c248); } } } } @@ -5382,28 +5612,28 @@ function peg$parse(input, options) { function peg$parseday_abbrev() { var s0; - if (input.substr(peg$currPos, 4) === peg$c241) { - s0 = peg$c241; + if (input.substr(peg$currPos, 4) === peg$c249) { + s0 = peg$c249; peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c242); } + if (peg$silentFails === 0) { peg$fail(peg$c250); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 3) === peg$c243) { - s0 = peg$c243; + if (input.substr(peg$currPos, 3) === peg$c251) { + s0 = peg$c251; peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c244); } + if (peg$silentFails === 0) { peg$fail(peg$c252); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 100) { - s0 = peg$c245; + s0 = peg$c253; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c246); } + if (peg$silentFails === 0) { peg$fail(peg$c254); } } } } @@ -5414,44 +5644,44 @@ function peg$parse(input, options) { function peg$parseweek_abbrev() { var s0; - if (input.substr(peg$currPos, 5) === peg$c247) { - s0 = peg$c247; + if (input.substr(peg$currPos, 5) === peg$c255) { + s0 = peg$c255; peg$currPos += 5; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c248); } + if (peg$silentFails === 0) { peg$fail(peg$c256); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c249) { - s0 = peg$c249; + if (input.substr(peg$currPos, 4) === peg$c257) { + s0 = peg$c257; peg$currPos += 4; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c250); } + if (peg$silentFails === 0) { peg$fail(peg$c258); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 3) === peg$c251) { - s0 = peg$c251; + if (input.substr(peg$currPos, 3) === peg$c259) { + s0 = peg$c259; peg$currPos += 3; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c252); } + if (peg$silentFails === 0) { peg$fail(peg$c260); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c253) { - s0 = peg$c253; + if (input.substr(peg$currPos, 2) === peg$c261) { + s0 = peg$c261; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c254); } + if (peg$silentFails === 0) { peg$fail(peg$c262); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 119) { - s0 = peg$c255; + s0 = peg$c263; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c256); } + if (peg$silentFails === 0) { peg$fail(peg$c264); } } } } @@ -5465,16 +5695,16 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c214) { - s1 = peg$c214; + if (input.substr(peg$currPos, 6) === peg$c222) { + s1 = peg$c222; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c215); } + if (peg$silentFails === 0) { peg$fail(peg$c223); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c257(); + s1 = peg$c265(); } s0 = s1; if (s0 === peg$FAILED) { @@ -5489,7 +5719,7 @@ function peg$parse(input, options) { s3 = peg$parsesec_abbrev(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c258(s1); + s1 = peg$c266(s1); s0 = s1; } else { peg$currPos = s0; @@ -5512,16 +5742,16 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c224) { - s1 = peg$c224; + if (input.substr(peg$currPos, 6) === peg$c232) { + s1 = peg$c232; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c225); } + if (peg$silentFails === 0) { peg$fail(peg$c233); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c259(); + s1 = peg$c267(); } s0 = s1; if (s0 === peg$FAILED) { @@ -5536,7 +5766,7 @@ function peg$parse(input, options) { s3 = peg$parsemin_abbrev(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c260(s1); + s1 = peg$c268(s1); s0 = s1; } else { peg$currPos = s0; @@ -5559,16 +5789,16 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c239) { - s1 = peg$c239; + if (input.substr(peg$currPos, 4) === peg$c247) { + s1 = peg$c247; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c240); } + if (peg$silentFails === 0) { peg$fail(peg$c248); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c261(); + s1 = peg$c269(); } s0 = s1; if (s0 === peg$FAILED) { @@ -5583,7 +5813,7 @@ function peg$parse(input, options) { s3 = peg$parsehour_abbrev(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c262(s1); + s1 = peg$c270(s1); s0 = s1; } else { peg$currPos = s0; @@ -5606,16 +5836,16 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 3) === peg$c243) { - s1 = peg$c243; + if (input.substr(peg$currPos, 3) === peg$c251) { + s1 = peg$c251; peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c244); } + if (peg$silentFails === 0) { peg$fail(peg$c252); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c263(); + s1 = peg$c271(); } s0 = s1; if (s0 === peg$FAILED) { @@ -5630,7 +5860,7 @@ function peg$parse(input, options) { s3 = peg$parseday_abbrev(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c264(s1); + s1 = peg$c272(s1); s0 = s1; } else { peg$currPos = s0; @@ -5663,7 +5893,7 @@ function peg$parse(input, options) { s3 = peg$parseweek_abbrev(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c265(s1); + s1 = peg$c273(s1); s0 = s1; } else { peg$currPos = s0; @@ -5750,7 +5980,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c266(s1); + s1 = peg$c274(s1); } s0 = s1; @@ -5762,11 +5992,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c267; + s1 = peg$c275; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c268); } + if (peg$silentFails === 0) { peg$fail(peg$c276); } } if (s1 !== peg$FAILED) { s2 = peg$parsesuint(); @@ -5804,7 +6034,7 @@ function peg$parse(input, options) { s2 = peg$parseip6tail(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c269(s1, s2); + s1 = peg$c277(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5825,12 +6055,12 @@ function peg$parse(input, options) { s3 = peg$parseh_append(); } if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c270) { - s3 = peg$c270; + if (input.substr(peg$currPos, 2) === peg$c278) { + s3 = peg$c278; peg$currPos += 2; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c271); } + if (peg$silentFails === 0) { peg$fail(peg$c279); } } if (s3 !== peg$FAILED) { s4 = []; @@ -5843,7 +6073,7 @@ function peg$parse(input, options) { s5 = peg$parseip6tail(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c272(s1, s2, s4, s5); + s1 = peg$c280(s1, s2, s4, s5); s0 = s1; } else { peg$currPos = s0; @@ -5867,12 +6097,12 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c270) { - s1 = peg$c270; + if (input.substr(peg$currPos, 2) === peg$c278) { + s1 = peg$c278; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c271); } + if (peg$silentFails === 0) { peg$fail(peg$c279); } } if (s1 !== peg$FAILED) { s2 = []; @@ -5885,7 +6115,7 @@ function peg$parse(input, options) { s3 = peg$parseip6tail(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c273(s2, s3); + s1 = peg$c281(s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -5910,16 +6140,16 @@ function peg$parse(input, options) { s3 = peg$parseh_append(); } if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c270) { - s3 = peg$c270; + if (input.substr(peg$currPos, 2) === peg$c278) { + s3 = peg$c278; peg$currPos += 2; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c271); } + if (peg$silentFails === 0) { peg$fail(peg$c279); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c274(s1, s2); + s1 = peg$c282(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -5935,16 +6165,16 @@ function peg$parse(input, options) { } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c270) { - s1 = peg$c270; + if (input.substr(peg$currPos, 2) === peg$c278) { + s1 = peg$c278; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c271); } + if (peg$silentFails === 0) { peg$fail(peg$c279); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c275(); + s1 = peg$c283(); } s0 = s1; } @@ -5971,17 +6201,17 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c267; + s1 = peg$c275; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c268); } + if (peg$silentFails === 0) { peg$fail(peg$c276); } } if (s1 !== peg$FAILED) { s2 = peg$parseh16(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c276(s2); + s1 = peg$c284(s2); s0 = s1; } else { peg$currPos = s0; @@ -6002,15 +6232,15 @@ function peg$parse(input, options) { s1 = peg$parseh16(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c267; + s2 = peg$c275; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c268); } + if (peg$silentFails === 0) { peg$fail(peg$c276); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c277(s1); + s1 = peg$c285(s1); s0 = s1; } else { peg$currPos = s0; @@ -6077,7 +6307,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c278(s1); + s1 = peg$c286(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -6111,7 +6341,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c279(s1); + s1 = peg$c287(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -6119,7 +6349,7 @@ function peg$parse(input, options) { s1 = peg$parseunsignedInteger(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c280(s1); + s1 = peg$c288(s1); } s0 = s1; } @@ -6146,7 +6376,7 @@ function peg$parse(input, options) { s3 = peg$parseunsignedInteger(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c281(s1, s3); + s1 = peg$c289(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -6181,7 +6411,7 @@ function peg$parse(input, options) { s3 = peg$parseunsignedInteger(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c282(s1, s3); + s1 = peg$c290(s1, s3); s0 = s1; } else { peg$currPos = s0; @@ -6206,7 +6436,7 @@ function peg$parse(input, options) { s1 = peg$parsesuint(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c283(s1); + s1 = peg$c291(s1); } s0 = s1; @@ -6255,7 +6485,7 @@ function peg$parse(input, options) { s1 = peg$parsesinteger(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c283(s1); + s1 = peg$c291(s1); } s0 = s1; @@ -6266,12 +6496,12 @@ function peg$parse(input, options) { var s0, s1, s2; s0 = peg$currPos; - if (peg$c284.test(input.charAt(peg$currPos))) { + if (peg$c292.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c285); } + if (peg$silentFails === 0) { peg$fail(peg$c293); } } if (s1 === peg$FAILED) { s1 = null; @@ -6301,7 +6531,7 @@ function peg$parse(input, options) { s1 = peg$parsesdouble(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c286(s1); + s1 = peg$c294(s1); } s0 = s1; @@ -6359,7 +6589,7 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c287(); + s1 = peg$c295(); s0 = s1; } else { peg$currPos = s0; @@ -6419,7 +6649,7 @@ function peg$parse(input, options) { } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c287(); + s1 = peg$c295(); s0 = s1; } else { peg$currPos = s0; @@ -6446,20 +6676,20 @@ function peg$parse(input, options) { var s0, s1, s2, s3; if (input.charCodeAt(peg$currPos) === 48) { - s0 = peg$c288; + s0 = peg$c296; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c289); } + if (peg$silentFails === 0) { peg$fail(peg$c297); } } if (s0 === peg$FAILED) { s0 = peg$currPos; - if (peg$c290.test(input.charAt(peg$currPos))) { + if (peg$c298.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c291); } + if (peg$silentFails === 0) { peg$fail(peg$c299); } } if (s1 !== peg$FAILED) { s2 = []; @@ -6514,12 +6744,12 @@ function peg$parse(input, options) { var s0, s1, s2; s0 = peg$currPos; - if (input.substr(peg$currPos, 1).toLowerCase() === peg$c292) { + if (input.substr(peg$currPos, 1).toLowerCase() === peg$c300) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c293); } + if (peg$silentFails === 0) { peg$fail(peg$c301); } } if (s1 !== peg$FAILED) { s2 = peg$parsesinteger(); @@ -6554,7 +6784,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c294(s1); + s1 = peg$c302(s1); } s0 = s1; @@ -6564,12 +6794,12 @@ function peg$parse(input, options) { function peg$parsehexdigit() { var s0; - if (peg$c295.test(input.charAt(peg$currPos))) { + if (peg$c303.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c296); } + if (peg$silentFails === 0) { peg$fail(peg$c304); } } return s0; @@ -6591,7 +6821,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c297(s1); + s1 = peg$c305(s1); } s0 = s1; @@ -6603,11 +6833,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c298; + s1 = peg$c306; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c299); } + if (peg$silentFails === 0) { peg$fail(peg$c307); } } if (s1 !== peg$FAILED) { s2 = peg$parseescapeSequence(); @@ -6630,12 +6860,12 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$currPos; peg$silentFails++; - if (peg$c300.test(input.charAt(peg$currPos))) { + if (peg$c308.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c301); } + if (peg$silentFails === 0) { peg$fail(peg$c309); } } if (s2 === peg$FAILED) { s2 = peg$parsews(); @@ -6653,7 +6883,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c302); } + if (peg$silentFails === 0) { peg$fail(peg$c310); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; @@ -6677,11 +6907,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c303; + s1 = peg$c311; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c304); } + if (peg$silentFails === 0) { peg$fail(peg$c312); } } if (s1 !== peg$FAILED) { s2 = []; @@ -6692,15 +6922,15 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c303; + s3 = peg$c311; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c304); } + if (peg$silentFails === 0) { peg$fail(peg$c312); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c305(s2); + s1 = peg$c313(s2); s0 = s1; } else { peg$currPos = s0; @@ -6717,11 +6947,11 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 39) { - s1 = peg$c306; + s1 = peg$c314; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c307); } + if (peg$silentFails === 0) { peg$fail(peg$c315); } } if (s1 !== peg$FAILED) { s2 = []; @@ -6732,15 +6962,15 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { - s3 = peg$c306; + s3 = peg$c314; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c307); } + if (peg$silentFails === 0) { peg$fail(peg$c315); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c305(s2); + s1 = peg$c313(s2); s0 = s1; } else { peg$currPos = s0; @@ -6766,11 +6996,11 @@ function peg$parse(input, options) { s1 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 34) { - s2 = peg$c303; + s2 = peg$c311; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c304); } + if (peg$silentFails === 0) { peg$fail(peg$c312); } } if (s2 === peg$FAILED) { s2 = peg$parseescapedChar(); @@ -6788,7 +7018,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c302); } + if (peg$silentFails === 0) { peg$fail(peg$c310); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; @@ -6805,11 +7035,11 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c298; + s1 = peg$c306; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c299); } + if (peg$silentFails === 0) { peg$fail(peg$c307); } } if (s1 !== peg$FAILED) { s2 = peg$parseescapeSequence(); @@ -6837,11 +7067,11 @@ function peg$parse(input, options) { s1 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 39) { - s2 = peg$c306; + s2 = peg$c314; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c307); } + if (peg$silentFails === 0) { peg$fail(peg$c315); } } if (s2 === peg$FAILED) { s2 = peg$parseescapedChar(); @@ -6859,7 +7089,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c302); } + if (peg$silentFails === 0) { peg$fail(peg$c310); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; @@ -6876,11 +7106,11 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c298; + s1 = peg$c306; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c299); } + if (peg$silentFails === 0) { peg$fail(peg$c307); } } if (s1 !== peg$FAILED) { s2 = peg$parseescapeSequence(); @@ -6906,11 +7136,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 120) { - s1 = peg$c308; + s1 = peg$c316; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c309); } + if (peg$silentFails === 0) { peg$fail(peg$c317); } } if (s1 !== peg$FAILED) { s2 = peg$parsehexdigit(); @@ -6918,7 +7148,7 @@ function peg$parse(input, options) { s3 = peg$parsehexdigit(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c310(); + s1 = peg$c318(); s0 = s1; } else { peg$currPos = s0; @@ -6946,110 +7176,110 @@ function peg$parse(input, options) { var s0, s1; if (input.charCodeAt(peg$currPos) === 39) { - s0 = peg$c306; + s0 = peg$c314; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c307); } + if (peg$silentFails === 0) { peg$fail(peg$c315); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s0 = peg$c303; + s0 = peg$c311; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c304); } + if (peg$silentFails === 0) { peg$fail(peg$c312); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 92) { - s0 = peg$c298; + s0 = peg$c306; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c299); } + if (peg$silentFails === 0) { peg$fail(peg$c307); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 98) { - s1 = peg$c311; + s1 = peg$c319; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c312); } + if (peg$silentFails === 0) { peg$fail(peg$c320); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c313(); + s1 = peg$c321(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 102) { - s1 = peg$c314; + s1 = peg$c322; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c315); } + if (peg$silentFails === 0) { peg$fail(peg$c323); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c316(); + s1 = peg$c324(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 110) { - s1 = peg$c317; + s1 = peg$c325; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c318); } + if (peg$silentFails === 0) { peg$fail(peg$c326); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c319(); + s1 = peg$c327(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 114) { - s1 = peg$c320; + s1 = peg$c328; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c321); } + if (peg$silentFails === 0) { peg$fail(peg$c329); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c322(); + s1 = peg$c330(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 116) { - s1 = peg$c323; + s1 = peg$c331; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c324); } + if (peg$silentFails === 0) { peg$fail(peg$c332); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c325(); + s1 = peg$c333(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 118) { - s1 = peg$c326; + s1 = peg$c334; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c327); } + if (peg$silentFails === 0) { peg$fail(peg$c335); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c328(); + s1 = peg$c336(); } s0 = s1; } @@ -7077,7 +7307,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c329(); + s1 = peg$c337(); } s0 = s1; if (s0 === peg$FAILED) { @@ -7091,7 +7321,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c330(); + s1 = peg$c338(); } s0 = s1; } @@ -7104,11 +7334,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 117) { - s1 = peg$c331; + s1 = peg$c339; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c332); } + if (peg$silentFails === 0) { peg$fail(peg$c340); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -7140,7 +7370,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c333(s2); + s1 = peg$c341(s2); s0 = s1; } else { peg$currPos = s0; @@ -7153,19 +7383,19 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 117) { - s1 = peg$c331; + s1 = peg$c339; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c332); } + if (peg$silentFails === 0) { peg$fail(peg$c340); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { - s2 = peg$c334; + s2 = peg$c342; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c335); } + if (peg$silentFails === 0) { peg$fail(peg$c343); } } if (s2 !== peg$FAILED) { s3 = peg$currPos; @@ -7224,15 +7454,15 @@ function peg$parse(input, options) { } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { - s4 = peg$c336; + s4 = peg$c344; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c337); } + if (peg$silentFails === 0) { peg$fail(peg$c345); } } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c333(s3); + s1 = peg$c341(s3); s0 = s1; } else { peg$currPos = s0; @@ -7301,39 +7531,39 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = []; - if (peg$c338.test(input.charAt(peg$currPos))) { + if (peg$c346.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c339); } + if (peg$silentFails === 0) { peg$fail(peg$c347); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c340) { - s2 = peg$c340; + if (input.substr(peg$currPos, 2) === peg$c348) { + s2 = peg$c348; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c341); } + if (peg$silentFails === 0) { peg$fail(peg$c349); } } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); - if (peg$c338.test(input.charAt(peg$currPos))) { + if (peg$c346.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c339); } + if (peg$silentFails === 0) { peg$fail(peg$c347); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c340) { - s2 = peg$c340; + if (input.substr(peg$currPos, 2) === peg$c348) { + s2 = peg$c348; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c341); } + if (peg$silentFails === 0) { peg$fail(peg$c349); } } } } @@ -7352,12 +7582,12 @@ function peg$parse(input, options) { function peg$parseescapedChar() { var s0; - if (peg$c342.test(input.charAt(peg$currPos))) { + if (peg$c350.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c343); } + if (peg$silentFails === 0) { peg$fail(peg$c351); } } return s0; @@ -7367,51 +7597,51 @@ function peg$parse(input, options) { var s0; if (input.charCodeAt(peg$currPos) === 9) { - s0 = peg$c344; + s0 = peg$c352; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c345); } + if (peg$silentFails === 0) { peg$fail(peg$c353); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 11) { - s0 = peg$c346; + s0 = peg$c354; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c347); } + if (peg$silentFails === 0) { peg$fail(peg$c355); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 12) { - s0 = peg$c348; + s0 = peg$c356; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c349); } + if (peg$silentFails === 0) { peg$fail(peg$c357); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 32) { - s0 = peg$c350; + s0 = peg$c358; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c351); } + if (peg$silentFails === 0) { peg$fail(peg$c359); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 160) { - s0 = peg$c352; + s0 = peg$c360; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c353); } + if (peg$silentFails === 0) { peg$fail(peg$c361); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 65279) { - s0 = peg$c354; + s0 = peg$c362; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c355); } + if (peg$silentFails === 0) { peg$fail(peg$c363); } } } } @@ -7439,7 +7669,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c356); } + if (peg$silentFails === 0) { peg$fail(peg$c364); } } return s0; @@ -7468,7 +7698,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c302); } + if (peg$silentFails === 0) { peg$fail(peg$c310); } } peg$silentFails--; if (s1 === peg$FAILED) { @@ -7601,6 +7831,10 @@ function peg$parse(input, options) { return ret } + function makeFunctionCall(fn, args) { + return { op: "FunctionCall", function: fn, args }; + } + function joinChars(chars) { return chars.join(""); } diff --git a/zql/zql.peg b/zql/zql.peg index e0b803db75..3192314462 100644 --- a/zql/zql.peg +++ b/zql/zql.peg @@ -497,36 +497,23 @@ NotExpression / CallExpression -#ifdef notyet - CallExpression - = fn:FunctionName __ "(" __ args:ArgumentList __ ")" { - RETURN(XXX) + = fn:FunctionName __ "(" args:ArgumentList ")" { + RETURN(makeFunctionCall(fn, args)) } / DereferenceExpression FunctionName - = first:FunctionNameComponent - rest:("." n:FunctionNameComponent { RETURN(n) })* { - RETURN(XXX) - } - -FunctionNameComponent = FunctionNameStart FunctionNameRest* { RETURN(TEXT) } FunctionNameStart = [A-Za-z] -FunctionNameRest = FunctionNameStart / [0-9] +FunctionNameRest = FunctionNameStart / [.0-9] ArgumentList = first:Expression rest:(__ "," __ e:Expression { RETURN(e) })* { - RETURN(XXX) - } - -#else - -CallExpression = DereferenceExpression - -#endif + RETURN(PREPEND(first, rest)) + } + / __ { RETURN(ARRAY()) } DereferenceExpression = base:PrimaryExpression