From 0b1e3fc77d982f709d246e32917015294ba73194 Mon Sep 17 00:00:00 2001 From: Uwe Krueger Date: Sun, 23 May 2021 21:07:57 +0200 Subject: [PATCH 1/5] tags and tagged references --- dynaml/auto.go | 2 +- dynaml/call.go | 4 +- dynaml/call_test.go | 30 +- dynaml/concatenation_test.go | 10 +- dynaml/cond_test.go | 4 +- dynaml/dynamic_expression.go | 2 +- dynaml/dynamic_expression_test.go | 4 +- dynaml/dynaml.peg | 7 +- dynaml/dynaml.peg.go | 3417 +++++++++++++++-------------- dynaml/expression.go | 33 + dynaml/list_test.go | 2 +- dynaml/mapping_test.go | 8 +- dynaml/marker.go | 9 + dynaml/parser.go | 15 +- dynaml/parser_test.go | 283 +-- dynaml/qualified_expression.go | 2 +- dynaml/reference.go | 31 +- dynaml/reference_test.go | 6 +- dynaml/static_ips.go | 6 +- dynaml/sum_test.go | 8 +- dynaml/unresolved_check.go | 25 +- dynaml/validor_test.go | 2 +- flow/cascade.go | 1 + flow/environment.go | 14 + flow/flow.go | 67 +- flow/flow_tag_test.go | 97 + flow/state.go | 34 + go.sum | 140 ++ vendor/modules.txt | 1 + yaml/node.go | 18 +- 30 files changed, 2466 insertions(+), 1816 deletions(-) create mode 100644 flow/flow_tag_test.go diff --git a/dynaml/auto.go b/dynaml/auto.go index 7936499..f939c5b 100644 --- a/dynaml/auto.go +++ b/dynaml/auto.go @@ -5,7 +5,7 @@ import ( ) var ( - refJobs = ReferenceExpr{[]string{"", "jobs"}} + refJobs = NewReferenceExpr("", "jobs") ) type AutoExpr struct { diff --git a/dynaml/call.go b/dynaml/call.go index f798145..a71c800 100644 --- a/dynaml/call.go +++ b/dynaml/call.go @@ -139,9 +139,9 @@ func (e CallExpr) Evaluate(binding Binding, locally bool) (interface{}, Evaluati for i, v := range values { args[i] = ValueExpr{v} } - args[len(values)] = ListExpansionExpr{ReferenceExpr{[]string{"__args"}}} + args[len(values)] = ListExpansionExpr{NewReferenceExpr("__args")} expr := CallExpr{ - Function: ReferenceExpr{[]string{funcName}}, + Function: NewReferenceExpr(funcName), Arguments: args, } diff --git a/dynaml/call_test.go b/dynaml/call_test.go index a7d6e6b..df6699a 100644 --- a/dynaml/call_test.go +++ b/dynaml/call_test.go @@ -26,7 +26,7 @@ var _ = Describe("calls", func() { Describe("CIDR functions", func() { It("contains IP", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"contains_ip"}}, + Function: ReferenceExpr{Path: []string{"contains_ip"}}, Arguments: []Expression{ StringExpr{"192.168.1.1/24"}, StringExpr{"192.168.1.2"}, @@ -42,7 +42,7 @@ var _ = Describe("calls", func() { }) It("not contains IP", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"contains_ip"}}, + Function: ReferenceExpr{Path: []string{"contains_ip"}}, Arguments: []Expression{ StringExpr{"192.168.1.1/24"}, StringExpr{"192.168.2.0"}, @@ -58,7 +58,7 @@ var _ = Describe("calls", func() { }) It("not contains IP", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"contains_ip"}}, + Function: ReferenceExpr{Path: []string{"contains_ip"}}, Arguments: []Expression{ StringExpr{"192.168.1.1/24"}, StringExpr{"192.168.0.255"}, @@ -75,7 +75,7 @@ var _ = Describe("calls", func() { It("determines minimal IP", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"min_ip"}}, + Function: ReferenceExpr{Path: []string{"min_ip"}}, Arguments: []Expression{ StringExpr{"192.168.0.1/24"}, }, @@ -91,7 +91,7 @@ var _ = Describe("calls", func() { It("determines maximal IP", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"max_ip"}}, + Function: ReferenceExpr{Path: []string{"max_ip"}}, Arguments: []Expression{ StringExpr{"192.168.0.1/24"}, }, @@ -107,7 +107,7 @@ var _ = Describe("calls", func() { It("determines number of IPs", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"num_ip"}}, + Function: ReferenceExpr{Path: []string{"num_ip"}}, Arguments: []Expression{ StringExpr{"192.168.0.1/24"}, }, @@ -123,7 +123,7 @@ var _ = Describe("calls", func() { It("determines number of IPs for /22", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"num_ip"}}, + Function: ReferenceExpr{Path: []string{"num_ip"}}, Arguments: []Expression{ StringExpr{"192.168.0.1/22"}, }, @@ -140,11 +140,11 @@ var _ = Describe("calls", func() { Describe("join(\", \"...)", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"join"}}, + Function: ReferenceExpr{Path: []string{"join"}}, Arguments: []Expression{ StringExpr{", "}, - ReferenceExpr{[]string{"alice"}}, - ReferenceExpr{[]string{"bob"}}, + ReferenceExpr{Path: []string{"alice"}}, + ReferenceExpr{Path: []string{"bob"}}, }, } @@ -203,7 +203,7 @@ var _ = Describe("calls", func() { It("joins nothing", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"join"}}, + Function: ReferenceExpr{Path: []string{"join"}}, Arguments: []Expression{ StringExpr{", "}, }, @@ -219,7 +219,7 @@ var _ = Describe("calls", func() { It("fails for missing args", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"join"}}, + Function: ReferenceExpr{Path: []string{"join"}}, Arguments: []Expression{}, } @@ -228,7 +228,7 @@ var _ = Describe("calls", func() { It("fails for wrong separator type", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"join"}}, + Function: ReferenceExpr{Path: []string{"join"}}, Arguments: []Expression{ ListExpr{[]Expression{IntegerExpr{0}}}, }, @@ -240,7 +240,7 @@ var _ = Describe("calls", func() { Describe("static_ips(ips...)", func() { expr := CallExpr{ - Function: ReferenceExpr{[]string{"static_ips"}}, + Function: ReferenceExpr{Path: []string{"static_ips"}}, Arguments: []Expression{ IntegerExpr{0}, IntegerExpr{4}, @@ -316,7 +316,7 @@ var _ = Describe("calls", func() { `) expr := CallExpr{ - Function: ReferenceExpr{[]string{"static_ips"}}, + Function: ReferenceExpr{Path: []string{"static_ips"}}, Arguments: []Expression{ IntegerExpr{0}, IntegerExpr{4}, diff --git a/dynaml/concatenation_test.go b/dynaml/concatenation_test.go index 605e1e3..aaa8d37 100644 --- a/dynaml/concatenation_test.go +++ b/dynaml/concatenation_test.go @@ -95,7 +95,7 @@ var _ = Describe("concatenation", func() { It("appends to the lists", func() { expr := ConcatenationExpr{ ListExpr{[]Expression{StringExpr{"two"}}}, - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, } binding := FakeBinding{ @@ -129,8 +129,8 @@ var _ = Describe("concatenation", func() { Context("and the right-hand side is a map", func() { It("merges both maps", func() { expr := ConcatenationExpr{ - ReferenceExpr{[]string{"foo"}}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"foo"}}, + ReferenceExpr{Path: []string{"bar"}}, } binding := FakeBinding{ @@ -147,8 +147,8 @@ var _ = Describe("concatenation", func() { It("overwrites existing map entries", func() { expr := ConcatenationExpr{ - ReferenceExpr{[]string{"foo"}}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"foo"}}, + ReferenceExpr{Path: []string{"bar"}}, } binding := FakeBinding{ diff --git a/dynaml/cond_test.go b/dynaml/cond_test.go index 2a7a378..31b7581 100644 --- a/dynaml/cond_test.go +++ b/dynaml/cond_test.go @@ -102,7 +102,7 @@ var _ = Describe("conditional operator", func() { "bar": NewNode("alice", nil), }, nil) expr := CondExpr{ - C: ReferenceExpr{[]string{"foo"}}, + C: ReferenceExpr{Path: []string{"foo"}}, T: IntegerExpr{2}, F: IntegerExpr{3}, } @@ -113,7 +113,7 @@ var _ = Describe("conditional operator", func() { It("returns second if length == 0", func() { mapNode := NewNode(map[string]yaml.Node{}, nil) expr := CondExpr{ - C: ReferenceExpr{[]string{"foo"}}, + C: ReferenceExpr{Path: []string{"foo"}}, T: IntegerExpr{2}, F: IntegerExpr{3}, } diff --git a/dynaml/dynamic_expression.go b/dynaml/dynamic_expression.go index 6f594c6..10a7329 100644 --- a/dynaml/dynamic_expression.go +++ b/dynaml/dynamic_expression.go @@ -65,7 +65,7 @@ func (e DynamicExpr) Evaluate(binding Binding, locally bool) (interface{}, Evalu default: return info.Error("index or field name required for reference qualifier") } - return ReferenceExpr{qual}.find(func(end int, path []string) (yaml.Node, bool) { + return NewReferenceExpr(qual...).find(func(end int, path []string) (yaml.Node, bool) { return yaml.Find(NewNode(root, nil), path[:end+1]...) }, binding, locally) } diff --git a/dynaml/dynamic_expression_test.go b/dynaml/dynamic_expression_test.go index b71730a..1080a77 100644 --- a/dynaml/dynamic_expression_test.go +++ b/dynaml/dynamic_expression_test.go @@ -10,7 +10,7 @@ import ( var _ = Describe("dynamic references", func() { Context("when a dynamic string reference is found", func() { It("evaluates to the map entry", func() { - ref := ReferenceExpr{[]string{"foo"}} + ref := ReferenceExpr{Path: []string{"foo"}} idx := StringExpr{"bar"} expr := DynamicExpr{ref, idx} @@ -28,7 +28,7 @@ var _ = Describe("dynamic references", func() { Context("when a dynamic array refernce is found", func() { It("evaluates to the indexed array entry", func() { - ref := ReferenceExpr{[]string{"foo"}} + ref := ReferenceExpr{Path: []string{"foo"}} idx := IntegerExpr{1} expr := DynamicExpr{ref, idx} binding := FakeBinding{ diff --git a/dynaml/dynaml.peg b/dynaml/dynaml.peg index 04dcacc..482de5c 100644 --- a/dynaml/dynaml.peg +++ b/dynaml/dynaml.peg @@ -7,7 +7,8 @@ Prefer <- ws 'prefer' req_ws Expression MarkedExpression <- ws Marker ( req_ws SubsequentMarker )* ws MarkerExpression ? ws SubsequentMarker <- Marker -Marker <- '&' ( 'template' / 'temporary' / 'local' / 'inject' / 'state' / 'default' ) +Marker <- '&' ( 'template' / 'temporary' / 'local' / 'inject' / 'state' / 'default' / TagMarker ) +TagMarker <- 'tag:' TagName MarkerExpression <- Grouped Expression <- ( Scoped / LambdaExpr / Level7 ) ws @@ -118,7 +119,9 @@ Name <- [a-zA-Z0-9_]+ DefaultValue <- '=' Expression VarParams <- '...' ws -Reference <- '.'? Key FollowUpRef +Reference <- (( Tag ('.' / Key)) / ( '.'? Key )) FollowUpRef +Tag <- TagName '::' +TagName <- [a-zA-Z0-9_]+ FollowUpRef <- PathComponent* PathComponent <- ( '.' Key ) / ( '.'? Index ) diff --git a/dynaml/dynaml.peg.go b/dynaml/dynaml.peg.go index 609a9be..c9dd40d 100644 --- a/dynaml/dynaml.peg.go +++ b/dynaml/dynaml.peg.go @@ -19,6 +19,7 @@ const ( ruleMarkedExpression ruleSubsequentMarker ruleMarker + ruleTagMarker ruleMarkerExpression ruleExpression ruleScoped @@ -106,6 +107,8 @@ const ( ruleDefaultValue ruleVarParams ruleReference + ruleTag + ruleTagName ruleFollowUpRef rulePathComponent ruleKey @@ -129,6 +132,7 @@ var rul3s = [...]string{ "MarkedExpression", "SubsequentMarker", "Marker", + "TagMarker", "MarkerExpression", "Expression", "Scoped", @@ -216,6 +220,8 @@ var rul3s = [...]string{ "DefaultValue", "VarParams", "Reference", + "Tag", + "TagName", "FollowUpRef", "PathComponent", "Key", @@ -544,7 +550,7 @@ func (t *tokens32) Expand(index int) tokenTree { type DynamlGrammar struct { Buffer string buffer []rune - rules [103]func() bool + rules [106]func() bool Parse func(rule ...int) error Reset func() Pretty bool @@ -855,7 +861,7 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position14, tokenIndex14, depth14 return false }, - /* 4 Marker <- <('&' (('t' 'e' 'm' 'p' 'l' 'a' 't' 'e') / ('t' 'e' 'm' 'p' 'o' 'r' 'a' 'r' 'y') / ('l' 'o' 'c' 'a' 'l') / ('i' 'n' 'j' 'e' 'c' 't') / ('s' 't' 'a' 't' 'e') / ('d' 'e' 'f' 'a' 'u' 'l' 't')))> */ + /* 4 Marker <- <('&' (('t' 'e' 'm' 'p' 'l' 'a' 't' 'e') / ('t' 'e' 'm' 'p' 'o' 'r' 'a' 'r' 'y') / ('l' 'o' 'c' 'a' 'l') / ('i' 'n' 'j' 'e' 'c' 't') / ('s' 't' 'a' 't' 'e') / ('d' 'e' 'f' 'a' 'u' 'l' 't') / TagMarker))> */ func() bool { position16, tokenIndex16, depth16 := position, tokenIndex, depth { @@ -1015,33 +1021,39 @@ func (p *DynamlGrammar) Init() { l23: position, tokenIndex, depth = position18, tokenIndex18, depth18 if buffer[position] != rune('d') { - goto l16 + goto l24 } position++ if buffer[position] != rune('e') { - goto l16 + goto l24 } position++ if buffer[position] != rune('f') { - goto l16 + goto l24 } position++ if buffer[position] != rune('a') { - goto l16 + goto l24 } position++ if buffer[position] != rune('u') { - goto l16 + goto l24 } position++ if buffer[position] != rune('l') { - goto l16 + goto l24 } position++ if buffer[position] != rune('t') { - goto l16 + goto l24 } position++ + goto l18 + l24: + position, tokenIndex, depth = position18, tokenIndex18, depth18 + if !_rules[ruleTagMarker]() { + goto l16 + } } l18: depth-- @@ -1052,3731 +1064,3892 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position16, tokenIndex16, depth16 return false }, - /* 5 MarkerExpression <- */ + /* 5 TagMarker <- <('t' 'a' 'g' ':' TagName)> */ func() bool { - position24, tokenIndex24, depth24 := position, tokenIndex, depth + position25, tokenIndex25, depth25 := position, tokenIndex, depth { - position25 := position + position26 := position + depth++ + if buffer[position] != rune('t') { + goto l25 + } + position++ + if buffer[position] != rune('a') { + goto l25 + } + position++ + if buffer[position] != rune('g') { + goto l25 + } + position++ + if buffer[position] != rune(':') { + goto l25 + } + position++ + if !_rules[ruleTagName]() { + goto l25 + } + depth-- + add(ruleTagMarker, position26) + } + return true + l25: + position, tokenIndex, depth = position25, tokenIndex25, depth25 + return false + }, + /* 6 MarkerExpression <- */ + func() bool { + position27, tokenIndex27, depth27 := position, tokenIndex, depth + { + position28 := position depth++ if !_rules[ruleGrouped]() { - goto l24 + goto l27 } depth-- - add(ruleMarkerExpression, position25) + add(ruleMarkerExpression, position28) } return true - l24: - position, tokenIndex, depth = position24, tokenIndex24, depth24 + l27: + position, tokenIndex, depth = position27, tokenIndex27, depth27 return false }, - /* 6 Expression <- <((Scoped / LambdaExpr / Level7) ws)> */ + /* 7 Expression <- <((Scoped / LambdaExpr / Level7) ws)> */ func() bool { - position26, tokenIndex26, depth26 := position, tokenIndex, depth + position29, tokenIndex29, depth29 := position, tokenIndex, depth { - position27 := position + position30 := position depth++ { - position28, tokenIndex28, depth28 := position, tokenIndex, depth + position31, tokenIndex31, depth31 := position, tokenIndex, depth if !_rules[ruleScoped]() { - goto l29 + goto l32 } - goto l28 - l29: - position, tokenIndex, depth = position28, tokenIndex28, depth28 + goto l31 + l32: + position, tokenIndex, depth = position31, tokenIndex31, depth31 if !_rules[ruleLambdaExpr]() { - goto l30 + goto l33 } - goto l28 - l30: - position, tokenIndex, depth = position28, tokenIndex28, depth28 + goto l31 + l33: + position, tokenIndex, depth = position31, tokenIndex31, depth31 if !_rules[ruleLevel7]() { - goto l26 + goto l29 } } - l28: + l31: if !_rules[rulews]() { - goto l26 + goto l29 } depth-- - add(ruleExpression, position27) + add(ruleExpression, position30) } return true - l26: - position, tokenIndex, depth = position26, tokenIndex26, depth26 + l29: + position, tokenIndex, depth = position29, tokenIndex29, depth29 return false }, - /* 7 Scoped <- <(ws Scope ws Expression)> */ + /* 8 Scoped <- <(ws Scope ws Expression)> */ func() bool { - position31, tokenIndex31, depth31 := position, tokenIndex, depth + position34, tokenIndex34, depth34 := position, tokenIndex, depth { - position32 := position + position35 := position depth++ if !_rules[rulews]() { - goto l31 + goto l34 } if !_rules[ruleScope]() { - goto l31 + goto l34 } if !_rules[rulews]() { - goto l31 + goto l34 } if !_rules[ruleExpression]() { - goto l31 + goto l34 } depth-- - add(ruleScoped, position32) + add(ruleScoped, position35) } return true - l31: - position, tokenIndex, depth = position31, tokenIndex31, depth31 + l34: + position, tokenIndex, depth = position34, tokenIndex34, depth34 return false }, - /* 8 Scope <- <(CreateScope ws Assignments? ')')> */ + /* 9 Scope <- <(CreateScope ws Assignments? ')')> */ func() bool { - position33, tokenIndex33, depth33 := position, tokenIndex, depth + position36, tokenIndex36, depth36 := position, tokenIndex, depth { - position34 := position + position37 := position depth++ if !_rules[ruleCreateScope]() { - goto l33 + goto l36 } if !_rules[rulews]() { - goto l33 + goto l36 } { - position35, tokenIndex35, depth35 := position, tokenIndex, depth + position38, tokenIndex38, depth38 := position, tokenIndex, depth if !_rules[ruleAssignments]() { - goto l35 + goto l38 } - goto l36 - l35: - position, tokenIndex, depth = position35, tokenIndex35, depth35 + goto l39 + l38: + position, tokenIndex, depth = position38, tokenIndex38, depth38 } - l36: + l39: if buffer[position] != rune(')') { - goto l33 + goto l36 } position++ depth-- - add(ruleScope, position34) + add(ruleScope, position37) } return true - l33: - position, tokenIndex, depth = position33, tokenIndex33, depth33 + l36: + position, tokenIndex, depth = position36, tokenIndex36, depth36 return false }, - /* 9 CreateScope <- <'('> */ + /* 10 CreateScope <- <'('> */ func() bool { - position37, tokenIndex37, depth37 := position, tokenIndex, depth + position40, tokenIndex40, depth40 := position, tokenIndex, depth { - position38 := position + position41 := position depth++ if buffer[position] != rune('(') { - goto l37 + goto l40 } position++ depth-- - add(ruleCreateScope, position38) + add(ruleCreateScope, position41) } return true - l37: - position, tokenIndex, depth = position37, tokenIndex37, depth37 + l40: + position, tokenIndex, depth = position40, tokenIndex40, depth40 return false }, - /* 10 Level7 <- <(ws Level6 (req_ws Or)*)> */ + /* 11 Level7 <- <(ws Level6 (req_ws Or)*)> */ func() bool { - position39, tokenIndex39, depth39 := position, tokenIndex, depth + position42, tokenIndex42, depth42 := position, tokenIndex, depth { - position40 := position + position43 := position depth++ if !_rules[rulews]() { - goto l39 + goto l42 } if !_rules[ruleLevel6]() { - goto l39 + goto l42 } - l41: + l44: { - position42, tokenIndex42, depth42 := position, tokenIndex, depth + position45, tokenIndex45, depth45 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l42 + goto l45 } if !_rules[ruleOr]() { - goto l42 + goto l45 } - goto l41 - l42: - position, tokenIndex, depth = position42, tokenIndex42, depth42 + goto l44 + l45: + position, tokenIndex, depth = position45, tokenIndex45, depth45 } depth-- - add(ruleLevel7, position40) + add(ruleLevel7, position43) } return true - l39: - position, tokenIndex, depth = position39, tokenIndex39, depth39 + l42: + position, tokenIndex, depth = position42, tokenIndex42, depth42 return false }, - /* 11 Or <- <(OrOp req_ws Level6)> */ + /* 12 Or <- <(OrOp req_ws Level6)> */ func() bool { - position43, tokenIndex43, depth43 := position, tokenIndex, depth + position46, tokenIndex46, depth46 := position, tokenIndex, depth { - position44 := position + position47 := position depth++ if !_rules[ruleOrOp]() { - goto l43 + goto l46 } if !_rules[rulereq_ws]() { - goto l43 + goto l46 } if !_rules[ruleLevel6]() { - goto l43 + goto l46 } depth-- - add(ruleOr, position44) + add(ruleOr, position47) } return true - l43: - position, tokenIndex, depth = position43, tokenIndex43, depth43 + l46: + position, tokenIndex, depth = position46, tokenIndex46, depth46 return false }, - /* 12 OrOp <- <(('|' '|') / ('/' '/'))> */ + /* 13 OrOp <- <(('|' '|') / ('/' '/'))> */ func() bool { - position45, tokenIndex45, depth45 := position, tokenIndex, depth + position48, tokenIndex48, depth48 := position, tokenIndex, depth { - position46 := position + position49 := position depth++ { - position47, tokenIndex47, depth47 := position, tokenIndex, depth + position50, tokenIndex50, depth50 := position, tokenIndex, depth if buffer[position] != rune('|') { - goto l48 + goto l51 } position++ if buffer[position] != rune('|') { - goto l48 + goto l51 } position++ - goto l47 - l48: - position, tokenIndex, depth = position47, tokenIndex47, depth47 + goto l50 + l51: + position, tokenIndex, depth = position50, tokenIndex50, depth50 if buffer[position] != rune('/') { - goto l45 + goto l48 } position++ if buffer[position] != rune('/') { - goto l45 + goto l48 } position++ } - l47: + l50: depth-- - add(ruleOrOp, position46) + add(ruleOrOp, position49) } return true - l45: - position, tokenIndex, depth = position45, tokenIndex45, depth45 + l48: + position, tokenIndex, depth = position48, tokenIndex48, depth48 return false }, - /* 13 Level6 <- <(Conditional / Level5)> */ + /* 14 Level6 <- <(Conditional / Level5)> */ func() bool { - position49, tokenIndex49, depth49 := position, tokenIndex, depth + position52, tokenIndex52, depth52 := position, tokenIndex, depth { - position50 := position + position53 := position depth++ { - position51, tokenIndex51, depth51 := position, tokenIndex, depth + position54, tokenIndex54, depth54 := position, tokenIndex, depth if !_rules[ruleConditional]() { - goto l52 + goto l55 } - goto l51 - l52: - position, tokenIndex, depth = position51, tokenIndex51, depth51 + goto l54 + l55: + position, tokenIndex, depth = position54, tokenIndex54, depth54 if !_rules[ruleLevel5]() { - goto l49 + goto l52 } } - l51: + l54: depth-- - add(ruleLevel6, position50) + add(ruleLevel6, position53) } return true - l49: - position, tokenIndex, depth = position49, tokenIndex49, depth49 + l52: + position, tokenIndex, depth = position52, tokenIndex52, depth52 return false }, - /* 14 Conditional <- <(Level5 ws '?' Expression ':' Expression)> */ + /* 15 Conditional <- <(Level5 ws '?' Expression ':' Expression)> */ func() bool { - position53, tokenIndex53, depth53 := position, tokenIndex, depth + position56, tokenIndex56, depth56 := position, tokenIndex, depth { - position54 := position + position57 := position depth++ if !_rules[ruleLevel5]() { - goto l53 + goto l56 } if !_rules[rulews]() { - goto l53 + goto l56 } if buffer[position] != rune('?') { - goto l53 + goto l56 } position++ if !_rules[ruleExpression]() { - goto l53 + goto l56 } if buffer[position] != rune(':') { - goto l53 + goto l56 } position++ if !_rules[ruleExpression]() { - goto l53 + goto l56 } depth-- - add(ruleConditional, position54) + add(ruleConditional, position57) } return true - l53: - position, tokenIndex, depth = position53, tokenIndex53, depth53 + l56: + position, tokenIndex, depth = position56, tokenIndex56, depth56 return false }, - /* 15 Level5 <- <(Level4 Concatenation*)> */ + /* 16 Level5 <- <(Level4 Concatenation*)> */ func() bool { - position55, tokenIndex55, depth55 := position, tokenIndex, depth + position58, tokenIndex58, depth58 := position, tokenIndex, depth { - position56 := position + position59 := position depth++ if !_rules[ruleLevel4]() { - goto l55 + goto l58 } - l57: + l60: { - position58, tokenIndex58, depth58 := position, tokenIndex, depth + position61, tokenIndex61, depth61 := position, tokenIndex, depth if !_rules[ruleConcatenation]() { - goto l58 + goto l61 } - goto l57 - l58: - position, tokenIndex, depth = position58, tokenIndex58, depth58 + goto l60 + l61: + position, tokenIndex, depth = position61, tokenIndex61, depth61 } depth-- - add(ruleLevel5, position56) + add(ruleLevel5, position59) } return true - l55: - position, tokenIndex, depth = position55, tokenIndex55, depth55 + l58: + position, tokenIndex, depth = position58, tokenIndex58, depth58 return false }, - /* 16 Concatenation <- <(req_ws Level4)> */ + /* 17 Concatenation <- <(req_ws Level4)> */ func() bool { - position59, tokenIndex59, depth59 := position, tokenIndex, depth + position62, tokenIndex62, depth62 := position, tokenIndex, depth { - position60 := position + position63 := position depth++ if !_rules[rulereq_ws]() { - goto l59 + goto l62 } if !_rules[ruleLevel4]() { - goto l59 + goto l62 } depth-- - add(ruleConcatenation, position60) + add(ruleConcatenation, position63) } return true - l59: - position, tokenIndex, depth = position59, tokenIndex59, depth59 + l62: + position, tokenIndex, depth = position62, tokenIndex62, depth62 return false }, - /* 17 Level4 <- <(Level3 (req_ws (LogOr / LogAnd))*)> */ + /* 18 Level4 <- <(Level3 (req_ws (LogOr / LogAnd))*)> */ func() bool { - position61, tokenIndex61, depth61 := position, tokenIndex, depth + position64, tokenIndex64, depth64 := position, tokenIndex, depth { - position62 := position + position65 := position depth++ if !_rules[ruleLevel3]() { - goto l61 + goto l64 } - l63: + l66: { - position64, tokenIndex64, depth64 := position, tokenIndex, depth + position67, tokenIndex67, depth67 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l64 + goto l67 } { - position65, tokenIndex65, depth65 := position, tokenIndex, depth + position68, tokenIndex68, depth68 := position, tokenIndex, depth if !_rules[ruleLogOr]() { - goto l66 + goto l69 } - goto l65 - l66: - position, tokenIndex, depth = position65, tokenIndex65, depth65 + goto l68 + l69: + position, tokenIndex, depth = position68, tokenIndex68, depth68 if !_rules[ruleLogAnd]() { - goto l64 + goto l67 } } - l65: - goto l63 - l64: - position, tokenIndex, depth = position64, tokenIndex64, depth64 + l68: + goto l66 + l67: + position, tokenIndex, depth = position67, tokenIndex67, depth67 } depth-- - add(ruleLevel4, position62) + add(ruleLevel4, position65) } return true - l61: - position, tokenIndex, depth = position61, tokenIndex61, depth61 + l64: + position, tokenIndex, depth = position64, tokenIndex64, depth64 return false }, - /* 18 LogOr <- <('-' 'o' 'r' req_ws Level3)> */ + /* 19 LogOr <- <('-' 'o' 'r' req_ws Level3)> */ func() bool { - position67, tokenIndex67, depth67 := position, tokenIndex, depth + position70, tokenIndex70, depth70 := position, tokenIndex, depth { - position68 := position + position71 := position depth++ if buffer[position] != rune('-') { - goto l67 + goto l70 } position++ if buffer[position] != rune('o') { - goto l67 + goto l70 } position++ if buffer[position] != rune('r') { - goto l67 + goto l70 } position++ if !_rules[rulereq_ws]() { - goto l67 + goto l70 } if !_rules[ruleLevel3]() { - goto l67 + goto l70 } depth-- - add(ruleLogOr, position68) + add(ruleLogOr, position71) } return true - l67: - position, tokenIndex, depth = position67, tokenIndex67, depth67 + l70: + position, tokenIndex, depth = position70, tokenIndex70, depth70 return false }, - /* 19 LogAnd <- <('-' 'a' 'n' 'd' req_ws Level3)> */ + /* 20 LogAnd <- <('-' 'a' 'n' 'd' req_ws Level3)> */ func() bool { - position69, tokenIndex69, depth69 := position, tokenIndex, depth + position72, tokenIndex72, depth72 := position, tokenIndex, depth { - position70 := position + position73 := position depth++ if buffer[position] != rune('-') { - goto l69 + goto l72 } position++ if buffer[position] != rune('a') { - goto l69 + goto l72 } position++ if buffer[position] != rune('n') { - goto l69 + goto l72 } position++ if buffer[position] != rune('d') { - goto l69 + goto l72 } position++ if !_rules[rulereq_ws]() { - goto l69 + goto l72 } if !_rules[ruleLevel3]() { - goto l69 + goto l72 } depth-- - add(ruleLogAnd, position70) + add(ruleLogAnd, position73) } return true - l69: - position, tokenIndex, depth = position69, tokenIndex69, depth69 + l72: + position, tokenIndex, depth = position72, tokenIndex72, depth72 return false }, - /* 20 Level3 <- <(Level2 (req_ws Comparison)*)> */ + /* 21 Level3 <- <(Level2 (req_ws Comparison)*)> */ func() bool { - position71, tokenIndex71, depth71 := position, tokenIndex, depth + position74, tokenIndex74, depth74 := position, tokenIndex, depth { - position72 := position + position75 := position depth++ if !_rules[ruleLevel2]() { - goto l71 + goto l74 } - l73: + l76: { - position74, tokenIndex74, depth74 := position, tokenIndex, depth + position77, tokenIndex77, depth77 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l74 + goto l77 } if !_rules[ruleComparison]() { - goto l74 + goto l77 } - goto l73 - l74: - position, tokenIndex, depth = position74, tokenIndex74, depth74 + goto l76 + l77: + position, tokenIndex, depth = position77, tokenIndex77, depth77 } depth-- - add(ruleLevel3, position72) + add(ruleLevel3, position75) } return true - l71: - position, tokenIndex, depth = position71, tokenIndex71, depth71 + l74: + position, tokenIndex, depth = position74, tokenIndex74, depth74 return false }, - /* 21 Comparison <- <(CompareOp req_ws Level2)> */ + /* 22 Comparison <- <(CompareOp req_ws Level2)> */ func() bool { - position75, tokenIndex75, depth75 := position, tokenIndex, depth + position78, tokenIndex78, depth78 := position, tokenIndex, depth { - position76 := position + position79 := position depth++ if !_rules[ruleCompareOp]() { - goto l75 + goto l78 } if !_rules[rulereq_ws]() { - goto l75 + goto l78 } if !_rules[ruleLevel2]() { - goto l75 + goto l78 } depth-- - add(ruleComparison, position76) + add(ruleComparison, position79) } return true - l75: - position, tokenIndex, depth = position75, tokenIndex75, depth75 + l78: + position, tokenIndex, depth = position78, tokenIndex78, depth78 return false }, - /* 22 CompareOp <- <(('=' '=') / ('!' '=') / ('<' '=') / ('>' '=') / '>' / '<' / '>')> */ + /* 23 CompareOp <- <(('=' '=') / ('!' '=') / ('<' '=') / ('>' '=') / '>' / '<' / '>')> */ func() bool { - position77, tokenIndex77, depth77 := position, tokenIndex, depth + position80, tokenIndex80, depth80 := position, tokenIndex, depth { - position78 := position + position81 := position depth++ { - position79, tokenIndex79, depth79 := position, tokenIndex, depth + position82, tokenIndex82, depth82 := position, tokenIndex, depth if buffer[position] != rune('=') { - goto l80 + goto l83 } position++ if buffer[position] != rune('=') { - goto l80 + goto l83 } position++ - goto l79 - l80: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l82 + l83: + position, tokenIndex, depth = position82, tokenIndex82, depth82 if buffer[position] != rune('!') { - goto l81 + goto l84 } position++ if buffer[position] != rune('=') { - goto l81 + goto l84 } position++ - goto l79 - l81: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l82 + l84: + position, tokenIndex, depth = position82, tokenIndex82, depth82 if buffer[position] != rune('<') { - goto l82 + goto l85 } position++ if buffer[position] != rune('=') { - goto l82 + goto l85 } position++ - goto l79 - l82: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l82 + l85: + position, tokenIndex, depth = position82, tokenIndex82, depth82 if buffer[position] != rune('>') { - goto l83 + goto l86 } position++ if buffer[position] != rune('=') { - goto l83 + goto l86 } position++ - goto l79 - l83: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l82 + l86: + position, tokenIndex, depth = position82, tokenIndex82, depth82 if buffer[position] != rune('>') { - goto l84 + goto l87 } position++ - goto l79 - l84: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l82 + l87: + position, tokenIndex, depth = position82, tokenIndex82, depth82 if buffer[position] != rune('<') { - goto l85 + goto l88 } position++ - goto l79 - l85: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l82 + l88: + position, tokenIndex, depth = position82, tokenIndex82, depth82 if buffer[position] != rune('>') { - goto l77 + goto l80 } position++ } - l79: + l82: depth-- - add(ruleCompareOp, position78) + add(ruleCompareOp, position81) } return true - l77: - position, tokenIndex, depth = position77, tokenIndex77, depth77 + l80: + position, tokenIndex, depth = position80, tokenIndex80, depth80 return false }, - /* 23 Level2 <- <(Level1 (req_ws (Addition / Subtraction))*)> */ + /* 24 Level2 <- <(Level1 (req_ws (Addition / Subtraction))*)> */ func() bool { - position86, tokenIndex86, depth86 := position, tokenIndex, depth + position89, tokenIndex89, depth89 := position, tokenIndex, depth { - position87 := position + position90 := position depth++ if !_rules[ruleLevel1]() { - goto l86 + goto l89 } - l88: + l91: { - position89, tokenIndex89, depth89 := position, tokenIndex, depth + position92, tokenIndex92, depth92 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l89 + goto l92 } { - position90, tokenIndex90, depth90 := position, tokenIndex, depth + position93, tokenIndex93, depth93 := position, tokenIndex, depth if !_rules[ruleAddition]() { - goto l91 + goto l94 } - goto l90 - l91: - position, tokenIndex, depth = position90, tokenIndex90, depth90 + goto l93 + l94: + position, tokenIndex, depth = position93, tokenIndex93, depth93 if !_rules[ruleSubtraction]() { - goto l89 + goto l92 } } - l90: - goto l88 - l89: - position, tokenIndex, depth = position89, tokenIndex89, depth89 + l93: + goto l91 + l92: + position, tokenIndex, depth = position92, tokenIndex92, depth92 } depth-- - add(ruleLevel2, position87) + add(ruleLevel2, position90) } return true - l86: - position, tokenIndex, depth = position86, tokenIndex86, depth86 + l89: + position, tokenIndex, depth = position89, tokenIndex89, depth89 return false }, - /* 24 Addition <- <('+' req_ws Level1)> */ + /* 25 Addition <- <('+' req_ws Level1)> */ func() bool { - position92, tokenIndex92, depth92 := position, tokenIndex, depth + position95, tokenIndex95, depth95 := position, tokenIndex, depth { - position93 := position + position96 := position depth++ if buffer[position] != rune('+') { - goto l92 + goto l95 } position++ if !_rules[rulereq_ws]() { - goto l92 + goto l95 } if !_rules[ruleLevel1]() { - goto l92 + goto l95 } depth-- - add(ruleAddition, position93) + add(ruleAddition, position96) } return true - l92: - position, tokenIndex, depth = position92, tokenIndex92, depth92 + l95: + position, tokenIndex, depth = position95, tokenIndex95, depth95 return false }, - /* 25 Subtraction <- <('-' req_ws Level1)> */ + /* 26 Subtraction <- <('-' req_ws Level1)> */ func() bool { - position94, tokenIndex94, depth94 := position, tokenIndex, depth + position97, tokenIndex97, depth97 := position, tokenIndex, depth { - position95 := position + position98 := position depth++ if buffer[position] != rune('-') { - goto l94 + goto l97 } position++ if !_rules[rulereq_ws]() { - goto l94 + goto l97 } if !_rules[ruleLevel1]() { - goto l94 + goto l97 } depth-- - add(ruleSubtraction, position95) + add(ruleSubtraction, position98) } return true - l94: - position, tokenIndex, depth = position94, tokenIndex94, depth94 + l97: + position, tokenIndex, depth = position97, tokenIndex97, depth97 return false }, - /* 26 Level1 <- <(Level0 (req_ws (Multiplication / Division / Modulo))*)> */ + /* 27 Level1 <- <(Level0 (req_ws (Multiplication / Division / Modulo))*)> */ func() bool { - position96, tokenIndex96, depth96 := position, tokenIndex, depth + position99, tokenIndex99, depth99 := position, tokenIndex, depth { - position97 := position + position100 := position depth++ if !_rules[ruleLevel0]() { - goto l96 + goto l99 } - l98: + l101: { - position99, tokenIndex99, depth99 := position, tokenIndex, depth + position102, tokenIndex102, depth102 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l99 + goto l102 } { - position100, tokenIndex100, depth100 := position, tokenIndex, depth + position103, tokenIndex103, depth103 := position, tokenIndex, depth if !_rules[ruleMultiplication]() { - goto l101 + goto l104 } - goto l100 - l101: - position, tokenIndex, depth = position100, tokenIndex100, depth100 + goto l103 + l104: + position, tokenIndex, depth = position103, tokenIndex103, depth103 if !_rules[ruleDivision]() { - goto l102 + goto l105 } - goto l100 - l102: - position, tokenIndex, depth = position100, tokenIndex100, depth100 + goto l103 + l105: + position, tokenIndex, depth = position103, tokenIndex103, depth103 if !_rules[ruleModulo]() { - goto l99 + goto l102 } } - l100: - goto l98 - l99: - position, tokenIndex, depth = position99, tokenIndex99, depth99 + l103: + goto l101 + l102: + position, tokenIndex, depth = position102, tokenIndex102, depth102 } depth-- - add(ruleLevel1, position97) + add(ruleLevel1, position100) } return true - l96: - position, tokenIndex, depth = position96, tokenIndex96, depth96 + l99: + position, tokenIndex, depth = position99, tokenIndex99, depth99 return false }, - /* 27 Multiplication <- <('*' req_ws Level0)> */ + /* 28 Multiplication <- <('*' req_ws Level0)> */ func() bool { - position103, tokenIndex103, depth103 := position, tokenIndex, depth + position106, tokenIndex106, depth106 := position, tokenIndex, depth { - position104 := position + position107 := position depth++ if buffer[position] != rune('*') { - goto l103 + goto l106 } position++ if !_rules[rulereq_ws]() { - goto l103 + goto l106 } if !_rules[ruleLevel0]() { - goto l103 + goto l106 } depth-- - add(ruleMultiplication, position104) + add(ruleMultiplication, position107) } return true - l103: - position, tokenIndex, depth = position103, tokenIndex103, depth103 + l106: + position, tokenIndex, depth = position106, tokenIndex106, depth106 return false }, - /* 28 Division <- <('/' req_ws Level0)> */ + /* 29 Division <- <('/' req_ws Level0)> */ func() bool { - position105, tokenIndex105, depth105 := position, tokenIndex, depth + position108, tokenIndex108, depth108 := position, tokenIndex, depth { - position106 := position + position109 := position depth++ if buffer[position] != rune('/') { - goto l105 + goto l108 } position++ if !_rules[rulereq_ws]() { - goto l105 + goto l108 } if !_rules[ruleLevel0]() { - goto l105 + goto l108 } depth-- - add(ruleDivision, position106) + add(ruleDivision, position109) } return true - l105: - position, tokenIndex, depth = position105, tokenIndex105, depth105 + l108: + position, tokenIndex, depth = position108, tokenIndex108, depth108 return false }, - /* 29 Modulo <- <('%' req_ws Level0)> */ + /* 30 Modulo <- <('%' req_ws Level0)> */ func() bool { - position107, tokenIndex107, depth107 := position, tokenIndex, depth + position110, tokenIndex110, depth110 := position, tokenIndex, depth { - position108 := position + position111 := position depth++ if buffer[position] != rune('%') { - goto l107 + goto l110 } position++ if !_rules[rulereq_ws]() { - goto l107 + goto l110 } if !_rules[ruleLevel0]() { - goto l107 + goto l110 } depth-- - add(ruleModulo, position108) + add(ruleModulo, position111) } return true - l107: - position, tokenIndex, depth = position107, tokenIndex107, depth107 + l110: + position, tokenIndex, depth = position110, tokenIndex110, depth110 return false }, - /* 30 Level0 <- <(IP / String / Number / Boolean / Undefined / Nil / Symbol / Not / Substitution / Merge / Auto / Lambda / Chained)> */ + /* 31 Level0 <- <(IP / String / Number / Boolean / Undefined / Nil / Symbol / Not / Substitution / Merge / Auto / Lambda / Chained)> */ func() bool { - position109, tokenIndex109, depth109 := position, tokenIndex, depth + position112, tokenIndex112, depth112 := position, tokenIndex, depth { - position110 := position + position113 := position depth++ { - position111, tokenIndex111, depth111 := position, tokenIndex, depth + position114, tokenIndex114, depth114 := position, tokenIndex, depth if !_rules[ruleIP]() { - goto l112 - } - goto l111 - l112: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleString]() { - goto l113 - } - goto l111 - l113: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleNumber]() { - goto l114 - } - goto l111 - l114: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleBoolean]() { goto l115 } - goto l111 + goto l114 l115: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleUndefined]() { + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleString]() { goto l116 } - goto l111 + goto l114 l116: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleNil]() { + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleNumber]() { goto l117 } - goto l111 + goto l114 l117: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleSymbol]() { + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleBoolean]() { goto l118 } - goto l111 + goto l114 l118: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleNot]() { + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleUndefined]() { goto l119 } - goto l111 + goto l114 l119: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleSubstitution]() { + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleNil]() { goto l120 } - goto l111 + goto l114 l120: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleMerge]() { + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleSymbol]() { goto l121 } - goto l111 + goto l114 l121: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleAuto]() { + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleNot]() { goto l122 } - goto l111 + goto l114 l122: - position, tokenIndex, depth = position111, tokenIndex111, depth111 - if !_rules[ruleLambda]() { + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleSubstitution]() { goto l123 } - goto l111 + goto l114 l123: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleMerge]() { + goto l124 + } + goto l114 + l124: + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleAuto]() { + goto l125 + } + goto l114 + l125: + position, tokenIndex, depth = position114, tokenIndex114, depth114 + if !_rules[ruleLambda]() { + goto l126 + } + goto l114 + l126: + position, tokenIndex, depth = position114, tokenIndex114, depth114 if !_rules[ruleChained]() { - goto l109 + goto l112 } } - l111: + l114: depth-- - add(ruleLevel0, position110) + add(ruleLevel0, position113) } return true - l109: - position, tokenIndex, depth = position109, tokenIndex109, depth109 + l112: + position, tokenIndex, depth = position112, tokenIndex112, depth112 return false }, - /* 31 Chained <- <((MapMapping / Sync / Catch / Mapping / MapSelection / Selection / Sum / List / Map / Range / Grouped / Reference) ChainedQualifiedExpression*)> */ + /* 32 Chained <- <((MapMapping / Sync / Catch / Mapping / MapSelection / Selection / Sum / List / Map / Range / Grouped / Reference) ChainedQualifiedExpression*)> */ func() bool { - position124, tokenIndex124, depth124 := position, tokenIndex, depth + position127, tokenIndex127, depth127 := position, tokenIndex, depth { - position125 := position + position128 := position depth++ { - position126, tokenIndex126, depth126 := position, tokenIndex, depth + position129, tokenIndex129, depth129 := position, tokenIndex, depth if !_rules[ruleMapMapping]() { - goto l127 - } - goto l126 - l127: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleSync]() { - goto l128 - } - goto l126 - l128: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleCatch]() { - goto l129 - } - goto l126 - l129: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleMapping]() { goto l130 } - goto l126 + goto l129 l130: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleMapSelection]() { + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleSync]() { goto l131 } - goto l126 + goto l129 l131: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleSelection]() { + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleCatch]() { goto l132 } - goto l126 + goto l129 l132: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleSum]() { + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleMapping]() { goto l133 } - goto l126 + goto l129 l133: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleList]() { + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleMapSelection]() { goto l134 } - goto l126 + goto l129 l134: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleMap]() { + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleSelection]() { goto l135 } - goto l126 + goto l129 l135: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleRange]() { + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleSum]() { goto l136 } - goto l126 + goto l129 l136: - position, tokenIndex, depth = position126, tokenIndex126, depth126 - if !_rules[ruleGrouped]() { + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleList]() { goto l137 } - goto l126 + goto l129 l137: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleMap]() { + goto l138 + } + goto l129 + l138: + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleRange]() { + goto l139 + } + goto l129 + l139: + position, tokenIndex, depth = position129, tokenIndex129, depth129 + if !_rules[ruleGrouped]() { + goto l140 + } + goto l129 + l140: + position, tokenIndex, depth = position129, tokenIndex129, depth129 if !_rules[ruleReference]() { - goto l124 + goto l127 } } - l126: - l138: + l129: + l141: { - position139, tokenIndex139, depth139 := position, tokenIndex, depth + position142, tokenIndex142, depth142 := position, tokenIndex, depth if !_rules[ruleChainedQualifiedExpression]() { - goto l139 + goto l142 } - goto l138 - l139: - position, tokenIndex, depth = position139, tokenIndex139, depth139 + goto l141 + l142: + position, tokenIndex, depth = position142, tokenIndex142, depth142 } depth-- - add(ruleChained, position125) + add(ruleChained, position128) } return true - l124: - position, tokenIndex, depth = position124, tokenIndex124, depth124 + l127: + position, tokenIndex, depth = position127, tokenIndex127, depth127 return false }, - /* 32 ChainedQualifiedExpression <- <(ChainedCall / Currying / ChainedRef / ChainedDynRef / Projection)> */ + /* 33 ChainedQualifiedExpression <- <(ChainedCall / Currying / ChainedRef / ChainedDynRef / Projection)> */ func() bool { - position140, tokenIndex140, depth140 := position, tokenIndex, depth + position143, tokenIndex143, depth143 := position, tokenIndex, depth { - position141 := position + position144 := position depth++ { - position142, tokenIndex142, depth142 := position, tokenIndex, depth + position145, tokenIndex145, depth145 := position, tokenIndex, depth if !_rules[ruleChainedCall]() { - goto l143 + goto l146 } - goto l142 - l143: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l145 + l146: + position, tokenIndex, depth = position145, tokenIndex145, depth145 if !_rules[ruleCurrying]() { - goto l144 + goto l147 } - goto l142 - l144: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l145 + l147: + position, tokenIndex, depth = position145, tokenIndex145, depth145 if !_rules[ruleChainedRef]() { - goto l145 + goto l148 } - goto l142 - l145: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l145 + l148: + position, tokenIndex, depth = position145, tokenIndex145, depth145 if !_rules[ruleChainedDynRef]() { - goto l146 + goto l149 } - goto l142 - l146: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l145 + l149: + position, tokenIndex, depth = position145, tokenIndex145, depth145 if !_rules[ruleProjection]() { - goto l140 + goto l143 } } - l142: + l145: depth-- - add(ruleChainedQualifiedExpression, position141) + add(ruleChainedQualifiedExpression, position144) } return true - l140: - position, tokenIndex, depth = position140, tokenIndex140, depth140 + l143: + position, tokenIndex, depth = position143, tokenIndex143, depth143 return false }, - /* 33 ChainedRef <- <(PathComponent FollowUpRef)> */ + /* 34 ChainedRef <- <(PathComponent FollowUpRef)> */ func() bool { - position147, tokenIndex147, depth147 := position, tokenIndex, depth + position150, tokenIndex150, depth150 := position, tokenIndex, depth { - position148 := position + position151 := position depth++ if !_rules[rulePathComponent]() { - goto l147 + goto l150 } if !_rules[ruleFollowUpRef]() { - goto l147 + goto l150 } depth-- - add(ruleChainedRef, position148) + add(ruleChainedRef, position151) } return true - l147: - position, tokenIndex, depth = position147, tokenIndex147, depth147 + l150: + position, tokenIndex, depth = position150, tokenIndex150, depth150 return false }, - /* 34 ChainedDynRef <- <('.'? '[' Expression ']')> */ + /* 35 ChainedDynRef <- <('.'? '[' Expression ']')> */ func() bool { - position149, tokenIndex149, depth149 := position, tokenIndex, depth + position152, tokenIndex152, depth152 := position, tokenIndex, depth { - position150 := position + position153 := position depth++ { - position151, tokenIndex151, depth151 := position, tokenIndex, depth + position154, tokenIndex154, depth154 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l151 + goto l154 } position++ - goto l152 - l151: - position, tokenIndex, depth = position151, tokenIndex151, depth151 + goto l155 + l154: + position, tokenIndex, depth = position154, tokenIndex154, depth154 } - l152: + l155: if buffer[position] != rune('[') { - goto l149 + goto l152 } position++ if !_rules[ruleExpression]() { - goto l149 + goto l152 } if buffer[position] != rune(']') { - goto l149 + goto l152 } position++ depth-- - add(ruleChainedDynRef, position150) + add(ruleChainedDynRef, position153) } return true - l149: - position, tokenIndex, depth = position149, tokenIndex149, depth149 + l152: + position, tokenIndex, depth = position152, tokenIndex152, depth152 return false }, - /* 35 Slice <- */ + /* 36 Slice <- */ func() bool { - position153, tokenIndex153, depth153 := position, tokenIndex, depth + position156, tokenIndex156, depth156 := position, tokenIndex, depth { - position154 := position + position157 := position depth++ if !_rules[ruleRange]() { - goto l153 + goto l156 } depth-- - add(ruleSlice, position154) + add(ruleSlice, position157) } return true - l153: - position, tokenIndex, depth = position153, tokenIndex153, depth153 + l156: + position, tokenIndex, depth = position156, tokenIndex156, depth156 return false }, - /* 36 Currying <- <('*' ChainedCall)> */ + /* 37 Currying <- <('*' ChainedCall)> */ func() bool { - position155, tokenIndex155, depth155 := position, tokenIndex, depth + position158, tokenIndex158, depth158 := position, tokenIndex, depth { - position156 := position + position159 := position depth++ if buffer[position] != rune('*') { - goto l155 + goto l158 } position++ if !_rules[ruleChainedCall]() { - goto l155 + goto l158 } depth-- - add(ruleCurrying, position156) + add(ruleCurrying, position159) } return true - l155: - position, tokenIndex, depth = position155, tokenIndex155, depth155 + l158: + position, tokenIndex, depth = position158, tokenIndex158, depth158 return false }, - /* 37 ChainedCall <- <(StartArguments NameArgumentList? ')')> */ + /* 38 ChainedCall <- <(StartArguments NameArgumentList? ')')> */ func() bool { - position157, tokenIndex157, depth157 := position, tokenIndex, depth + position160, tokenIndex160, depth160 := position, tokenIndex, depth { - position158 := position + position161 := position depth++ if !_rules[ruleStartArguments]() { - goto l157 + goto l160 } { - position159, tokenIndex159, depth159 := position, tokenIndex, depth + position162, tokenIndex162, depth162 := position, tokenIndex, depth if !_rules[ruleNameArgumentList]() { - goto l159 + goto l162 } - goto l160 - l159: - position, tokenIndex, depth = position159, tokenIndex159, depth159 + goto l163 + l162: + position, tokenIndex, depth = position162, tokenIndex162, depth162 } - l160: + l163: if buffer[position] != rune(')') { - goto l157 + goto l160 } position++ depth-- - add(ruleChainedCall, position158) + add(ruleChainedCall, position161) } return true - l157: - position, tokenIndex, depth = position157, tokenIndex157, depth157 + l160: + position, tokenIndex, depth = position160, tokenIndex160, depth160 return false }, - /* 38 StartArguments <- <('(' ws)> */ + /* 39 StartArguments <- <('(' ws)> */ func() bool { - position161, tokenIndex161, depth161 := position, tokenIndex, depth + position164, tokenIndex164, depth164 := position, tokenIndex, depth { - position162 := position + position165 := position depth++ if buffer[position] != rune('(') { - goto l161 + goto l164 } position++ if !_rules[rulews]() { - goto l161 + goto l164 } depth-- - add(ruleStartArguments, position162) + add(ruleStartArguments, position165) } return true - l161: - position, tokenIndex, depth = position161, tokenIndex161, depth161 + l164: + position, tokenIndex, depth = position164, tokenIndex164, depth164 return false }, - /* 39 NameArgumentList <- <(((NextNameArgument (',' NextNameArgument)*) / NextExpression) (',' NextExpression)*)> */ + /* 40 NameArgumentList <- <(((NextNameArgument (',' NextNameArgument)*) / NextExpression) (',' NextExpression)*)> */ func() bool { - position163, tokenIndex163, depth163 := position, tokenIndex, depth + position166, tokenIndex166, depth166 := position, tokenIndex, depth { - position164 := position + position167 := position depth++ { - position165, tokenIndex165, depth165 := position, tokenIndex, depth + position168, tokenIndex168, depth168 := position, tokenIndex, depth if !_rules[ruleNextNameArgument]() { - goto l166 + goto l169 } - l167: + l170: { - position168, tokenIndex168, depth168 := position, tokenIndex, depth + position171, tokenIndex171, depth171 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l168 + goto l171 } position++ if !_rules[ruleNextNameArgument]() { - goto l168 + goto l171 } - goto l167 - l168: - position, tokenIndex, depth = position168, tokenIndex168, depth168 + goto l170 + l171: + position, tokenIndex, depth = position171, tokenIndex171, depth171 } - goto l165 - l166: - position, tokenIndex, depth = position165, tokenIndex165, depth165 + goto l168 + l169: + position, tokenIndex, depth = position168, tokenIndex168, depth168 if !_rules[ruleNextExpression]() { - goto l163 + goto l166 } } - l165: - l169: + l168: + l172: { - position170, tokenIndex170, depth170 := position, tokenIndex, depth + position173, tokenIndex173, depth173 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l170 + goto l173 } position++ if !_rules[ruleNextExpression]() { - goto l170 + goto l173 } - goto l169 - l170: - position, tokenIndex, depth = position170, tokenIndex170, depth170 + goto l172 + l173: + position, tokenIndex, depth = position173, tokenIndex173, depth173 } depth-- - add(ruleNameArgumentList, position164) + add(ruleNameArgumentList, position167) } return true - l163: - position, tokenIndex, depth = position163, tokenIndex163, depth163 + l166: + position, tokenIndex, depth = position166, tokenIndex166, depth166 return false }, - /* 40 NextNameArgument <- <(ws Name ws '=' ws Expression ws)> */ + /* 41 NextNameArgument <- <(ws Name ws '=' ws Expression ws)> */ func() bool { - position171, tokenIndex171, depth171 := position, tokenIndex, depth + position174, tokenIndex174, depth174 := position, tokenIndex, depth { - position172 := position + position175 := position depth++ if !_rules[rulews]() { - goto l171 + goto l174 } if !_rules[ruleName]() { - goto l171 + goto l174 } if !_rules[rulews]() { - goto l171 + goto l174 } if buffer[position] != rune('=') { - goto l171 + goto l174 } position++ if !_rules[rulews]() { - goto l171 + goto l174 } if !_rules[ruleExpression]() { - goto l171 + goto l174 } if !_rules[rulews]() { - goto l171 + goto l174 } depth-- - add(ruleNextNameArgument, position172) + add(ruleNextNameArgument, position175) } return true - l171: - position, tokenIndex, depth = position171, tokenIndex171, depth171 + l174: + position, tokenIndex, depth = position174, tokenIndex174, depth174 return false }, - /* 41 ExpressionList <- <(NextExpression (',' NextExpression)*)> */ + /* 42 ExpressionList <- <(NextExpression (',' NextExpression)*)> */ func() bool { - position173, tokenIndex173, depth173 := position, tokenIndex, depth + position176, tokenIndex176, depth176 := position, tokenIndex, depth { - position174 := position + position177 := position depth++ if !_rules[ruleNextExpression]() { - goto l173 + goto l176 } - l175: + l178: { - position176, tokenIndex176, depth176 := position, tokenIndex, depth + position179, tokenIndex179, depth179 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l176 + goto l179 } position++ if !_rules[ruleNextExpression]() { - goto l176 + goto l179 } - goto l175 - l176: - position, tokenIndex, depth = position176, tokenIndex176, depth176 + goto l178 + l179: + position, tokenIndex, depth = position179, tokenIndex179, depth179 } depth-- - add(ruleExpressionList, position174) + add(ruleExpressionList, position177) } return true - l173: - position, tokenIndex, depth = position173, tokenIndex173, depth173 + l176: + position, tokenIndex, depth = position176, tokenIndex176, depth176 return false }, - /* 42 NextExpression <- <(Expression ListExpansion?)> */ + /* 43 NextExpression <- <(Expression ListExpansion?)> */ func() bool { - position177, tokenIndex177, depth177 := position, tokenIndex, depth + position180, tokenIndex180, depth180 := position, tokenIndex, depth { - position178 := position + position181 := position depth++ if !_rules[ruleExpression]() { - goto l177 + goto l180 } { - position179, tokenIndex179, depth179 := position, tokenIndex, depth + position182, tokenIndex182, depth182 := position, tokenIndex, depth if !_rules[ruleListExpansion]() { - goto l179 + goto l182 } - goto l180 - l179: - position, tokenIndex, depth = position179, tokenIndex179, depth179 + goto l183 + l182: + position, tokenIndex, depth = position182, tokenIndex182, depth182 } - l180: + l183: depth-- - add(ruleNextExpression, position178) + add(ruleNextExpression, position181) } return true - l177: - position, tokenIndex, depth = position177, tokenIndex177, depth177 + l180: + position, tokenIndex, depth = position180, tokenIndex180, depth180 return false }, - /* 43 ListExpansion <- <('.' '.' '.' ws)> */ + /* 44 ListExpansion <- <('.' '.' '.' ws)> */ func() bool { - position181, tokenIndex181, depth181 := position, tokenIndex, depth + position184, tokenIndex184, depth184 := position, tokenIndex, depth { - position182 := position + position185 := position depth++ if buffer[position] != rune('.') { - goto l181 + goto l184 } position++ if buffer[position] != rune('.') { - goto l181 + goto l184 } position++ if buffer[position] != rune('.') { - goto l181 + goto l184 } position++ if !_rules[rulews]() { - goto l181 + goto l184 } depth-- - add(ruleListExpansion, position182) + add(ruleListExpansion, position185) } return true - l181: - position, tokenIndex, depth = position181, tokenIndex181, depth181 + l184: + position, tokenIndex, depth = position184, tokenIndex184, depth184 return false }, - /* 44 Projection <- <('.'? (('[' '*' ']') / Slice) ProjectionValue ChainedQualifiedExpression*)> */ + /* 45 Projection <- <('.'? (('[' '*' ']') / Slice) ProjectionValue ChainedQualifiedExpression*)> */ func() bool { - position183, tokenIndex183, depth183 := position, tokenIndex, depth + position186, tokenIndex186, depth186 := position, tokenIndex, depth { - position184 := position + position187 := position depth++ { - position185, tokenIndex185, depth185 := position, tokenIndex, depth + position188, tokenIndex188, depth188 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l185 + goto l188 } position++ - goto l186 - l185: - position, tokenIndex, depth = position185, tokenIndex185, depth185 + goto l189 + l188: + position, tokenIndex, depth = position188, tokenIndex188, depth188 } - l186: + l189: { - position187, tokenIndex187, depth187 := position, tokenIndex, depth + position190, tokenIndex190, depth190 := position, tokenIndex, depth if buffer[position] != rune('[') { - goto l188 + goto l191 } position++ if buffer[position] != rune('*') { - goto l188 + goto l191 } position++ if buffer[position] != rune(']') { - goto l188 + goto l191 } position++ - goto l187 - l188: - position, tokenIndex, depth = position187, tokenIndex187, depth187 + goto l190 + l191: + position, tokenIndex, depth = position190, tokenIndex190, depth190 if !_rules[ruleSlice]() { - goto l183 + goto l186 } } - l187: + l190: if !_rules[ruleProjectionValue]() { - goto l183 + goto l186 } - l189: + l192: { - position190, tokenIndex190, depth190 := position, tokenIndex, depth + position193, tokenIndex193, depth193 := position, tokenIndex, depth if !_rules[ruleChainedQualifiedExpression]() { - goto l190 + goto l193 } - goto l189 - l190: - position, tokenIndex, depth = position190, tokenIndex190, depth190 + goto l192 + l193: + position, tokenIndex, depth = position193, tokenIndex193, depth193 } depth-- - add(ruleProjection, position184) + add(ruleProjection, position187) } return true - l183: - position, tokenIndex, depth = position183, tokenIndex183, depth183 + l186: + position, tokenIndex, depth = position186, tokenIndex186, depth186 return false }, - /* 45 ProjectionValue <- */ + /* 46 ProjectionValue <- */ func() bool { - position191, tokenIndex191, depth191 := position, tokenIndex, depth + position194, tokenIndex194, depth194 := position, tokenIndex, depth { - position192 := position + position195 := position depth++ if !_rules[ruleAction0]() { - goto l191 + goto l194 } depth-- - add(ruleProjectionValue, position192) + add(ruleProjectionValue, position195) } return true - l191: - position, tokenIndex, depth = position191, tokenIndex191, depth191 + l194: + position, tokenIndex, depth = position194, tokenIndex194, depth194 return false }, - /* 46 Substitution <- <('*' Level0)> */ + /* 47 Substitution <- <('*' Level0)> */ func() bool { - position193, tokenIndex193, depth193 := position, tokenIndex, depth + position196, tokenIndex196, depth196 := position, tokenIndex, depth { - position194 := position + position197 := position depth++ if buffer[position] != rune('*') { - goto l193 + goto l196 } position++ if !_rules[ruleLevel0]() { - goto l193 + goto l196 } depth-- - add(ruleSubstitution, position194) + add(ruleSubstitution, position197) } return true - l193: - position, tokenIndex, depth = position193, tokenIndex193, depth193 + l196: + position, tokenIndex, depth = position196, tokenIndex196, depth196 return false }, - /* 47 Not <- <('!' ws Level0)> */ + /* 48 Not <- <('!' ws Level0)> */ func() bool { - position195, tokenIndex195, depth195 := position, tokenIndex, depth + position198, tokenIndex198, depth198 := position, tokenIndex, depth { - position196 := position + position199 := position depth++ if buffer[position] != rune('!') { - goto l195 + goto l198 } position++ if !_rules[rulews]() { - goto l195 + goto l198 } if !_rules[ruleLevel0]() { - goto l195 + goto l198 } depth-- - add(ruleNot, position196) + add(ruleNot, position199) } return true - l195: - position, tokenIndex, depth = position195, tokenIndex195, depth195 + l198: + position, tokenIndex, depth = position198, tokenIndex198, depth198 return false }, - /* 48 Grouped <- <('(' Expression ')')> */ + /* 49 Grouped <- <('(' Expression ')')> */ func() bool { - position197, tokenIndex197, depth197 := position, tokenIndex, depth + position200, tokenIndex200, depth200 := position, tokenIndex, depth { - position198 := position + position201 := position depth++ if buffer[position] != rune('(') { - goto l197 + goto l200 } position++ if !_rules[ruleExpression]() { - goto l197 + goto l200 } if buffer[position] != rune(')') { - goto l197 + goto l200 } position++ depth-- - add(ruleGrouped, position198) + add(ruleGrouped, position201) } return true - l197: - position, tokenIndex, depth = position197, tokenIndex197, depth197 + l200: + position, tokenIndex, depth = position200, tokenIndex200, depth200 return false }, - /* 49 Range <- <(StartRange Expression? RangeOp Expression? ']')> */ + /* 50 Range <- <(StartRange Expression? RangeOp Expression? ']')> */ func() bool { - position199, tokenIndex199, depth199 := position, tokenIndex, depth + position202, tokenIndex202, depth202 := position, tokenIndex, depth { - position200 := position + position203 := position depth++ if !_rules[ruleStartRange]() { - goto l199 + goto l202 } { - position201, tokenIndex201, depth201 := position, tokenIndex, depth + position204, tokenIndex204, depth204 := position, tokenIndex, depth if !_rules[ruleExpression]() { - goto l201 + goto l204 } - goto l202 - l201: - position, tokenIndex, depth = position201, tokenIndex201, depth201 + goto l205 + l204: + position, tokenIndex, depth = position204, tokenIndex204, depth204 } - l202: + l205: if !_rules[ruleRangeOp]() { - goto l199 + goto l202 } { - position203, tokenIndex203, depth203 := position, tokenIndex, depth + position206, tokenIndex206, depth206 := position, tokenIndex, depth if !_rules[ruleExpression]() { - goto l203 + goto l206 } - goto l204 - l203: - position, tokenIndex, depth = position203, tokenIndex203, depth203 + goto l207 + l206: + position, tokenIndex, depth = position206, tokenIndex206, depth206 } - l204: + l207: if buffer[position] != rune(']') { - goto l199 + goto l202 } position++ depth-- - add(ruleRange, position200) + add(ruleRange, position203) } return true - l199: - position, tokenIndex, depth = position199, tokenIndex199, depth199 + l202: + position, tokenIndex, depth = position202, tokenIndex202, depth202 return false }, - /* 50 StartRange <- <'['> */ + /* 51 StartRange <- <'['> */ func() bool { - position205, tokenIndex205, depth205 := position, tokenIndex, depth + position208, tokenIndex208, depth208 := position, tokenIndex, depth { - position206 := position + position209 := position depth++ if buffer[position] != rune('[') { - goto l205 + goto l208 } position++ depth-- - add(ruleStartRange, position206) + add(ruleStartRange, position209) } return true - l205: - position, tokenIndex, depth = position205, tokenIndex205, depth205 + l208: + position, tokenIndex, depth = position208, tokenIndex208, depth208 return false }, - /* 51 RangeOp <- <('.' '.')> */ + /* 52 RangeOp <- <('.' '.')> */ func() bool { - position207, tokenIndex207, depth207 := position, tokenIndex, depth + position210, tokenIndex210, depth210 := position, tokenIndex, depth { - position208 := position + position211 := position depth++ if buffer[position] != rune('.') { - goto l207 + goto l210 } position++ if buffer[position] != rune('.') { - goto l207 + goto l210 } position++ depth-- - add(ruleRangeOp, position208) + add(ruleRangeOp, position211) } return true - l207: - position, tokenIndex, depth = position207, tokenIndex207, depth207 + l210: + position, tokenIndex, depth = position210, tokenIndex210, depth210 return false }, - /* 52 Number <- <('-'? [0-9] ([0-9] / '_')* ('.' [0-9] [0-9]*)? (('e' / 'E') '-'? [0-9] [0-9]*)?)> */ + /* 53 Number <- <('-'? [0-9] ([0-9] / '_')* ('.' [0-9] [0-9]*)? (('e' / 'E') '-'? [0-9] [0-9]*)?)> */ func() bool { - position209, tokenIndex209, depth209 := position, tokenIndex, depth + position212, tokenIndex212, depth212 := position, tokenIndex, depth { - position210 := position + position213 := position depth++ { - position211, tokenIndex211, depth211 := position, tokenIndex, depth + position214, tokenIndex214, depth214 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l211 + goto l214 } position++ - goto l212 - l211: - position, tokenIndex, depth = position211, tokenIndex211, depth211 + goto l215 + l214: + position, tokenIndex, depth = position214, tokenIndex214, depth214 } - l212: + l215: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l209 + goto l212 } position++ - l213: + l216: { - position214, tokenIndex214, depth214 := position, tokenIndex, depth + position217, tokenIndex217, depth217 := position, tokenIndex, depth { - position215, tokenIndex215, depth215 := position, tokenIndex, depth + position218, tokenIndex218, depth218 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l216 + goto l219 } position++ - goto l215 - l216: - position, tokenIndex, depth = position215, tokenIndex215, depth215 + goto l218 + l219: + position, tokenIndex, depth = position218, tokenIndex218, depth218 if buffer[position] != rune('_') { - goto l214 + goto l217 } position++ } - l215: - goto l213 - l214: - position, tokenIndex, depth = position214, tokenIndex214, depth214 + l218: + goto l216 + l217: + position, tokenIndex, depth = position217, tokenIndex217, depth217 } { - position217, tokenIndex217, depth217 := position, tokenIndex, depth + position220, tokenIndex220, depth220 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l217 + goto l220 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l217 + goto l220 } position++ - l219: + l222: { - position220, tokenIndex220, depth220 := position, tokenIndex, depth + position223, tokenIndex223, depth223 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l220 + goto l223 } position++ - goto l219 - l220: - position, tokenIndex, depth = position220, tokenIndex220, depth220 + goto l222 + l223: + position, tokenIndex, depth = position223, tokenIndex223, depth223 } - goto l218 - l217: - position, tokenIndex, depth = position217, tokenIndex217, depth217 + goto l221 + l220: + position, tokenIndex, depth = position220, tokenIndex220, depth220 } - l218: + l221: { - position221, tokenIndex221, depth221 := position, tokenIndex, depth + position224, tokenIndex224, depth224 := position, tokenIndex, depth { - position223, tokenIndex223, depth223 := position, tokenIndex, depth + position226, tokenIndex226, depth226 := position, tokenIndex, depth if buffer[position] != rune('e') { - goto l224 + goto l227 } position++ - goto l223 - l224: - position, tokenIndex, depth = position223, tokenIndex223, depth223 + goto l226 + l227: + position, tokenIndex, depth = position226, tokenIndex226, depth226 if buffer[position] != rune('E') { - goto l221 + goto l224 } position++ } - l223: + l226: { - position225, tokenIndex225, depth225 := position, tokenIndex, depth + position228, tokenIndex228, depth228 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l225 + goto l228 } position++ - goto l226 - l225: - position, tokenIndex, depth = position225, tokenIndex225, depth225 + goto l229 + l228: + position, tokenIndex, depth = position228, tokenIndex228, depth228 } - l226: + l229: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l221 + goto l224 } position++ - l227: + l230: { - position228, tokenIndex228, depth228 := position, tokenIndex, depth + position231, tokenIndex231, depth231 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l228 + goto l231 } position++ - goto l227 - l228: - position, tokenIndex, depth = position228, tokenIndex228, depth228 + goto l230 + l231: + position, tokenIndex, depth = position231, tokenIndex231, depth231 } - goto l222 - l221: - position, tokenIndex, depth = position221, tokenIndex221, depth221 + goto l225 + l224: + position, tokenIndex, depth = position224, tokenIndex224, depth224 } - l222: + l225: depth-- - add(ruleNumber, position210) + add(ruleNumber, position213) } return true - l209: - position, tokenIndex, depth = position209, tokenIndex209, depth209 + l212: + position, tokenIndex, depth = position212, tokenIndex212, depth212 return false }, - /* 53 String <- <('"' (('\\' '"') / (!'"' .))* '"')> */ + /* 54 String <- <('"' (('\\' '"') / (!'"' .))* '"')> */ func() bool { - position229, tokenIndex229, depth229 := position, tokenIndex, depth + position232, tokenIndex232, depth232 := position, tokenIndex, depth { - position230 := position + position233 := position depth++ if buffer[position] != rune('"') { - goto l229 + goto l232 } position++ - l231: + l234: { - position232, tokenIndex232, depth232 := position, tokenIndex, depth + position235, tokenIndex235, depth235 := position, tokenIndex, depth { - position233, tokenIndex233, depth233 := position, tokenIndex, depth + position236, tokenIndex236, depth236 := position, tokenIndex, depth if buffer[position] != rune('\\') { - goto l234 + goto l237 } position++ if buffer[position] != rune('"') { - goto l234 + goto l237 } position++ - goto l233 - l234: - position, tokenIndex, depth = position233, tokenIndex233, depth233 + goto l236 + l237: + position, tokenIndex, depth = position236, tokenIndex236, depth236 { - position235, tokenIndex235, depth235 := position, tokenIndex, depth + position238, tokenIndex238, depth238 := position, tokenIndex, depth if buffer[position] != rune('"') { - goto l235 + goto l238 } position++ - goto l232 - l235: - position, tokenIndex, depth = position235, tokenIndex235, depth235 + goto l235 + l238: + position, tokenIndex, depth = position238, tokenIndex238, depth238 } if !matchDot() { - goto l232 + goto l235 } } - l233: - goto l231 - l232: - position, tokenIndex, depth = position232, tokenIndex232, depth232 + l236: + goto l234 + l235: + position, tokenIndex, depth = position235, tokenIndex235, depth235 } if buffer[position] != rune('"') { - goto l229 + goto l232 } position++ depth-- - add(ruleString, position230) + add(ruleString, position233) } return true - l229: - position, tokenIndex, depth = position229, tokenIndex229, depth229 + l232: + position, tokenIndex, depth = position232, tokenIndex232, depth232 return false }, - /* 54 Boolean <- <(('t' 'r' 'u' 'e') / ('f' 'a' 'l' 's' 'e'))> */ + /* 55 Boolean <- <(('t' 'r' 'u' 'e') / ('f' 'a' 'l' 's' 'e'))> */ func() bool { - position236, tokenIndex236, depth236 := position, tokenIndex, depth + position239, tokenIndex239, depth239 := position, tokenIndex, depth { - position237 := position + position240 := position depth++ { - position238, tokenIndex238, depth238 := position, tokenIndex, depth + position241, tokenIndex241, depth241 := position, tokenIndex, depth if buffer[position] != rune('t') { - goto l239 + goto l242 } position++ if buffer[position] != rune('r') { - goto l239 + goto l242 } position++ if buffer[position] != rune('u') { - goto l239 + goto l242 } position++ if buffer[position] != rune('e') { - goto l239 + goto l242 } position++ - goto l238 - l239: - position, tokenIndex, depth = position238, tokenIndex238, depth238 + goto l241 + l242: + position, tokenIndex, depth = position241, tokenIndex241, depth241 if buffer[position] != rune('f') { - goto l236 + goto l239 } position++ if buffer[position] != rune('a') { - goto l236 + goto l239 } position++ if buffer[position] != rune('l') { - goto l236 + goto l239 } position++ if buffer[position] != rune('s') { - goto l236 + goto l239 } position++ if buffer[position] != rune('e') { - goto l236 + goto l239 } position++ } - l238: + l241: depth-- - add(ruleBoolean, position237) + add(ruleBoolean, position240) } return true - l236: - position, tokenIndex, depth = position236, tokenIndex236, depth236 + l239: + position, tokenIndex, depth = position239, tokenIndex239, depth239 return false }, - /* 55 Nil <- <(('n' 'i' 'l') / '~')> */ + /* 56 Nil <- <(('n' 'i' 'l') / '~')> */ func() bool { - position240, tokenIndex240, depth240 := position, tokenIndex, depth + position243, tokenIndex243, depth243 := position, tokenIndex, depth { - position241 := position + position244 := position depth++ { - position242, tokenIndex242, depth242 := position, tokenIndex, depth + position245, tokenIndex245, depth245 := position, tokenIndex, depth if buffer[position] != rune('n') { - goto l243 + goto l246 } position++ if buffer[position] != rune('i') { - goto l243 + goto l246 } position++ if buffer[position] != rune('l') { - goto l243 + goto l246 } position++ - goto l242 - l243: - position, tokenIndex, depth = position242, tokenIndex242, depth242 + goto l245 + l246: + position, tokenIndex, depth = position245, tokenIndex245, depth245 if buffer[position] != rune('~') { - goto l240 + goto l243 } position++ } - l242: + l245: depth-- - add(ruleNil, position241) + add(ruleNil, position244) } return true - l240: - position, tokenIndex, depth = position240, tokenIndex240, depth240 + l243: + position, tokenIndex, depth = position243, tokenIndex243, depth243 return false }, - /* 56 Undefined <- <('~' '~')> */ + /* 57 Undefined <- <('~' '~')> */ func() bool { - position244, tokenIndex244, depth244 := position, tokenIndex, depth + position247, tokenIndex247, depth247 := position, tokenIndex, depth { - position245 := position + position248 := position depth++ if buffer[position] != rune('~') { - goto l244 + goto l247 } position++ if buffer[position] != rune('~') { - goto l244 + goto l247 } position++ depth-- - add(ruleUndefined, position245) + add(ruleUndefined, position248) } return true - l244: - position, tokenIndex, depth = position244, tokenIndex244, depth244 + l247: + position, tokenIndex, depth = position247, tokenIndex247, depth247 return false }, - /* 57 Symbol <- <('$' Name)> */ + /* 58 Symbol <- <('$' Name)> */ func() bool { - position246, tokenIndex246, depth246 := position, tokenIndex, depth + position249, tokenIndex249, depth249 := position, tokenIndex, depth { - position247 := position + position250 := position depth++ if buffer[position] != rune('$') { - goto l246 + goto l249 } position++ if !_rules[ruleName]() { - goto l246 + goto l249 } depth-- - add(ruleSymbol, position247) + add(ruleSymbol, position250) } return true - l246: - position, tokenIndex, depth = position246, tokenIndex246, depth246 + l249: + position, tokenIndex, depth = position249, tokenIndex249, depth249 return false }, - /* 58 List <- <(StartList ExpressionList? ']')> */ + /* 59 List <- <(StartList ExpressionList? ']')> */ func() bool { - position248, tokenIndex248, depth248 := position, tokenIndex, depth + position251, tokenIndex251, depth251 := position, tokenIndex, depth { - position249 := position + position252 := position depth++ if !_rules[ruleStartList]() { - goto l248 + goto l251 } { - position250, tokenIndex250, depth250 := position, tokenIndex, depth + position253, tokenIndex253, depth253 := position, tokenIndex, depth if !_rules[ruleExpressionList]() { - goto l250 + goto l253 } - goto l251 - l250: - position, tokenIndex, depth = position250, tokenIndex250, depth250 + goto l254 + l253: + position, tokenIndex, depth = position253, tokenIndex253, depth253 } - l251: + l254: if buffer[position] != rune(']') { - goto l248 + goto l251 } position++ depth-- - add(ruleList, position249) + add(ruleList, position252) } return true - l248: - position, tokenIndex, depth = position248, tokenIndex248, depth248 + l251: + position, tokenIndex, depth = position251, tokenIndex251, depth251 return false }, - /* 59 StartList <- <('[' ws)> */ + /* 60 StartList <- <('[' ws)> */ func() bool { - position252, tokenIndex252, depth252 := position, tokenIndex, depth + position255, tokenIndex255, depth255 := position, tokenIndex, depth { - position253 := position + position256 := position depth++ if buffer[position] != rune('[') { - goto l252 + goto l255 } position++ if !_rules[rulews]() { - goto l252 + goto l255 } depth-- - add(ruleStartList, position253) + add(ruleStartList, position256) } return true - l252: - position, tokenIndex, depth = position252, tokenIndex252, depth252 + l255: + position, tokenIndex, depth = position255, tokenIndex255, depth255 return false }, - /* 60 Map <- <(CreateMap ws Assignments? '}')> */ + /* 61 Map <- <(CreateMap ws Assignments? '}')> */ func() bool { - position254, tokenIndex254, depth254 := position, tokenIndex, depth + position257, tokenIndex257, depth257 := position, tokenIndex, depth { - position255 := position + position258 := position depth++ if !_rules[ruleCreateMap]() { - goto l254 + goto l257 } if !_rules[rulews]() { - goto l254 + goto l257 } { - position256, tokenIndex256, depth256 := position, tokenIndex, depth + position259, tokenIndex259, depth259 := position, tokenIndex, depth if !_rules[ruleAssignments]() { - goto l256 + goto l259 } - goto l257 - l256: - position, tokenIndex, depth = position256, tokenIndex256, depth256 + goto l260 + l259: + position, tokenIndex, depth = position259, tokenIndex259, depth259 } - l257: + l260: if buffer[position] != rune('}') { - goto l254 + goto l257 } position++ depth-- - add(ruleMap, position255) + add(ruleMap, position258) } return true - l254: - position, tokenIndex, depth = position254, tokenIndex254, depth254 + l257: + position, tokenIndex, depth = position257, tokenIndex257, depth257 return false }, - /* 61 CreateMap <- <'{'> */ + /* 62 CreateMap <- <'{'> */ func() bool { - position258, tokenIndex258, depth258 := position, tokenIndex, depth + position261, tokenIndex261, depth261 := position, tokenIndex, depth { - position259 := position + position262 := position depth++ if buffer[position] != rune('{') { - goto l258 + goto l261 } position++ depth-- - add(ruleCreateMap, position259) + add(ruleCreateMap, position262) } return true - l258: - position, tokenIndex, depth = position258, tokenIndex258, depth258 + l261: + position, tokenIndex, depth = position261, tokenIndex261, depth261 return false }, - /* 62 Assignments <- <(Assignment (',' Assignment)*)> */ + /* 63 Assignments <- <(Assignment (',' Assignment)*)> */ func() bool { - position260, tokenIndex260, depth260 := position, tokenIndex, depth + position263, tokenIndex263, depth263 := position, tokenIndex, depth { - position261 := position + position264 := position depth++ if !_rules[ruleAssignment]() { - goto l260 + goto l263 } - l262: + l265: { - position263, tokenIndex263, depth263 := position, tokenIndex, depth + position266, tokenIndex266, depth266 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l263 + goto l266 } position++ if !_rules[ruleAssignment]() { - goto l263 + goto l266 } - goto l262 - l263: - position, tokenIndex, depth = position263, tokenIndex263, depth263 + goto l265 + l266: + position, tokenIndex, depth = position266, tokenIndex266, depth266 } depth-- - add(ruleAssignments, position261) + add(ruleAssignments, position264) } return true - l260: - position, tokenIndex, depth = position260, tokenIndex260, depth260 + l263: + position, tokenIndex, depth = position263, tokenIndex263, depth263 return false }, - /* 63 Assignment <- <(Expression '=' Expression)> */ + /* 64 Assignment <- <(Expression '=' Expression)> */ func() bool { - position264, tokenIndex264, depth264 := position, tokenIndex, depth + position267, tokenIndex267, depth267 := position, tokenIndex, depth { - position265 := position + position268 := position depth++ if !_rules[ruleExpression]() { - goto l264 + goto l267 } if buffer[position] != rune('=') { - goto l264 + goto l267 } position++ if !_rules[ruleExpression]() { - goto l264 + goto l267 } depth-- - add(ruleAssignment, position265) + add(ruleAssignment, position268) } return true - l264: - position, tokenIndex, depth = position264, tokenIndex264, depth264 + l267: + position, tokenIndex, depth = position267, tokenIndex267, depth267 return false }, - /* 64 Merge <- <(RefMerge / SimpleMerge)> */ + /* 65 Merge <- <(RefMerge / SimpleMerge)> */ func() bool { - position266, tokenIndex266, depth266 := position, tokenIndex, depth + position269, tokenIndex269, depth269 := position, tokenIndex, depth { - position267 := position + position270 := position depth++ { - position268, tokenIndex268, depth268 := position, tokenIndex, depth + position271, tokenIndex271, depth271 := position, tokenIndex, depth if !_rules[ruleRefMerge]() { - goto l269 + goto l272 } - goto l268 - l269: - position, tokenIndex, depth = position268, tokenIndex268, depth268 + goto l271 + l272: + position, tokenIndex, depth = position271, tokenIndex271, depth271 if !_rules[ruleSimpleMerge]() { - goto l266 + goto l269 } } - l268: + l271: depth-- - add(ruleMerge, position267) + add(ruleMerge, position270) } return true - l266: - position, tokenIndex, depth = position266, tokenIndex266, depth266 + l269: + position, tokenIndex, depth = position269, tokenIndex269, depth269 return false }, - /* 65 RefMerge <- <('m' 'e' 'r' 'g' 'e' !(req_ws Required) (req_ws (Replace / On))? req_ws Reference)> */ + /* 66 RefMerge <- <('m' 'e' 'r' 'g' 'e' !(req_ws Required) (req_ws (Replace / On))? req_ws Reference)> */ func() bool { - position270, tokenIndex270, depth270 := position, tokenIndex, depth + position273, tokenIndex273, depth273 := position, tokenIndex, depth { - position271 := position + position274 := position depth++ if buffer[position] != rune('m') { - goto l270 + goto l273 } position++ if buffer[position] != rune('e') { - goto l270 + goto l273 } position++ if buffer[position] != rune('r') { - goto l270 + goto l273 } position++ if buffer[position] != rune('g') { - goto l270 + goto l273 } position++ if buffer[position] != rune('e') { - goto l270 + goto l273 } position++ { - position272, tokenIndex272, depth272 := position, tokenIndex, depth + position275, tokenIndex275, depth275 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l272 + goto l275 } if !_rules[ruleRequired]() { - goto l272 + goto l275 } - goto l270 - l272: - position, tokenIndex, depth = position272, tokenIndex272, depth272 + goto l273 + l275: + position, tokenIndex, depth = position275, tokenIndex275, depth275 } { - position273, tokenIndex273, depth273 := position, tokenIndex, depth + position276, tokenIndex276, depth276 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l273 + goto l276 } { - position275, tokenIndex275, depth275 := position, tokenIndex, depth + position278, tokenIndex278, depth278 := position, tokenIndex, depth if !_rules[ruleReplace]() { - goto l276 + goto l279 } - goto l275 - l276: - position, tokenIndex, depth = position275, tokenIndex275, depth275 + goto l278 + l279: + position, tokenIndex, depth = position278, tokenIndex278, depth278 if !_rules[ruleOn]() { - goto l273 + goto l276 } } - l275: - goto l274 - l273: - position, tokenIndex, depth = position273, tokenIndex273, depth273 + l278: + goto l277 + l276: + position, tokenIndex, depth = position276, tokenIndex276, depth276 } - l274: + l277: if !_rules[rulereq_ws]() { - goto l270 + goto l273 } if !_rules[ruleReference]() { - goto l270 + goto l273 } depth-- - add(ruleRefMerge, position271) + add(ruleRefMerge, position274) } return true - l270: - position, tokenIndex, depth = position270, tokenIndex270, depth270 + l273: + position, tokenIndex, depth = position273, tokenIndex273, depth273 return false }, - /* 66 SimpleMerge <- <('m' 'e' 'r' 'g' 'e' !'(' (req_ws (Replace / Required / On))?)> */ + /* 67 SimpleMerge <- <('m' 'e' 'r' 'g' 'e' !'(' (req_ws (Replace / Required / On))?)> */ func() bool { - position277, tokenIndex277, depth277 := position, tokenIndex, depth + position280, tokenIndex280, depth280 := position, tokenIndex, depth { - position278 := position + position281 := position depth++ if buffer[position] != rune('m') { - goto l277 + goto l280 } position++ if buffer[position] != rune('e') { - goto l277 + goto l280 } position++ if buffer[position] != rune('r') { - goto l277 + goto l280 } position++ if buffer[position] != rune('g') { - goto l277 + goto l280 } position++ if buffer[position] != rune('e') { - goto l277 + goto l280 } position++ { - position279, tokenIndex279, depth279 := position, tokenIndex, depth + position282, tokenIndex282, depth282 := position, tokenIndex, depth if buffer[position] != rune('(') { - goto l279 + goto l282 } position++ - goto l277 - l279: - position, tokenIndex, depth = position279, tokenIndex279, depth279 + goto l280 + l282: + position, tokenIndex, depth = position282, tokenIndex282, depth282 } { - position280, tokenIndex280, depth280 := position, tokenIndex, depth + position283, tokenIndex283, depth283 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l280 + goto l283 } { - position282, tokenIndex282, depth282 := position, tokenIndex, depth + position285, tokenIndex285, depth285 := position, tokenIndex, depth if !_rules[ruleReplace]() { - goto l283 + goto l286 } - goto l282 - l283: - position, tokenIndex, depth = position282, tokenIndex282, depth282 + goto l285 + l286: + position, tokenIndex, depth = position285, tokenIndex285, depth285 if !_rules[ruleRequired]() { - goto l284 + goto l287 } - goto l282 - l284: - position, tokenIndex, depth = position282, tokenIndex282, depth282 + goto l285 + l287: + position, tokenIndex, depth = position285, tokenIndex285, depth285 if !_rules[ruleOn]() { - goto l280 + goto l283 } } - l282: - goto l281 - l280: - position, tokenIndex, depth = position280, tokenIndex280, depth280 + l285: + goto l284 + l283: + position, tokenIndex, depth = position283, tokenIndex283, depth283 } - l281: + l284: depth-- - add(ruleSimpleMerge, position278) + add(ruleSimpleMerge, position281) } return true - l277: - position, tokenIndex, depth = position277, tokenIndex277, depth277 + l280: + position, tokenIndex, depth = position280, tokenIndex280, depth280 return false }, - /* 67 Replace <- <('r' 'e' 'p' 'l' 'a' 'c' 'e')> */ + /* 68 Replace <- <('r' 'e' 'p' 'l' 'a' 'c' 'e')> */ func() bool { - position285, tokenIndex285, depth285 := position, tokenIndex, depth + position288, tokenIndex288, depth288 := position, tokenIndex, depth { - position286 := position + position289 := position depth++ if buffer[position] != rune('r') { - goto l285 + goto l288 } position++ if buffer[position] != rune('e') { - goto l285 + goto l288 } position++ if buffer[position] != rune('p') { - goto l285 + goto l288 } position++ if buffer[position] != rune('l') { - goto l285 + goto l288 } position++ if buffer[position] != rune('a') { - goto l285 + goto l288 } position++ if buffer[position] != rune('c') { - goto l285 + goto l288 } position++ if buffer[position] != rune('e') { - goto l285 + goto l288 } position++ depth-- - add(ruleReplace, position286) + add(ruleReplace, position289) } return true - l285: - position, tokenIndex, depth = position285, tokenIndex285, depth285 + l288: + position, tokenIndex, depth = position288, tokenIndex288, depth288 return false }, - /* 68 Required <- <('r' 'e' 'q' 'u' 'i' 'r' 'e' 'd')> */ + /* 69 Required <- <('r' 'e' 'q' 'u' 'i' 'r' 'e' 'd')> */ func() bool { - position287, tokenIndex287, depth287 := position, tokenIndex, depth + position290, tokenIndex290, depth290 := position, tokenIndex, depth { - position288 := position + position291 := position depth++ if buffer[position] != rune('r') { - goto l287 + goto l290 } position++ if buffer[position] != rune('e') { - goto l287 + goto l290 } position++ if buffer[position] != rune('q') { - goto l287 + goto l290 } position++ if buffer[position] != rune('u') { - goto l287 + goto l290 } position++ if buffer[position] != rune('i') { - goto l287 + goto l290 } position++ if buffer[position] != rune('r') { - goto l287 + goto l290 } position++ if buffer[position] != rune('e') { - goto l287 + goto l290 } position++ if buffer[position] != rune('d') { - goto l287 + goto l290 } position++ depth-- - add(ruleRequired, position288) + add(ruleRequired, position291) } return true - l287: - position, tokenIndex, depth = position287, tokenIndex287, depth287 + l290: + position, tokenIndex, depth = position290, tokenIndex290, depth290 return false }, - /* 69 On <- <('o' 'n' req_ws Name)> */ + /* 70 On <- <('o' 'n' req_ws Name)> */ func() bool { - position289, tokenIndex289, depth289 := position, tokenIndex, depth + position292, tokenIndex292, depth292 := position, tokenIndex, depth { - position290 := position + position293 := position depth++ if buffer[position] != rune('o') { - goto l289 + goto l292 } position++ if buffer[position] != rune('n') { - goto l289 + goto l292 } position++ if !_rules[rulereq_ws]() { - goto l289 + goto l292 } if !_rules[ruleName]() { - goto l289 + goto l292 } depth-- - add(ruleOn, position290) + add(ruleOn, position293) } return true - l289: - position, tokenIndex, depth = position289, tokenIndex289, depth289 + l292: + position, tokenIndex, depth = position292, tokenIndex292, depth292 return false }, - /* 70 Auto <- <('a' 'u' 't' 'o')> */ + /* 71 Auto <- <('a' 'u' 't' 'o')> */ func() bool { - position291, tokenIndex291, depth291 := position, tokenIndex, depth + position294, tokenIndex294, depth294 := position, tokenIndex, depth { - position292 := position + position295 := position depth++ if buffer[position] != rune('a') { - goto l291 + goto l294 } position++ if buffer[position] != rune('u') { - goto l291 + goto l294 } position++ if buffer[position] != rune('t') { - goto l291 + goto l294 } position++ if buffer[position] != rune('o') { - goto l291 + goto l294 } position++ depth-- - add(ruleAuto, position292) + add(ruleAuto, position295) } return true - l291: - position, tokenIndex, depth = position291, tokenIndex291, depth291 + l294: + position, tokenIndex, depth = position294, tokenIndex294, depth294 return false }, - /* 71 Default <- */ + /* 72 Default <- */ func() bool { - position293, tokenIndex293, depth293 := position, tokenIndex, depth + position296, tokenIndex296, depth296 := position, tokenIndex, depth { - position294 := position + position297 := position depth++ if !_rules[ruleAction1]() { - goto l293 + goto l296 } depth-- - add(ruleDefault, position294) + add(ruleDefault, position297) } return true - l293: - position, tokenIndex, depth = position293, tokenIndex293, depth293 + l296: + position, tokenIndex, depth = position296, tokenIndex296, depth296 return false }, - /* 72 Sync <- <('s' 'y' 'n' 'c' '[' Level7 ((((LambdaExpr LambdaExt) / (LambdaOrExpr LambdaOrExpr)) (('|' Expression) / Default)) / (LambdaOrExpr Default Default)) ']')> */ + /* 73 Sync <- <('s' 'y' 'n' 'c' '[' Level7 ((((LambdaExpr LambdaExt) / (LambdaOrExpr LambdaOrExpr)) (('|' Expression) / Default)) / (LambdaOrExpr Default Default)) ']')> */ func() bool { - position295, tokenIndex295, depth295 := position, tokenIndex, depth + position298, tokenIndex298, depth298 := position, tokenIndex, depth { - position296 := position + position299 := position depth++ if buffer[position] != rune('s') { - goto l295 + goto l298 } position++ if buffer[position] != rune('y') { - goto l295 + goto l298 } position++ if buffer[position] != rune('n') { - goto l295 + goto l298 } position++ if buffer[position] != rune('c') { - goto l295 + goto l298 } position++ if buffer[position] != rune('[') { - goto l295 + goto l298 } position++ if !_rules[ruleLevel7]() { - goto l295 + goto l298 } { - position297, tokenIndex297, depth297 := position, tokenIndex, depth + position300, tokenIndex300, depth300 := position, tokenIndex, depth { - position299, tokenIndex299, depth299 := position, tokenIndex, depth + position302, tokenIndex302, depth302 := position, tokenIndex, depth if !_rules[ruleLambdaExpr]() { - goto l300 + goto l303 } if !_rules[ruleLambdaExt]() { - goto l300 + goto l303 } - goto l299 - l300: - position, tokenIndex, depth = position299, tokenIndex299, depth299 + goto l302 + l303: + position, tokenIndex, depth = position302, tokenIndex302, depth302 if !_rules[ruleLambdaOrExpr]() { - goto l298 + goto l301 } if !_rules[ruleLambdaOrExpr]() { - goto l298 + goto l301 } } - l299: + l302: { - position301, tokenIndex301, depth301 := position, tokenIndex, depth + position304, tokenIndex304, depth304 := position, tokenIndex, depth if buffer[position] != rune('|') { - goto l302 + goto l305 } position++ if !_rules[ruleExpression]() { - goto l302 + goto l305 } - goto l301 - l302: - position, tokenIndex, depth = position301, tokenIndex301, depth301 + goto l304 + l305: + position, tokenIndex, depth = position304, tokenIndex304, depth304 if !_rules[ruleDefault]() { - goto l298 + goto l301 } } + l304: + goto l300 l301: - goto l297 - l298: - position, tokenIndex, depth = position297, tokenIndex297, depth297 + position, tokenIndex, depth = position300, tokenIndex300, depth300 if !_rules[ruleLambdaOrExpr]() { - goto l295 + goto l298 } if !_rules[ruleDefault]() { - goto l295 + goto l298 } if !_rules[ruleDefault]() { - goto l295 + goto l298 } } - l297: + l300: if buffer[position] != rune(']') { - goto l295 + goto l298 } position++ depth-- - add(ruleSync, position296) + add(ruleSync, position299) } return true - l295: - position, tokenIndex, depth = position295, tokenIndex295, depth295 + l298: + position, tokenIndex, depth = position298, tokenIndex298, depth298 return false }, - /* 73 LambdaExt <- <(',' Expression)> */ + /* 74 LambdaExt <- <(',' Expression)> */ func() bool { - position303, tokenIndex303, depth303 := position, tokenIndex, depth + position306, tokenIndex306, depth306 := position, tokenIndex, depth { - position304 := position + position307 := position depth++ if buffer[position] != rune(',') { - goto l303 + goto l306 } position++ if !_rules[ruleExpression]() { - goto l303 + goto l306 } depth-- - add(ruleLambdaExt, position304) + add(ruleLambdaExt, position307) } return true - l303: - position, tokenIndex, depth = position303, tokenIndex303, depth303 + l306: + position, tokenIndex, depth = position306, tokenIndex306, depth306 return false }, - /* 74 LambdaOrExpr <- <(LambdaExpr / ('|' Expression))> */ + /* 75 LambdaOrExpr <- <(LambdaExpr / ('|' Expression))> */ func() bool { - position305, tokenIndex305, depth305 := position, tokenIndex, depth + position308, tokenIndex308, depth308 := position, tokenIndex, depth { - position306 := position + position309 := position depth++ { - position307, tokenIndex307, depth307 := position, tokenIndex, depth + position310, tokenIndex310, depth310 := position, tokenIndex, depth if !_rules[ruleLambdaExpr]() { - goto l308 + goto l311 } - goto l307 - l308: - position, tokenIndex, depth = position307, tokenIndex307, depth307 + goto l310 + l311: + position, tokenIndex, depth = position310, tokenIndex310, depth310 if buffer[position] != rune('|') { - goto l305 + goto l308 } position++ if !_rules[ruleExpression]() { - goto l305 + goto l308 } } - l307: + l310: depth-- - add(ruleLambdaOrExpr, position306) + add(ruleLambdaOrExpr, position309) } return true - l305: - position, tokenIndex, depth = position305, tokenIndex305, depth305 + l308: + position, tokenIndex, depth = position308, tokenIndex308, depth308 return false }, - /* 75 Catch <- <('c' 'a' 't' 'c' 'h' '[' Level7 LambdaOrExpr ']')> */ + /* 76 Catch <- <('c' 'a' 't' 'c' 'h' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position309, tokenIndex309, depth309 := position, tokenIndex, depth + position312, tokenIndex312, depth312 := position, tokenIndex, depth { - position310 := position + position313 := position depth++ if buffer[position] != rune('c') { - goto l309 + goto l312 } position++ if buffer[position] != rune('a') { - goto l309 + goto l312 } position++ if buffer[position] != rune('t') { - goto l309 + goto l312 } position++ if buffer[position] != rune('c') { - goto l309 + goto l312 } position++ if buffer[position] != rune('h') { - goto l309 + goto l312 } position++ if buffer[position] != rune('[') { - goto l309 + goto l312 } position++ if !_rules[ruleLevel7]() { - goto l309 + goto l312 } if !_rules[ruleLambdaOrExpr]() { - goto l309 + goto l312 } if buffer[position] != rune(']') { - goto l309 + goto l312 } position++ depth-- - add(ruleCatch, position310) + add(ruleCatch, position313) } return true - l309: - position, tokenIndex, depth = position309, tokenIndex309, depth309 + l312: + position, tokenIndex, depth = position312, tokenIndex312, depth312 return false }, - /* 76 MapMapping <- <('m' 'a' 'p' '{' Level7 LambdaOrExpr '}')> */ + /* 77 MapMapping <- <('m' 'a' 'p' '{' Level7 LambdaOrExpr '}')> */ func() bool { - position311, tokenIndex311, depth311 := position, tokenIndex, depth + position314, tokenIndex314, depth314 := position, tokenIndex, depth { - position312 := position + position315 := position depth++ if buffer[position] != rune('m') { - goto l311 + goto l314 } position++ if buffer[position] != rune('a') { - goto l311 + goto l314 } position++ if buffer[position] != rune('p') { - goto l311 + goto l314 } position++ if buffer[position] != rune('{') { - goto l311 + goto l314 } position++ if !_rules[ruleLevel7]() { - goto l311 + goto l314 } if !_rules[ruleLambdaOrExpr]() { - goto l311 + goto l314 } if buffer[position] != rune('}') { - goto l311 + goto l314 } position++ depth-- - add(ruleMapMapping, position312) + add(ruleMapMapping, position315) } return true - l311: - position, tokenIndex, depth = position311, tokenIndex311, depth311 + l314: + position, tokenIndex, depth = position314, tokenIndex314, depth314 return false }, - /* 77 Mapping <- <('m' 'a' 'p' '[' Level7 LambdaOrExpr ']')> */ + /* 78 Mapping <- <('m' 'a' 'p' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position313, tokenIndex313, depth313 := position, tokenIndex, depth + position316, tokenIndex316, depth316 := position, tokenIndex, depth { - position314 := position + position317 := position depth++ if buffer[position] != rune('m') { - goto l313 + goto l316 } position++ if buffer[position] != rune('a') { - goto l313 + goto l316 } position++ if buffer[position] != rune('p') { - goto l313 + goto l316 } position++ if buffer[position] != rune('[') { - goto l313 + goto l316 } position++ if !_rules[ruleLevel7]() { - goto l313 + goto l316 } if !_rules[ruleLambdaOrExpr]() { - goto l313 + goto l316 } if buffer[position] != rune(']') { - goto l313 + goto l316 } position++ depth-- - add(ruleMapping, position314) + add(ruleMapping, position317) } return true - l313: - position, tokenIndex, depth = position313, tokenIndex313, depth313 + l316: + position, tokenIndex, depth = position316, tokenIndex316, depth316 return false }, - /* 78 MapSelection <- <('s' 'e' 'l' 'e' 'c' 't' '{' Level7 LambdaOrExpr '}')> */ + /* 79 MapSelection <- <('s' 'e' 'l' 'e' 'c' 't' '{' Level7 LambdaOrExpr '}')> */ func() bool { - position315, tokenIndex315, depth315 := position, tokenIndex, depth + position318, tokenIndex318, depth318 := position, tokenIndex, depth { - position316 := position + position319 := position depth++ if buffer[position] != rune('s') { - goto l315 + goto l318 } position++ if buffer[position] != rune('e') { - goto l315 + goto l318 } position++ if buffer[position] != rune('l') { - goto l315 + goto l318 } position++ if buffer[position] != rune('e') { - goto l315 + goto l318 } position++ if buffer[position] != rune('c') { - goto l315 + goto l318 } position++ if buffer[position] != rune('t') { - goto l315 + goto l318 } position++ if buffer[position] != rune('{') { - goto l315 + goto l318 } position++ if !_rules[ruleLevel7]() { - goto l315 + goto l318 } if !_rules[ruleLambdaOrExpr]() { - goto l315 + goto l318 } if buffer[position] != rune('}') { - goto l315 + goto l318 } position++ depth-- - add(ruleMapSelection, position316) + add(ruleMapSelection, position319) } return true - l315: - position, tokenIndex, depth = position315, tokenIndex315, depth315 + l318: + position, tokenIndex, depth = position318, tokenIndex318, depth318 return false }, - /* 79 Selection <- <('s' 'e' 'l' 'e' 'c' 't' '[' Level7 LambdaOrExpr ']')> */ + /* 80 Selection <- <('s' 'e' 'l' 'e' 'c' 't' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position317, tokenIndex317, depth317 := position, tokenIndex, depth + position320, tokenIndex320, depth320 := position, tokenIndex, depth { - position318 := position + position321 := position depth++ if buffer[position] != rune('s') { - goto l317 + goto l320 } position++ if buffer[position] != rune('e') { - goto l317 + goto l320 } position++ if buffer[position] != rune('l') { - goto l317 + goto l320 } position++ if buffer[position] != rune('e') { - goto l317 + goto l320 } position++ if buffer[position] != rune('c') { - goto l317 + goto l320 } position++ if buffer[position] != rune('t') { - goto l317 + goto l320 } position++ if buffer[position] != rune('[') { - goto l317 + goto l320 } position++ if !_rules[ruleLevel7]() { - goto l317 + goto l320 } if !_rules[ruleLambdaOrExpr]() { - goto l317 + goto l320 } if buffer[position] != rune(']') { - goto l317 + goto l320 } position++ depth-- - add(ruleSelection, position318) + add(ruleSelection, position321) } return true - l317: - position, tokenIndex, depth = position317, tokenIndex317, depth317 + l320: + position, tokenIndex, depth = position320, tokenIndex320, depth320 return false }, - /* 80 Sum <- <('s' 'u' 'm' '[' Level7 '|' Level7 LambdaOrExpr ']')> */ + /* 81 Sum <- <('s' 'u' 'm' '[' Level7 '|' Level7 LambdaOrExpr ']')> */ func() bool { - position319, tokenIndex319, depth319 := position, tokenIndex, depth + position322, tokenIndex322, depth322 := position, tokenIndex, depth { - position320 := position + position323 := position depth++ if buffer[position] != rune('s') { - goto l319 + goto l322 } position++ if buffer[position] != rune('u') { - goto l319 + goto l322 } position++ if buffer[position] != rune('m') { - goto l319 + goto l322 } position++ if buffer[position] != rune('[') { - goto l319 + goto l322 } position++ if !_rules[ruleLevel7]() { - goto l319 + goto l322 } if buffer[position] != rune('|') { - goto l319 + goto l322 } position++ if !_rules[ruleLevel7]() { - goto l319 + goto l322 } if !_rules[ruleLambdaOrExpr]() { - goto l319 + goto l322 } if buffer[position] != rune(']') { - goto l319 + goto l322 } position++ depth-- - add(ruleSum, position320) + add(ruleSum, position323) } return true - l319: - position, tokenIndex, depth = position319, tokenIndex319, depth319 + l322: + position, tokenIndex, depth = position322, tokenIndex322, depth322 return false }, - /* 81 Lambda <- <('l' 'a' 'm' 'b' 'd' 'a' (LambdaRef / LambdaExpr))> */ + /* 82 Lambda <- <('l' 'a' 'm' 'b' 'd' 'a' (LambdaRef / LambdaExpr))> */ func() bool { - position321, tokenIndex321, depth321 := position, tokenIndex, depth + position324, tokenIndex324, depth324 := position, tokenIndex, depth { - position322 := position + position325 := position depth++ if buffer[position] != rune('l') { - goto l321 + goto l324 } position++ if buffer[position] != rune('a') { - goto l321 + goto l324 } position++ if buffer[position] != rune('m') { - goto l321 + goto l324 } position++ if buffer[position] != rune('b') { - goto l321 + goto l324 } position++ if buffer[position] != rune('d') { - goto l321 + goto l324 } position++ if buffer[position] != rune('a') { - goto l321 + goto l324 } position++ { - position323, tokenIndex323, depth323 := position, tokenIndex, depth + position326, tokenIndex326, depth326 := position, tokenIndex, depth if !_rules[ruleLambdaRef]() { - goto l324 + goto l327 } - goto l323 - l324: - position, tokenIndex, depth = position323, tokenIndex323, depth323 + goto l326 + l327: + position, tokenIndex, depth = position326, tokenIndex326, depth326 if !_rules[ruleLambdaExpr]() { - goto l321 + goto l324 } } - l323: + l326: depth-- - add(ruleLambda, position322) + add(ruleLambda, position325) } return true - l321: - position, tokenIndex, depth = position321, tokenIndex321, depth321 + l324: + position, tokenIndex, depth = position324, tokenIndex324, depth324 return false }, - /* 82 LambdaRef <- <(req_ws Expression)> */ + /* 83 LambdaRef <- <(req_ws Expression)> */ func() bool { - position325, tokenIndex325, depth325 := position, tokenIndex, depth + position328, tokenIndex328, depth328 := position, tokenIndex, depth { - position326 := position + position329 := position depth++ if !_rules[rulereq_ws]() { - goto l325 + goto l328 } if !_rules[ruleExpression]() { - goto l325 + goto l328 } depth-- - add(ruleLambdaRef, position326) + add(ruleLambdaRef, position329) } return true - l325: - position, tokenIndex, depth = position325, tokenIndex325, depth325 + l328: + position, tokenIndex, depth = position328, tokenIndex328, depth328 return false }, - /* 83 LambdaExpr <- <(ws Params ws ('-' '>') Expression)> */ + /* 84 LambdaExpr <- <(ws Params ws ('-' '>') Expression)> */ func() bool { - position327, tokenIndex327, depth327 := position, tokenIndex, depth + position330, tokenIndex330, depth330 := position, tokenIndex, depth { - position328 := position + position331 := position depth++ if !_rules[rulews]() { - goto l327 + goto l330 } if !_rules[ruleParams]() { - goto l327 + goto l330 } if !_rules[rulews]() { - goto l327 + goto l330 } if buffer[position] != rune('-') { - goto l327 + goto l330 } position++ if buffer[position] != rune('>') { - goto l327 + goto l330 } position++ if !_rules[ruleExpression]() { - goto l327 + goto l330 } depth-- - add(ruleLambdaExpr, position328) + add(ruleLambdaExpr, position331) } return true - l327: - position, tokenIndex, depth = position327, tokenIndex327, depth327 + l330: + position, tokenIndex, depth = position330, tokenIndex330, depth330 return false }, - /* 84 Params <- <('|' StartParams ws Names? '|')> */ + /* 85 Params <- <('|' StartParams ws Names? '|')> */ func() bool { - position329, tokenIndex329, depth329 := position, tokenIndex, depth + position332, tokenIndex332, depth332 := position, tokenIndex, depth { - position330 := position + position333 := position depth++ if buffer[position] != rune('|') { - goto l329 + goto l332 } position++ if !_rules[ruleStartParams]() { - goto l329 + goto l332 } if !_rules[rulews]() { - goto l329 + goto l332 } { - position331, tokenIndex331, depth331 := position, tokenIndex, depth + position334, tokenIndex334, depth334 := position, tokenIndex, depth if !_rules[ruleNames]() { - goto l331 + goto l334 } - goto l332 - l331: - position, tokenIndex, depth = position331, tokenIndex331, depth331 + goto l335 + l334: + position, tokenIndex, depth = position334, tokenIndex334, depth334 } - l332: + l335: if buffer[position] != rune('|') { - goto l329 + goto l332 } position++ depth-- - add(ruleParams, position330) + add(ruleParams, position333) } return true - l329: - position, tokenIndex, depth = position329, tokenIndex329, depth329 + l332: + position, tokenIndex, depth = position332, tokenIndex332, depth332 return false }, - /* 85 StartParams <- */ + /* 86 StartParams <- */ func() bool { - position333, tokenIndex333, depth333 := position, tokenIndex, depth + position336, tokenIndex336, depth336 := position, tokenIndex, depth { - position334 := position + position337 := position depth++ if !_rules[ruleAction2]() { - goto l333 + goto l336 } depth-- - add(ruleStartParams, position334) + add(ruleStartParams, position337) } return true - l333: - position, tokenIndex, depth = position333, tokenIndex333, depth333 + l336: + position, tokenIndex, depth = position336, tokenIndex336, depth336 return false }, - /* 86 Names <- <(NextName (',' NextName)* DefaultValue? (',' NextName DefaultValue)* VarParams?)> */ + /* 87 Names <- <(NextName (',' NextName)* DefaultValue? (',' NextName DefaultValue)* VarParams?)> */ func() bool { - position335, tokenIndex335, depth335 := position, tokenIndex, depth + position338, tokenIndex338, depth338 := position, tokenIndex, depth { - position336 := position + position339 := position depth++ if !_rules[ruleNextName]() { - goto l335 + goto l338 } - l337: + l340: { - position338, tokenIndex338, depth338 := position, tokenIndex, depth + position341, tokenIndex341, depth341 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l338 + goto l341 } position++ if !_rules[ruleNextName]() { - goto l338 + goto l341 } - goto l337 - l338: - position, tokenIndex, depth = position338, tokenIndex338, depth338 + goto l340 + l341: + position, tokenIndex, depth = position341, tokenIndex341, depth341 } { - position339, tokenIndex339, depth339 := position, tokenIndex, depth + position342, tokenIndex342, depth342 := position, tokenIndex, depth if !_rules[ruleDefaultValue]() { - goto l339 + goto l342 } - goto l340 - l339: - position, tokenIndex, depth = position339, tokenIndex339, depth339 + goto l343 + l342: + position, tokenIndex, depth = position342, tokenIndex342, depth342 } - l340: - l341: + l343: + l344: { - position342, tokenIndex342, depth342 := position, tokenIndex, depth + position345, tokenIndex345, depth345 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l342 + goto l345 } position++ if !_rules[ruleNextName]() { - goto l342 + goto l345 } if !_rules[ruleDefaultValue]() { - goto l342 + goto l345 } - goto l341 - l342: - position, tokenIndex, depth = position342, tokenIndex342, depth342 + goto l344 + l345: + position, tokenIndex, depth = position345, tokenIndex345, depth345 } { - position343, tokenIndex343, depth343 := position, tokenIndex, depth + position346, tokenIndex346, depth346 := position, tokenIndex, depth if !_rules[ruleVarParams]() { - goto l343 + goto l346 } - goto l344 - l343: - position, tokenIndex, depth = position343, tokenIndex343, depth343 + goto l347 + l346: + position, tokenIndex, depth = position346, tokenIndex346, depth346 } - l344: + l347: depth-- - add(ruleNames, position336) + add(ruleNames, position339) } return true - l335: - position, tokenIndex, depth = position335, tokenIndex335, depth335 + l338: + position, tokenIndex, depth = position338, tokenIndex338, depth338 return false }, - /* 87 NextName <- <(ws Name ws)> */ + /* 88 NextName <- <(ws Name ws)> */ func() bool { - position345, tokenIndex345, depth345 := position, tokenIndex, depth + position348, tokenIndex348, depth348 := position, tokenIndex, depth { - position346 := position + position349 := position depth++ if !_rules[rulews]() { - goto l345 + goto l348 } if !_rules[ruleName]() { - goto l345 + goto l348 } if !_rules[rulews]() { - goto l345 + goto l348 } depth-- - add(ruleNextName, position346) + add(ruleNextName, position349) } return true - l345: - position, tokenIndex, depth = position345, tokenIndex345, depth345 + l348: + position, tokenIndex, depth = position348, tokenIndex348, depth348 return false }, - /* 88 Name <- <([a-z] / [A-Z] / [0-9] / '_')+> */ + /* 89 Name <- <([a-z] / [A-Z] / [0-9] / '_')+> */ func() bool { - position347, tokenIndex347, depth347 := position, tokenIndex, depth + position350, tokenIndex350, depth350 := position, tokenIndex, depth { - position348 := position + position351 := position depth++ { - position351, tokenIndex351, depth351 := position, tokenIndex, depth + position354, tokenIndex354, depth354 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l352 + goto l355 } position++ - goto l351 - l352: - position, tokenIndex, depth = position351, tokenIndex351, depth351 + goto l354 + l355: + position, tokenIndex, depth = position354, tokenIndex354, depth354 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l353 + goto l356 } position++ - goto l351 - l353: - position, tokenIndex, depth = position351, tokenIndex351, depth351 + goto l354 + l356: + position, tokenIndex, depth = position354, tokenIndex354, depth354 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l354 + goto l357 } position++ - goto l351 - l354: - position, tokenIndex, depth = position351, tokenIndex351, depth351 + goto l354 + l357: + position, tokenIndex, depth = position354, tokenIndex354, depth354 if buffer[position] != rune('_') { - goto l347 + goto l350 } position++ } - l351: - l349: + l354: + l352: { - position350, tokenIndex350, depth350 := position, tokenIndex, depth + position353, tokenIndex353, depth353 := position, tokenIndex, depth { - position355, tokenIndex355, depth355 := position, tokenIndex, depth + position358, tokenIndex358, depth358 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l356 + goto l359 } position++ - goto l355 - l356: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l358 + l359: + position, tokenIndex, depth = position358, tokenIndex358, depth358 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l357 + goto l360 } position++ - goto l355 - l357: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l358 + l360: + position, tokenIndex, depth = position358, tokenIndex358, depth358 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l358 + goto l361 } position++ - goto l355 - l358: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l358 + l361: + position, tokenIndex, depth = position358, tokenIndex358, depth358 if buffer[position] != rune('_') { - goto l350 + goto l353 } position++ } - l355: - goto l349 - l350: - position, tokenIndex, depth = position350, tokenIndex350, depth350 + l358: + goto l352 + l353: + position, tokenIndex, depth = position353, tokenIndex353, depth353 } depth-- - add(ruleName, position348) + add(ruleName, position351) } return true - l347: - position, tokenIndex, depth = position347, tokenIndex347, depth347 + l350: + position, tokenIndex, depth = position350, tokenIndex350, depth350 return false }, - /* 89 DefaultValue <- <('=' Expression)> */ + /* 90 DefaultValue <- <('=' Expression)> */ func() bool { - position359, tokenIndex359, depth359 := position, tokenIndex, depth + position362, tokenIndex362, depth362 := position, tokenIndex, depth { - position360 := position + position363 := position depth++ if buffer[position] != rune('=') { - goto l359 + goto l362 } position++ if !_rules[ruleExpression]() { - goto l359 + goto l362 } depth-- - add(ruleDefaultValue, position360) + add(ruleDefaultValue, position363) } return true - l359: - position, tokenIndex, depth = position359, tokenIndex359, depth359 + l362: + position, tokenIndex, depth = position362, tokenIndex362, depth362 return false }, - /* 90 VarParams <- <('.' '.' '.' ws)> */ + /* 91 VarParams <- <('.' '.' '.' ws)> */ func() bool { - position361, tokenIndex361, depth361 := position, tokenIndex, depth + position364, tokenIndex364, depth364 := position, tokenIndex, depth { - position362 := position + position365 := position depth++ if buffer[position] != rune('.') { - goto l361 + goto l364 } position++ if buffer[position] != rune('.') { - goto l361 + goto l364 } position++ if buffer[position] != rune('.') { - goto l361 + goto l364 } position++ if !_rules[rulews]() { - goto l361 + goto l364 } depth-- - add(ruleVarParams, position362) + add(ruleVarParams, position365) } return true - l361: - position, tokenIndex, depth = position361, tokenIndex361, depth361 + l364: + position, tokenIndex, depth = position364, tokenIndex364, depth364 return false }, - /* 91 Reference <- <('.'? Key FollowUpRef)> */ + /* 92 Reference <- <(((Tag ('.' / Key)) / ('.'? Key)) FollowUpRef)> */ func() bool { - position363, tokenIndex363, depth363 := position, tokenIndex, depth + position366, tokenIndex366, depth366 := position, tokenIndex, depth { - position364 := position + position367 := position depth++ { - position365, tokenIndex365, depth365 := position, tokenIndex, depth - if buffer[position] != rune('.') { - goto l365 + position368, tokenIndex368, depth368 := position, tokenIndex, depth + if !_rules[ruleTag]() { + goto l369 } - position++ + { + position370, tokenIndex370, depth370 := position, tokenIndex, depth + if buffer[position] != rune('.') { + goto l371 + } + position++ + goto l370 + l371: + position, tokenIndex, depth = position370, tokenIndex370, depth370 + if !_rules[ruleKey]() { + goto l369 + } + } + l370: + goto l368 + l369: + position, tokenIndex, depth = position368, tokenIndex368, depth368 + { + position372, tokenIndex372, depth372 := position, tokenIndex, depth + if buffer[position] != rune('.') { + goto l372 + } + position++ + goto l373 + l372: + position, tokenIndex, depth = position372, tokenIndex372, depth372 + } + l373: + if !_rules[ruleKey]() { + goto l366 + } + } + l368: + if !_rules[ruleFollowUpRef]() { goto l366 - l365: - position, tokenIndex, depth = position365, tokenIndex365, depth365 } - l366: - if !_rules[ruleKey]() { - goto l363 + depth-- + add(ruleReference, position367) + } + return true + l366: + position, tokenIndex, depth = position366, tokenIndex366, depth366 + return false + }, + /* 93 Tag <- <(TagName (':' ':'))> */ + func() bool { + position374, tokenIndex374, depth374 := position, tokenIndex, depth + { + position375 := position + depth++ + if !_rules[ruleTagName]() { + goto l374 + } + if buffer[position] != rune(':') { + goto l374 } - if !_rules[ruleFollowUpRef]() { - goto l363 + position++ + if buffer[position] != rune(':') { + goto l374 + } + position++ + depth-- + add(ruleTag, position375) + } + return true + l374: + position, tokenIndex, depth = position374, tokenIndex374, depth374 + return false + }, + /* 94 TagName <- <([a-z] / [A-Z] / [0-9] / '_')+> */ + func() bool { + position376, tokenIndex376, depth376 := position, tokenIndex, depth + { + position377 := position + depth++ + { + position380, tokenIndex380, depth380 := position, tokenIndex, depth + if c := buffer[position]; c < rune('a') || c > rune('z') { + goto l381 + } + position++ + goto l380 + l381: + position, tokenIndex, depth = position380, tokenIndex380, depth380 + if c := buffer[position]; c < rune('A') || c > rune('Z') { + goto l382 + } + position++ + goto l380 + l382: + position, tokenIndex, depth = position380, tokenIndex380, depth380 + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l383 + } + position++ + goto l380 + l383: + position, tokenIndex, depth = position380, tokenIndex380, depth380 + if buffer[position] != rune('_') { + goto l376 + } + position++ + } + l380: + l378: + { + position379, tokenIndex379, depth379 := position, tokenIndex, depth + { + position384, tokenIndex384, depth384 := position, tokenIndex, depth + if c := buffer[position]; c < rune('a') || c > rune('z') { + goto l385 + } + position++ + goto l384 + l385: + position, tokenIndex, depth = position384, tokenIndex384, depth384 + if c := buffer[position]; c < rune('A') || c > rune('Z') { + goto l386 + } + position++ + goto l384 + l386: + position, tokenIndex, depth = position384, tokenIndex384, depth384 + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l387 + } + position++ + goto l384 + l387: + position, tokenIndex, depth = position384, tokenIndex384, depth384 + if buffer[position] != rune('_') { + goto l379 + } + position++ + } + l384: + goto l378 + l379: + position, tokenIndex, depth = position379, tokenIndex379, depth379 } depth-- - add(ruleReference, position364) + add(ruleTagName, position377) } return true - l363: - position, tokenIndex, depth = position363, tokenIndex363, depth363 + l376: + position, tokenIndex, depth = position376, tokenIndex376, depth376 return false }, - /* 92 FollowUpRef <- */ + /* 95 FollowUpRef <- */ func() bool { { - position368 := position + position389 := position depth++ - l369: + l390: { - position370, tokenIndex370, depth370 := position, tokenIndex, depth + position391, tokenIndex391, depth391 := position, tokenIndex, depth if !_rules[rulePathComponent]() { - goto l370 + goto l391 } - goto l369 - l370: - position, tokenIndex, depth = position370, tokenIndex370, depth370 + goto l390 + l391: + position, tokenIndex, depth = position391, tokenIndex391, depth391 } depth-- - add(ruleFollowUpRef, position368) + add(ruleFollowUpRef, position389) } return true }, - /* 93 PathComponent <- <(('.' Key) / ('.'? Index))> */ + /* 96 PathComponent <- <(('.' Key) / ('.'? Index))> */ func() bool { - position371, tokenIndex371, depth371 := position, tokenIndex, depth + position392, tokenIndex392, depth392 := position, tokenIndex, depth { - position372 := position + position393 := position depth++ { - position373, tokenIndex373, depth373 := position, tokenIndex, depth + position394, tokenIndex394, depth394 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l374 + goto l395 } position++ if !_rules[ruleKey]() { - goto l374 + goto l395 } - goto l373 - l374: - position, tokenIndex, depth = position373, tokenIndex373, depth373 + goto l394 + l395: + position, tokenIndex, depth = position394, tokenIndex394, depth394 { - position375, tokenIndex375, depth375 := position, tokenIndex, depth + position396, tokenIndex396, depth396 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l375 + goto l396 } position++ - goto l376 - l375: - position, tokenIndex, depth = position375, tokenIndex375, depth375 + goto l397 + l396: + position, tokenIndex, depth = position396, tokenIndex396, depth396 } - l376: + l397: if !_rules[ruleIndex]() { - goto l371 + goto l392 } } - l373: + l394: depth-- - add(rulePathComponent, position372) + add(rulePathComponent, position393) } return true - l371: - position, tokenIndex, depth = position371, tokenIndex371, depth371 + l392: + position, tokenIndex, depth = position392, tokenIndex392, depth392 return false }, - /* 94 Key <- <(([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')* (':' ([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')*)?)> */ + /* 97 Key <- <(([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')* (':' ([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')*)?)> */ func() bool { - position377, tokenIndex377, depth377 := position, tokenIndex, depth + position398, tokenIndex398, depth398 := position, tokenIndex, depth { - position378 := position + position399 := position depth++ { - position379, tokenIndex379, depth379 := position, tokenIndex, depth + position400, tokenIndex400, depth400 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l380 + goto l401 } position++ - goto l379 - l380: - position, tokenIndex, depth = position379, tokenIndex379, depth379 + goto l400 + l401: + position, tokenIndex, depth = position400, tokenIndex400, depth400 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l381 + goto l402 } position++ - goto l379 - l381: - position, tokenIndex, depth = position379, tokenIndex379, depth379 + goto l400 + l402: + position, tokenIndex, depth = position400, tokenIndex400, depth400 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l382 + goto l403 } position++ - goto l379 - l382: - position, tokenIndex, depth = position379, tokenIndex379, depth379 + goto l400 + l403: + position, tokenIndex, depth = position400, tokenIndex400, depth400 if buffer[position] != rune('_') { - goto l377 + goto l398 } position++ } - l379: - l383: + l400: + l404: { - position384, tokenIndex384, depth384 := position, tokenIndex, depth + position405, tokenIndex405, depth405 := position, tokenIndex, depth { - position385, tokenIndex385, depth385 := position, tokenIndex, depth + position406, tokenIndex406, depth406 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l386 + goto l407 } position++ - goto l385 - l386: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l406 + l407: + position, tokenIndex, depth = position406, tokenIndex406, depth406 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l387 + goto l408 } position++ - goto l385 - l387: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l406 + l408: + position, tokenIndex, depth = position406, tokenIndex406, depth406 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l388 + goto l409 } position++ - goto l385 - l388: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l406 + l409: + position, tokenIndex, depth = position406, tokenIndex406, depth406 if buffer[position] != rune('_') { - goto l389 + goto l410 } position++ - goto l385 - l389: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l406 + l410: + position, tokenIndex, depth = position406, tokenIndex406, depth406 if buffer[position] != rune('-') { - goto l384 + goto l405 } position++ } - l385: - goto l383 - l384: - position, tokenIndex, depth = position384, tokenIndex384, depth384 + l406: + goto l404 + l405: + position, tokenIndex, depth = position405, tokenIndex405, depth405 } { - position390, tokenIndex390, depth390 := position, tokenIndex, depth + position411, tokenIndex411, depth411 := position, tokenIndex, depth if buffer[position] != rune(':') { - goto l390 + goto l411 } position++ { - position392, tokenIndex392, depth392 := position, tokenIndex, depth + position413, tokenIndex413, depth413 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l393 + goto l414 } position++ - goto l392 - l393: - position, tokenIndex, depth = position392, tokenIndex392, depth392 + goto l413 + l414: + position, tokenIndex, depth = position413, tokenIndex413, depth413 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l394 + goto l415 } position++ - goto l392 - l394: - position, tokenIndex, depth = position392, tokenIndex392, depth392 + goto l413 + l415: + position, tokenIndex, depth = position413, tokenIndex413, depth413 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l395 + goto l416 } position++ - goto l392 - l395: - position, tokenIndex, depth = position392, tokenIndex392, depth392 + goto l413 + l416: + position, tokenIndex, depth = position413, tokenIndex413, depth413 if buffer[position] != rune('_') { - goto l390 + goto l411 } position++ } - l392: - l396: + l413: + l417: { - position397, tokenIndex397, depth397 := position, tokenIndex, depth + position418, tokenIndex418, depth418 := position, tokenIndex, depth { - position398, tokenIndex398, depth398 := position, tokenIndex, depth + position419, tokenIndex419, depth419 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l399 + goto l420 } position++ - goto l398 - l399: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l419 + l420: + position, tokenIndex, depth = position419, tokenIndex419, depth419 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l400 + goto l421 } position++ - goto l398 - l400: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l419 + l421: + position, tokenIndex, depth = position419, tokenIndex419, depth419 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l401 + goto l422 } position++ - goto l398 - l401: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l419 + l422: + position, tokenIndex, depth = position419, tokenIndex419, depth419 if buffer[position] != rune('_') { - goto l402 + goto l423 } position++ - goto l398 - l402: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l419 + l423: + position, tokenIndex, depth = position419, tokenIndex419, depth419 if buffer[position] != rune('-') { - goto l397 + goto l418 } position++ } - l398: - goto l396 - l397: - position, tokenIndex, depth = position397, tokenIndex397, depth397 + l419: + goto l417 + l418: + position, tokenIndex, depth = position418, tokenIndex418, depth418 } - goto l391 - l390: - position, tokenIndex, depth = position390, tokenIndex390, depth390 + goto l412 + l411: + position, tokenIndex, depth = position411, tokenIndex411, depth411 } - l391: + l412: depth-- - add(ruleKey, position378) + add(ruleKey, position399) } return true - l377: - position, tokenIndex, depth = position377, tokenIndex377, depth377 + l398: + position, tokenIndex, depth = position398, tokenIndex398, depth398 return false }, - /* 95 Index <- <('[' '-'? [0-9]+ ']')> */ + /* 98 Index <- <('[' '-'? [0-9]+ ']')> */ func() bool { - position403, tokenIndex403, depth403 := position, tokenIndex, depth + position424, tokenIndex424, depth424 := position, tokenIndex, depth { - position404 := position + position425 := position depth++ if buffer[position] != rune('[') { - goto l403 + goto l424 } position++ { - position405, tokenIndex405, depth405 := position, tokenIndex, depth + position426, tokenIndex426, depth426 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l405 + goto l426 } position++ - goto l406 - l405: - position, tokenIndex, depth = position405, tokenIndex405, depth405 + goto l427 + l426: + position, tokenIndex, depth = position426, tokenIndex426, depth426 } - l406: + l427: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l403 + goto l424 } position++ - l407: + l428: { - position408, tokenIndex408, depth408 := position, tokenIndex, depth + position429, tokenIndex429, depth429 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l408 + goto l429 } position++ - goto l407 - l408: - position, tokenIndex, depth = position408, tokenIndex408, depth408 + goto l428 + l429: + position, tokenIndex, depth = position429, tokenIndex429, depth429 } if buffer[position] != rune(']') { - goto l403 + goto l424 } position++ depth-- - add(ruleIndex, position404) + add(ruleIndex, position425) } return true - l403: - position, tokenIndex, depth = position403, tokenIndex403, depth403 + l424: + position, tokenIndex, depth = position424, tokenIndex424, depth424 return false }, - /* 96 IP <- <([0-9]+ '.' [0-9]+ '.' [0-9]+ '.' [0-9]+)> */ + /* 99 IP <- <([0-9]+ '.' [0-9]+ '.' [0-9]+ '.' [0-9]+)> */ func() bool { - position409, tokenIndex409, depth409 := position, tokenIndex, depth + position430, tokenIndex430, depth430 := position, tokenIndex, depth { - position410 := position + position431 := position depth++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l430 } position++ - l411: + l432: { - position412, tokenIndex412, depth412 := position, tokenIndex, depth + position433, tokenIndex433, depth433 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l412 + goto l433 } position++ - goto l411 - l412: - position, tokenIndex, depth = position412, tokenIndex412, depth412 + goto l432 + l433: + position, tokenIndex, depth = position433, tokenIndex433, depth433 } if buffer[position] != rune('.') { - goto l409 + goto l430 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l430 } position++ - l413: + l434: { - position414, tokenIndex414, depth414 := position, tokenIndex, depth + position435, tokenIndex435, depth435 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l414 + goto l435 } position++ - goto l413 - l414: - position, tokenIndex, depth = position414, tokenIndex414, depth414 + goto l434 + l435: + position, tokenIndex, depth = position435, tokenIndex435, depth435 } if buffer[position] != rune('.') { - goto l409 + goto l430 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l430 } position++ - l415: + l436: { - position416, tokenIndex416, depth416 := position, tokenIndex, depth + position437, tokenIndex437, depth437 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l416 + goto l437 } position++ - goto l415 - l416: - position, tokenIndex, depth = position416, tokenIndex416, depth416 + goto l436 + l437: + position, tokenIndex, depth = position437, tokenIndex437, depth437 } if buffer[position] != rune('.') { - goto l409 + goto l430 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l430 } position++ - l417: + l438: { - position418, tokenIndex418, depth418 := position, tokenIndex, depth + position439, tokenIndex439, depth439 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l418 + goto l439 } position++ - goto l417 - l418: - position, tokenIndex, depth = position418, tokenIndex418, depth418 + goto l438 + l439: + position, tokenIndex, depth = position439, tokenIndex439, depth439 } depth-- - add(ruleIP, position410) + add(ruleIP, position431) } return true - l409: - position, tokenIndex, depth = position409, tokenIndex409, depth409 + l430: + position, tokenIndex, depth = position430, tokenIndex430, depth430 return false }, - /* 97 ws <- <(' ' / '\t' / '\n' / '\r')*> */ + /* 100 ws <- <(' ' / '\t' / '\n' / '\r')*> */ func() bool { { - position420 := position + position441 := position depth++ - l421: + l442: { - position422, tokenIndex422, depth422 := position, tokenIndex, depth + position443, tokenIndex443, depth443 := position, tokenIndex, depth { - position423, tokenIndex423, depth423 := position, tokenIndex, depth + position444, tokenIndex444, depth444 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l424 + goto l445 } position++ - goto l423 - l424: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l444 + l445: + position, tokenIndex, depth = position444, tokenIndex444, depth444 if buffer[position] != rune('\t') { - goto l425 + goto l446 } position++ - goto l423 - l425: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l444 + l446: + position, tokenIndex, depth = position444, tokenIndex444, depth444 if buffer[position] != rune('\n') { - goto l426 + goto l447 } position++ - goto l423 - l426: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l444 + l447: + position, tokenIndex, depth = position444, tokenIndex444, depth444 if buffer[position] != rune('\r') { - goto l422 + goto l443 } position++ } - l423: - goto l421 - l422: - position, tokenIndex, depth = position422, tokenIndex422, depth422 + l444: + goto l442 + l443: + position, tokenIndex, depth = position443, tokenIndex443, depth443 } depth-- - add(rulews, position420) + add(rulews, position441) } return true }, - /* 98 req_ws <- <(' ' / '\t' / '\n' / '\r')+> */ + /* 101 req_ws <- <(' ' / '\t' / '\n' / '\r')+> */ func() bool { - position427, tokenIndex427, depth427 := position, tokenIndex, depth + position448, tokenIndex448, depth448 := position, tokenIndex, depth { - position428 := position + position449 := position depth++ { - position431, tokenIndex431, depth431 := position, tokenIndex, depth + position452, tokenIndex452, depth452 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l432 + goto l453 } position++ - goto l431 - l432: - position, tokenIndex, depth = position431, tokenIndex431, depth431 + goto l452 + l453: + position, tokenIndex, depth = position452, tokenIndex452, depth452 if buffer[position] != rune('\t') { - goto l433 + goto l454 } position++ - goto l431 - l433: - position, tokenIndex, depth = position431, tokenIndex431, depth431 + goto l452 + l454: + position, tokenIndex, depth = position452, tokenIndex452, depth452 if buffer[position] != rune('\n') { - goto l434 + goto l455 } position++ - goto l431 - l434: - position, tokenIndex, depth = position431, tokenIndex431, depth431 + goto l452 + l455: + position, tokenIndex, depth = position452, tokenIndex452, depth452 if buffer[position] != rune('\r') { - goto l427 + goto l448 } position++ } - l431: - l429: + l452: + l450: { - position430, tokenIndex430, depth430 := position, tokenIndex, depth + position451, tokenIndex451, depth451 := position, tokenIndex, depth { - position435, tokenIndex435, depth435 := position, tokenIndex, depth + position456, tokenIndex456, depth456 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l436 + goto l457 } position++ - goto l435 - l436: - position, tokenIndex, depth = position435, tokenIndex435, depth435 + goto l456 + l457: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\t') { - goto l437 + goto l458 } position++ - goto l435 - l437: - position, tokenIndex, depth = position435, tokenIndex435, depth435 + goto l456 + l458: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\n') { - goto l438 + goto l459 } position++ - goto l435 - l438: - position, tokenIndex, depth = position435, tokenIndex435, depth435 + goto l456 + l459: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\r') { - goto l430 + goto l451 } position++ } - l435: - goto l429 - l430: - position, tokenIndex, depth = position430, tokenIndex430, depth430 + l456: + goto l450 + l451: + position, tokenIndex, depth = position451, tokenIndex451, depth451 } depth-- - add(rulereq_ws, position428) + add(rulereq_ws, position449) } return true - l427: - position, tokenIndex, depth = position427, tokenIndex427, depth427 + l448: + position, tokenIndex, depth = position448, tokenIndex448, depth448 return false }, - /* 100 Action0 <- <{}> */ + /* 103 Action0 <- <{}> */ func() bool { { add(ruleAction0, position) } return true }, - /* 101 Action1 <- <{}> */ + /* 104 Action1 <- <{}> */ func() bool { { add(ruleAction1, position) } return true }, - /* 102 Action2 <- <{}> */ + /* 105 Action2 <- <{}> */ func() bool { { add(ruleAction2, position) diff --git a/dynaml/expression.go b/dynaml/expression.go index 90098ee..fea9eea 100644 --- a/dynaml/expression.go +++ b/dynaml/expression.go @@ -16,6 +16,37 @@ type SourceProvider interface { SourceName() string } +type Tag struct { + name string + node yaml.Node + path []string + local bool +} + +func NewTag(name string, node yaml.Node, path []string) *Tag { + return &Tag{name, node, path, true} +} + +func (t *Tag) Name() string { + return t.name +} + +func (t *Tag) Node() yaml.Node { + return t.node +} + +func (t *Tag) Path() []string { + return t.path +} + +func (t *Tag) Local() bool { + return t.local +} + +func (t *Tag) ResetLocal() { + t.local = false +} + type State interface { GetTempName(data []byte) (string, error) GetFileContent(file string, cached bool) ([]byte, error) @@ -25,6 +56,8 @@ type State interface { FileSystem() vfs.VFS GetFunctions() Registry InterpolationEnabled() bool + SetTag(name string, node yaml.Node, path []string) error + GetTag(name string) *Tag EnableInterpolation() } diff --git a/dynaml/list_test.go b/dynaml/list_test.go index bd8634e..4276284 100644 --- a/dynaml/list_test.go +++ b/dynaml/list_test.go @@ -29,7 +29,7 @@ var _ = Describe("lists", func() { It("fails", func() { expr := ListExpr{ []Expression{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, }, } diff --git a/dynaml/mapping_test.go b/dynaml/mapping_test.go index d547a1e..a576b40 100644 --- a/dynaml/mapping_test.go +++ b/dynaml/mapping_test.go @@ -8,9 +8,9 @@ import ( var _ = Describe("mapping expressions", func() { It("prints mapping expression", func() { desc := MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, ConcatenationExpr{ - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, StringExpr{".*"}, }, MapToListContext, @@ -20,12 +20,12 @@ var _ = Describe("mapping expressions", func() { It("simplifies lambda mapping expression", func() { desc := MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, ConcatenationExpr{ - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, StringExpr{".*"}, }, }, diff --git a/dynaml/marker.go b/dynaml/marker.go index 7b16e44..d53c745 100644 --- a/dynaml/marker.go +++ b/dynaml/marker.go @@ -29,6 +29,15 @@ func (e MarkerExpr) String() string { return fmt.Sprintf("%s", strings.Join(e.list, " ")) } +func (e MarkerExpr) GetTag() string { + for _, m := range e.list { + if strings.HasPrefix(m, "&tag:") { + return m[5:] + } + } + return "" +} + func (e MarkerExpr) GetFlags() yaml.NodeFlags { var flags yaml.NodeFlags for _, m := range e.list { diff --git a/dynaml/parser.go b/dynaml/parser.go index 50cbcdc..e2eefcf 100644 --- a/dynaml/parser.go +++ b/dynaml/parser.go @@ -155,6 +155,7 @@ func buildExpression(grammar *DynamlGrammar, path []string, stubPath []string) ( case ruleDynaml: return tokens.Pop(), nil + case ruleTagMarker: case ruleMarker: tokens.Push(newMarkerExpr(contents)) case ruleSubsequentMarker: @@ -200,13 +201,22 @@ func buildExpression(grammar *DynamlGrammar, path []string, stubPath []string) ( keyName = tokens.Pop().(nameHelper).name case ruleFollowUpRef: case ruleReference: - tokens.Push(ReferenceExpr{PathComponents(contents, true)}) + tag := "" + if i := strings.Index(contents, "::"); i > 0 { + tag = contents[:i] + contents = contents[i+2:] + if contents != "." && strings.HasPrefix(contents, ".") { + contents = contents[1:] + } + } + comps := PathComponents(contents, true) + tokens.Push(NewTaggedReferenceExpr(tag, comps...)) case ruleChained: case ruleChainedQualifiedExpression: case rulePathComponent: case ruleChainedRef: - ref := ReferenceExpr{PathComponents(contents, false)} + ref := NewReferenceExpr(PathComponents(contents, false)...) expr := tokens.Pop() tokens.Push(QualifiedExpr{expr, ref}) case ruleChainedDynRef: @@ -504,6 +514,7 @@ func buildExpression(grammar *DynamlGrammar, path []string, stubPath []string) ( tokens.Push(expressionListHelper{}) case ruleKey, ruleIndex: + case ruleTag, ruleTagName: case ruleLevel0, ruleLevel1, ruleLevel2, ruleLevel3, ruleLevel4, ruleLevel5, ruleLevel6, ruleLevel7: case ruleExpression: case ruleExpressionList: diff --git a/dynaml/parser_test.go b/dynaml/parser_test.go index 0dfc7d5..4ecbc79 100644 --- a/dynaml/parser_test.go +++ b/dynaml/parser_test.go @@ -2,6 +2,7 @@ package dynaml import ( . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" ) @@ -35,6 +36,33 @@ var _ = Describe("parsing", func() { }) }) + Describe("marker", func() { + markers := []string{ + "&template", + "&temporary", + "&state", + "&inject", + "&tag:test", + } + var entries []TableEntry + for _, m := range markers { + entries = append(entries, Entry(m, m)) + } + DescribeTable("simple marker", func(m string) { + parsesAs(m, MarkerExpr{[]string{m}, nil}) + }, + entries...) + + It("parses multiple markers", func() { + parsesAs("&template &temporary", MarkerExpr{[]string{"&template", "&temporary"}, nil}) + }) + + It("parses marked expression", func() { + parsesAs("&template &temporary(5)", MarkerExpr{[]string{"&template", "&temporary"}, + MarkerExpressionExpr{"(5)", GroupedExpr{IntegerExpr{5}}}}) + }) + }) + Describe("merge", func() { It("parses as a merge node with the given path", func() { parsesAs("merge alice.bob", MergeExpr{[]string{"alice", "bob"}, true, false, true, false, ""}, "foo", "bar") @@ -73,7 +101,16 @@ var _ = Describe("parsing", func() { Describe("references", func() { It("parses as a reference node", func() { - parsesAs("foo.bar-baz.fizz_buzz", ReferenceExpr{[]string{"foo", "bar-baz", "fizz_buzz"}}) + parsesAs("foo.bar-baz.fizz_buzz", ReferenceExpr{Path: []string{"foo", "bar-baz", "fizz_buzz"}}) + }) + It("parses dot reference", func() { + parsesAs(".foo.bar-baz.fizz_buzz", ReferenceExpr{Path: []string{"", "foo", "bar-baz", "fizz_buzz"}}) + }) + It("parses tagged reference", func() { + parsesAs("tag::foo.bar-baz.fizz_buzz", ReferenceExpr{Tag: "tag", Path: []string{"foo", "bar-baz", "fizz_buzz"}}) + }) + It("parses tagged dot reference", func() { + parsesAs("tag::.", ReferenceExpr{Tag: "tag", Path: []string{""}}) }) }) @@ -83,7 +120,7 @@ var _ = Describe("parsing", func() { `"foo" bar`, ConcatenationExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -92,7 +129,7 @@ var _ = Describe("parsing", func() { ConcatenationExpr{ ConcatenationExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -106,7 +143,7 @@ var _ = Describe("parsing", func() { `"foo" || bar`, OrExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -115,7 +152,7 @@ var _ = Describe("parsing", func() { OrExpr{ OrExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -129,7 +166,7 @@ var _ = Describe("parsing", func() { `"foo" + bar`, AdditionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -138,7 +175,7 @@ var _ = Describe("parsing", func() { AdditionExpr{ AdditionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -152,7 +189,7 @@ var _ = Describe("parsing", func() { `"foo" - bar`, SubtractionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -161,7 +198,7 @@ var _ = Describe("parsing", func() { SubtractionExpr{ SubtractionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -175,7 +212,7 @@ var _ = Describe("parsing", func() { `"foo" * bar`, MultiplicationExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -184,7 +221,7 @@ var _ = Describe("parsing", func() { MultiplicationExpr{ MultiplicationExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -198,7 +235,7 @@ var _ = Describe("parsing", func() { `"foo" / bar`, DivisionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -207,7 +244,7 @@ var _ = Describe("parsing", func() { DivisionExpr{ DivisionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -221,7 +258,7 @@ var _ = Describe("parsing", func() { `"foo" % bar`, ModuloExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) }) @@ -239,7 +276,7 @@ var _ = Describe("parsing", func() { []Expression{ IntegerExpr{1}, StringExpr{"two"}, - ReferenceExpr{[]string{"three"}}, + ReferenceExpr{Path: []string{"three"}}, }, }, ) @@ -251,7 +288,7 @@ var _ = Describe("parsing", func() { ListExpr{ []Expression{ IntegerExpr{1}, - ListExpansionExpr{ReferenceExpr{[]string{"foo"}}}, + ListExpansionExpr{ReferenceExpr{Path: []string{"foo"}}}, IntegerExpr{2}, }, }, @@ -267,7 +304,7 @@ var _ = Describe("parsing", func() { StringExpr{"two"}, ListExpr{ []Expression{ - ReferenceExpr{[]string{"three"}}, + ReferenceExpr{Path: []string{"three"}}, StringExpr{"four"}, }, }, @@ -282,7 +319,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo()`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, nil, false, }, @@ -293,7 +330,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo(1)`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, []Expression{ IntegerExpr{1}, }, @@ -306,10 +343,10 @@ var _ = Describe("parsing", func() { parsesAs( `foo(1,foo...,2)`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, []Expression{ IntegerExpr{1}, - ListExpansionExpr{ReferenceExpr{[]string{"foo"}}}, + ListExpansionExpr{ReferenceExpr{Path: []string{"foo"}}}, IntegerExpr{2}, }, false, @@ -321,7 +358,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo.bar(1)`, CallExpr{ - ReferenceExpr{[]string{"foo", "bar"}}, + ReferenceExpr{Path: []string{"foo", "bar"}}, []Expression{ IntegerExpr{1}, }, @@ -334,7 +371,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo.bar(a=1)`, CallExpr{ - ReferenceExpr{[]string{"foo", "bar"}}, + ReferenceExpr{Path: []string{"foo", "bar"}}, []Expression{ NameArgument{"a", IntegerExpr{1}}, }, @@ -347,7 +384,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo.bar(a=1, b=2)`, CallExpr{ - ReferenceExpr{[]string{"foo", "bar"}}, + ReferenceExpr{Path: []string{"foo", "bar"}}, []Expression{ NameArgument{"a", IntegerExpr{1}}, NameArgument{"b", IntegerExpr{2}}, @@ -361,7 +398,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo.bar(a=1, 2)`, CallExpr{ - ReferenceExpr{[]string{"foo", "bar"}}, + ReferenceExpr{Path: []string{"foo", "bar"}}, []Expression{ NameArgument{"a", IntegerExpr{1}}, IntegerExpr{2}, @@ -375,7 +412,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo.bar(a=1, b=2, 3, 4)`, CallExpr{ - ReferenceExpr{[]string{"foo", "bar"}}, + ReferenceExpr{Path: []string{"foo", "bar"}}, []Expression{ NameArgument{"a", IntegerExpr{1}}, NameArgument{"b", IntegerExpr{2}}, @@ -391,7 +428,7 @@ var _ = Describe("parsing", func() { parsesAs( `(foo)(1)`, CallExpr{ - GroupedExpr{ReferenceExpr{[]string{"foo"}}}, + GroupedExpr{ReferenceExpr{Path: []string{"foo"}}}, []Expression{ IntegerExpr{1}, }, @@ -404,11 +441,11 @@ var _ = Describe("parsing", func() { parsesAs( `foo(1, "two", three)`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, []Expression{ IntegerExpr{1}, StringExpr{"two"}, - ReferenceExpr{[]string{"three"}}, + ReferenceExpr{Path: []string{"three"}}, }, false, }, @@ -419,13 +456,13 @@ var _ = Describe("parsing", func() { parsesAs( `foo(1, [ "two", three ])`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, []Expression{ IntegerExpr{1}, ListExpr{ []Expression{ StringExpr{"two"}, - ReferenceExpr{[]string{"three"}}, + ReferenceExpr{Path: []string{"three"}}, }, }, }, @@ -438,14 +475,14 @@ var _ = Describe("parsing", func() { parsesAs( `foo(1, bar( "two", three ))`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, []Expression{ IntegerExpr{1}, CallExpr{ - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, []Expression{ StringExpr{"two"}, - ReferenceExpr{[]string{"three"}}, + ReferenceExpr{Path: []string{"three"}}, }, false, }, @@ -461,7 +498,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo*()`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, nil, true, }, @@ -471,9 +508,9 @@ var _ = Describe("parsing", func() { parsesAs( `foo*(a)`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, []Expression{ - ReferenceExpr{[]string{"a"}}, + ReferenceExpr{Path: []string{"a"}}, }, true, }, @@ -488,7 +525,7 @@ var _ = Describe("parsing", func() { SubtractionExpr{ GroupedExpr{SubtractionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }}, MergeExpr{}, }, @@ -501,11 +538,11 @@ var _ = Describe("parsing", func() { parsesAs( `map[list|x|->x]`, MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, MapToListContext, }, @@ -517,11 +554,11 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|x|->x]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, + A: ReferenceExpr{Path: []string{"data"}}, Cond: LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, Value: DefaultExpr{}, Timeout: DefaultExpr{}, @@ -532,16 +569,16 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|x|->x,y]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, + A: ReferenceExpr{Path: []string{"data"}}, Cond: LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, Value: LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"y"}}, + ReferenceExpr{Path: []string{"y"}}, }, Timeout: DefaultExpr{}, }, @@ -551,16 +588,16 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|x|->x,y|10]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, + A: ReferenceExpr{Path: []string{"data"}}, Cond: LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, Value: LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"y"}}, + ReferenceExpr{Path: []string{"y"}}, }, Timeout: IntegerExpr{10}, }, @@ -570,16 +607,16 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|x|->x|y|->y|10]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, + A: ReferenceExpr{Path: []string{"data"}}, Cond: LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, Value: LambdaExpr{ []Parameter{Parameter{Name: "y"}}, false, - ReferenceExpr{[]string{"y"}}, + ReferenceExpr{Path: []string{"y"}}, }, Timeout: IntegerExpr{10}, }, @@ -590,13 +627,13 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|x|->x|value]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, + A: ReferenceExpr{Path: []string{"data"}}, Cond: LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, - Value: ReferenceExpr{[]string{"value"}}, + Value: ReferenceExpr{Path: []string{"value"}}, Timeout: DefaultExpr{}, }, ) @@ -606,8 +643,8 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|cond]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, - Cond: ReferenceExpr{[]string{"cond"}}, + A: ReferenceExpr{Path: []string{"data"}}, + Cond: ReferenceExpr{Path: []string{"cond"}}, Value: DefaultExpr{}, Timeout: DefaultExpr{}, }, @@ -618,9 +655,9 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|cond|value]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, - Cond: ReferenceExpr{[]string{"cond"}}, - Value: ReferenceExpr{[]string{"value"}}, + A: ReferenceExpr{Path: []string{"data"}}, + Cond: ReferenceExpr{Path: []string{"cond"}}, + Value: ReferenceExpr{Path: []string{"value"}}, Timeout: DefaultExpr{}, }, ) @@ -630,12 +667,12 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|cond|v|->v]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, - Cond: ReferenceExpr{[]string{"cond"}}, + A: ReferenceExpr{Path: []string{"data"}}, + Cond: ReferenceExpr{Path: []string{"cond"}}, Value: LambdaExpr{ []Parameter{Parameter{Name: "v"}}, false, - ReferenceExpr{[]string{"v"}}, + ReferenceExpr{Path: []string{"v"}}, }, Timeout: DefaultExpr{}, }, @@ -646,9 +683,9 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|cond|value|10]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, - Cond: ReferenceExpr{[]string{"cond"}}, - Value: ReferenceExpr{[]string{"value"}}, + A: ReferenceExpr{Path: []string{"data"}}, + Cond: ReferenceExpr{Path: []string{"cond"}}, + Value: ReferenceExpr{Path: []string{"value"}}, Timeout: IntegerExpr{10}, }, ) @@ -658,12 +695,12 @@ var _ = Describe("parsing", func() { parsesAs( `sync[data|cond|v|->v|10]`, SyncExpr{ - A: ReferenceExpr{[]string{"data"}}, - Cond: ReferenceExpr{[]string{"cond"}}, + A: ReferenceExpr{Path: []string{"data"}}, + Cond: ReferenceExpr{Path: []string{"cond"}}, Value: LambdaExpr{ []Parameter{Parameter{Name: "v"}}, false, - ReferenceExpr{[]string{"v"}}, + ReferenceExpr{Path: []string{"v"}}, }, Timeout: IntegerExpr{10}, }, @@ -676,11 +713,11 @@ var _ = Describe("parsing", func() { parsesAs( `map[list|x,y|->x]`, MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, LambdaExpr{ []Parameter{Parameter{Name: "x"}, Parameter{Name: "y"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, MapToListContext, }, @@ -691,12 +728,12 @@ var _ = Describe("parsing", func() { parsesAs( `map[list|x|->x ".*"]`, MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, ConcatenationExpr{ - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, StringExpr{".*"}, }, }, @@ -709,9 +746,9 @@ var _ = Describe("parsing", func() { parsesAs( `map[list|mappings.a]`, MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, ReferenceExpr{ - []string{"mappings", "a"}, + Path: []string{"mappings", "a"}, }, MapToListContext, }, @@ -722,12 +759,12 @@ var _ = Describe("parsing", func() { parsesAs( `map[list|lambda |x|->x ".*"]`, MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, ConcatenationExpr{ - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, StringExpr{".*"}, }, }, @@ -740,11 +777,11 @@ var _ = Describe("parsing", func() { parsesAs( `map{list|x|->x}`, MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, MapToMapContext, }, @@ -755,11 +792,11 @@ var _ = Describe("parsing", func() { parsesAs( `select[list|x|->x]`, MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, SelectToListContext, }, @@ -769,11 +806,11 @@ var _ = Describe("parsing", func() { parsesAs( `select{list|x|->x}`, MappingExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, SelectToMapContext, }, @@ -789,7 +826,7 @@ var _ = Describe("parsing", func() { CreateMapExpr{ nil, }, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -806,7 +843,7 @@ var _ = Describe("parsing", func() { }, }, }, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -827,7 +864,7 @@ var _ = Describe("parsing", func() { }, }, }, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -840,7 +877,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ nil, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -851,7 +888,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -863,8 +900,8 @@ var _ = Describe("parsing", func() { []Parameter{Parameter{Name: "x"}, Parameter{Name: "y"}}, false, DivisionExpr{ - ReferenceExpr{[]string{"x"}}, - ReferenceExpr{[]string{"y"}}, + ReferenceExpr{Path: []string{"x"}}, + ReferenceExpr{Path: []string{"y"}}, }, }, ) @@ -876,7 +913,7 @@ var _ = Describe("parsing", func() { LambdaRefExpr{ Source: ConcatenationExpr{ StringExpr{"|x|->x+"}, - ReferenceExpr{[]string{"ref"}}, + ReferenceExpr{Path: []string{"ref"}}, }, Path: []string{"foo", "bar"}, StubPath: []string{"foo", "bar"}, @@ -891,7 +928,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ []Parameter{Parameter{Name: "x"}}, true, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -901,7 +938,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ []Parameter{Parameter{Name: "a"}, Parameter{Name: "x"}}, true, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -912,7 +949,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ []Parameter{Parameter{Name: "a", Default: IntegerExpr{5}}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -926,7 +963,7 @@ var _ = Describe("parsing", func() { Parameter{Name: "x", Default: IntegerExpr{6}}, }, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -940,7 +977,7 @@ var _ = Describe("parsing", func() { Parameter{Name: "x", Default: IntegerExpr{6}}, }, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -956,7 +993,7 @@ var _ = Describe("parsing", func() { Parameter{Name: "y", Default: IntegerExpr{7}}, }, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -968,10 +1005,10 @@ var _ = Describe("parsing", func() { `foo.[alice].bar`, QualifiedExpr{ DynamicExpr{ - ReferenceExpr{[]string{"foo"}}, - ReferenceExpr{[]string{"alice"}}, + ReferenceExpr{Path: []string{"foo"}}, + ReferenceExpr{Path: []string{"alice"}}, }, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) }) @@ -980,7 +1017,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo.[ 0 ]`, DynamicExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, IntegerExpr{0}, }, ) @@ -989,7 +1026,7 @@ var _ = Describe("parsing", func() { It("parses regular reference expression", func() { parsesAs( `foo.[0]`, - ReferenceExpr{[]string{"foo", "[0]"}}, + ReferenceExpr{Path: []string{"foo", "[0]"}}, ) }) @@ -998,11 +1035,11 @@ var _ = Describe("parsing", func() { parsesAs( `foo.[0].[*].bar`, ProjectionExpr{ - ReferenceExpr{[]string{"foo", "[0]"}}, + ReferenceExpr{Path: []string{"foo", "[0]"}}, &val, QualifiedExpr{ ProjectionValueExpr{&val}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, }, ) @@ -1020,7 +1057,7 @@ var _ = Describe("parsing", func() { QualifiedExpr{ CallExpr{ CallExpr{ - ReferenceExpr{[]string{"a", "b"}}, + ReferenceExpr{Path: []string{"a", "b"}}, []Expression{ IntegerExpr{1}, }, @@ -1031,21 +1068,21 @@ var _ = Describe("parsing", func() { }, false, }, - ReferenceExpr{[]string{"c"}}, + ReferenceExpr{Path: []string{"c"}}, }, []Expression{ IntegerExpr{3}, }, false, }, - ReferenceExpr{[]string{"e", "f"}}, + ReferenceExpr{Path: []string{"e", "f"}}, }, []Expression{ IntegerExpr{4}, }, false, }, - ReferenceExpr{[]string{"g"}}, + ReferenceExpr{Path: []string{"g"}}, }, ) }) @@ -1054,13 +1091,13 @@ var _ = Describe("parsing", func() { `a(1).b`, QualifiedExpr{ CallExpr{ - ReferenceExpr{[]string{"a"}}, + ReferenceExpr{Path: []string{"a"}}, []Expression{ IntegerExpr{1}, }, false, }, - ReferenceExpr{[]string{"b"}}, + ReferenceExpr{Path: []string{"b"}}, }, ) }) @@ -1082,7 +1119,7 @@ var _ = Describe("parsing", func() { IntegerExpr{2}, }, }, - ReferenceExpr{[]string{"a"}}, + ReferenceExpr{Path: []string{"a"}}, }, []Expression{ IntegerExpr{1}, @@ -1094,21 +1131,21 @@ var _ = Describe("parsing", func() { }, false, }, - ReferenceExpr{[]string{"c"}}, + ReferenceExpr{Path: []string{"c"}}, }, []Expression{ IntegerExpr{3}, }, false, }, - ReferenceExpr{[]string{"e", "f"}}, + ReferenceExpr{Path: []string{"e", "f"}}, }, []Expression{ IntegerExpr{4}, }, false, }, - ReferenceExpr{[]string{"g"}}, + ReferenceExpr{Path: []string{"g"}}, }, ) }) @@ -1120,10 +1157,10 @@ var _ = Describe("parsing", func() { `foo[alice].bar`, QualifiedExpr{ DynamicExpr{ - ReferenceExpr{[]string{"foo"}}, - ReferenceExpr{[]string{"alice"}}, + ReferenceExpr{Path: []string{"foo"}}, + ReferenceExpr{Path: []string{"alice"}}, }, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) }) @@ -1132,7 +1169,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo[ 0 ]`, DynamicExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, IntegerExpr{0}, }, ) @@ -1141,14 +1178,14 @@ var _ = Describe("parsing", func() { It("parses regular reference expression", func() { parsesAs( `foo[0]`, - ReferenceExpr{[]string{"foo", "[0]"}}, + ReferenceExpr{Path: []string{"foo", "[0]"}}, ) }) It("parses multi level index", func() { parsesAs( `foo[0][1]`, - ReferenceExpr{[]string{"foo", "[0]", "[1]"}}, + ReferenceExpr{Path: []string{"foo", "[0]", "[1]"}}, ) }) @@ -1159,7 +1196,7 @@ var _ = Describe("parsing", func() { QualifiedExpr{ CallExpr{ ReferenceExpr{ - []string{"foo"}, + Path: []string{"foo"}, }, []Expression{ IntegerExpr{0}, @@ -1167,7 +1204,7 @@ var _ = Describe("parsing", func() { false, }, ReferenceExpr{ - []string{"[1]"}, + Path: []string{"[1]"}, }, }, []Expression{ @@ -1183,11 +1220,11 @@ var _ = Describe("parsing", func() { parsesAs( `foo[0][*].bar`, ProjectionExpr{ - ReferenceExpr{[]string{"foo", "[0]"}}, + ReferenceExpr{Path: []string{"foo", "[0]"}}, &val, QualifiedExpr{ ProjectionValueExpr{&val}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, }, ) diff --git a/dynaml/qualified_expression.go b/dynaml/qualified_expression.go index 168d552..e6e7e73 100644 --- a/dynaml/qualified_expression.go +++ b/dynaml/qualified_expression.go @@ -35,7 +35,7 @@ func (e QualifiedExpr) Evaluate(binding Binding, locally bool) (interface{}, Eva debug.Debug("qualified reference (%t): %v\n", locally, e.Reference.Path) return e.Reference.find(func(end int, path []string) (yaml.Node, bool) { - return yaml.Find(NewNode(root, nil), e.Reference.Path[0:end+1]...) + return yaml.Find(NewNode(root, nil), path[:end+1]...) }, binding, locally) } diff --git a/dynaml/reference.go b/dynaml/reference.go index 9dd7910..a07d618 100644 --- a/dynaml/reference.go +++ b/dynaml/reference.go @@ -8,24 +8,51 @@ import ( ) type ReferenceExpr struct { + Tag string Path []string } +func NewReferenceExpr(path ...string) ReferenceExpr { + return ReferenceExpr{"", path} +} + +func NewTaggedReferenceExpr(tag string, path ...string) ReferenceExpr { + return ReferenceExpr{tag, path} +} + func (e ReferenceExpr) Evaluate(binding Binding, locally bool) (interface{}, EvaluationInfo, bool) { + var tag *Tag fromRoot := e.Path[0] == "" - debug.Debug("reference: %v\n", e.Path) + debug.Debug("reference: (%s)%v\n", e.Tag, e.Path) + if e.Tag != "" { + tag = binding.GetState().GetTag(e.Tag) + info := DefaultInfo() + if tag == nil { + return info.Error("tag '%s' not found", e.Tag) + } + if len(e.Path) == 1 && e.Path[0] == "" { + return tag.Node().Value(), info, true + } + } return e.find(func(end int, path []string) (yaml.Node, bool) { if fromRoot { return binding.FindFromRoot(path[1 : end+1]) } else { + if tag != nil { + return yaml.Find(tag.Node(), path...) + } return binding.FindReference(path[:end+1]) } }, binding, locally) } func (e ReferenceExpr) String() string { - return strings.Join(e.Path, ".") + tag := "" + if e.Tag != "" { + tag = e.Tag + "::" + } + return tag + strings.Join(e.Path, ".") } func (e ReferenceExpr) find(f func(int, []string) (node yaml.Node, x bool), binding Binding, locally bool) (interface{}, EvaluationInfo, bool) { diff --git a/dynaml/reference_test.go b/dynaml/reference_test.go index bc3f135..563b92f 100644 --- a/dynaml/reference_test.go +++ b/dynaml/reference_test.go @@ -10,7 +10,7 @@ import ( var _ = Describe("references", func() { Context("when the reference is found", func() { It("evaluates to the referenced node", func() { - expr := ReferenceExpr{[]string{"foo", "bar"}} + expr := ReferenceExpr{Path: []string{"foo", "bar"}} binding := FakeBinding{ FoundReferences: map[string]yaml.Node{ @@ -24,7 +24,7 @@ var _ = Describe("references", func() { Context("and it refers to another expression", func() { It("returns itself so the referred node can evaluate first", func() { - expr := ReferenceExpr{[]string{"foo", "bar"}} + expr := ReferenceExpr{Path: []string{"foo", "bar"}} binding := FakeBinding{ FoundReferences: map[string]yaml.Node{ @@ -39,7 +39,7 @@ var _ = Describe("references", func() { Context("when the reference is NOT found", func() { It("fails", func() { - expr := ReferenceExpr{[]string{"foo", "bar", "baz"}} + expr := ReferenceExpr{Path: []string{"foo", "bar", "baz"}} binding := FakeBinding{} diff --git a/dynaml/static_ips.go b/dynaml/static_ips.go index 67aafd7..3422154 100644 --- a/dynaml/static_ips.go +++ b/dynaml/static_ips.go @@ -8,8 +8,8 @@ import ( ) var ( - refName = ReferenceExpr{[]string{"name"}} - refInstances = ReferenceExpr{[]string{"instances"}} + refName = NewReferenceExpr("name") + refInstances = NewReferenceExpr("instances") ) func func_static_ips(arguments []Expression, binding Binding) (interface{}, EvaluationInfo, bool) { @@ -120,7 +120,7 @@ func findStaticIPRanges(binding Binding) ([]string, EvaluationInfo, bool) { return nil, info, false } - subnetsRef := ReferenceExpr{[]string{"", "networks", networkName, "subnets"}} + subnetsRef := ReferenceExpr{"", []string{"", "networks", networkName, "subnets"}} subnets, info, found := subnetsRef.Evaluate(binding, false) if !found { diff --git a/dynaml/sum_test.go b/dynaml/sum_test.go index 1cfe365..59eaf43 100644 --- a/dynaml/sum_test.go +++ b/dynaml/sum_test.go @@ -8,10 +8,10 @@ import ( var _ = Describe("sum expressions", func() { It("prints sum expression", func() { desc := SumExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, IntegerExpr{0}, ConcatenationExpr{ - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, StringExpr{".*"}, }, }.String() @@ -20,13 +20,13 @@ var _ = Describe("sum expressions", func() { It("simplifies lambda sum expression", func() { desc := SumExpr{ - ReferenceExpr{[]string{"list"}}, + ReferenceExpr{Path: []string{"list"}}, IntegerExpr{0}, LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, ConcatenationExpr{ - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, StringExpr{".*"}, }, }, diff --git a/dynaml/unresolved_check.go b/dynaml/unresolved_check.go index 0e32233..ee97a91 100644 --- a/dynaml/unresolved_check.go +++ b/dynaml/unresolved_check.go @@ -144,6 +144,7 @@ func FindUnresolvedNodes(root yaml.Node, context ...string) (result []Unresolved var nodes []UnresolvedNode dummy := []string{"dummy"} + found := false switch val := root.Value().(type) { case map[string]yaml.Node: @@ -178,6 +179,7 @@ func FindUnresolvedNodes(root yaml.Node, context ...string) (result []Unresolved Context: context, Path: path, }) + found = true case TemplateValue: // context := addContext(context, fmt.Sprintf("&")) @@ -196,16 +198,19 @@ func FindUnresolvedNodes(root yaml.Node, context ...string) (result []Unresolved Context: context, Path: []string{}, }) + found = true } } } if root.Failed() { - nodes = append(nodes, UnresolvedNode{ - Node: root, - Context: context, - Path: []string{}, - }) + if !found { + nodes = append(nodes, UnresolvedNode{ + Node: root, + Context: context, + Path: []string{}, + }) + } } for _, n := range nodes { @@ -285,6 +290,16 @@ func isLocallyResolvedValue(value interface{}) bool { return true } +func IsResolvedNode(node yaml.Node) bool { + if node == nil { + return false + } + if node.Failed() || node.Undefined() { + return false + } + return isResolvedValue(node.Value()) +} + func isResolved(node yaml.Node) bool { return node == nil || isResolvedValue(node.Value()) } diff --git a/dynaml/validor_test.go b/dynaml/validor_test.go index 06eead6..59c4563 100644 --- a/dynaml/validor_test.go +++ b/dynaml/validor_test.go @@ -74,7 +74,7 @@ var _ = Describe("or", func() { Context("when the left side evaluates to itself (i.e. reference)", func() { It("fails assuming the left hand side cannot be determined yet", func() { expr := ValidOrExpr{ - ReferenceExpr{[]string{"foo", "bar"}}, + ReferenceExpr{Path: []string{"foo", "bar"}}, NilExpr{}, } diff --git a/flow/cascade.go b/flow/cascade.go index af16272..6f449dc 100644 --- a/flow/cascade.go +++ b/flow/cascade.go @@ -23,6 +23,7 @@ func PrepareStubs(outer dynaml.Binding, partial bool, stubs ...yaml.Node) ([]yam } stubs[i] = Cleanup(flowed, discardLocal) + ResetTags(outer) } return stubs, nil } diff --git a/flow/environment.go b/flow/environment.go index 3fea075..a28123b 100644 --- a/flow/environment.go +++ b/flow/environment.go @@ -320,6 +320,20 @@ func CleanupEnvironment(binding dynaml.Binding) { } } +func ResetTags(binding dynaml.Binding) { + env, ok := binding.(DefaultEnvironment) + if ok && env.state != nil { + env.state.ResetTags() + } +} + +func ResetLocalTags(binding dynaml.Binding) { + env, ok := binding.(DefaultEnvironment) + if ok && env.state != nil { + env.state.ResetLocal() + } +} + func NewNestedEnvironment(stubs []yaml.Node, source string, outer dynaml.Binding) dynaml.Binding { var state *State if outer == nil { diff --git a/flow/flow.go b/flow/flow.go index d520d7f..84d0710 100644 --- a/flow/flow.go +++ b/flow/flow.go @@ -33,6 +33,24 @@ func get_inherited_flags(env dynaml.Binding) (yaml.NodeFlags, yaml.Node) { } func flow(root yaml.Node, env dynaml.Binding, shouldOverride bool) yaml.Node { + node := _flow(root, env, shouldOverride) + tag := node.GetAnnotation().Tag() + if tag != "" { + debug.Debug("found tag %q at %v\n", tag, env.Path()) + } + if dynaml.IsResolvedNode(node) && tag != "" { + err := env.GetState().SetTag(tag, node, env.Path()) + if err != nil { + if node.Value() == nil { + node = yaml.ReplaceValue(root.Value(), node) + } + node = yaml.IssueNode(node, true, true, yaml.NewIssue("%s", err)) + } + } + return node +} + +func _flow(root yaml.Node, env dynaml.Binding, shouldOverride bool) yaml.Node { if root == nil { return root } @@ -73,6 +91,11 @@ func flow(root yaml.Node, env dynaml.Binding, shouldOverride bool) yaml.Node { info := dynaml.DefaultInfo() var eval interface{} = nil m, ok := val.(dynaml.MarkerExpr) + if ok { + if tag := m.GetTag(); tag != "" && root.GetAnnotation().Tag() == "" { + root = yaml.SetTag(root, tag) + } + } if ok && m.Has(dynaml.TEMPLATE) { debug.Debug("found template declaration\n") val := m.TemplateExpression(root) @@ -109,6 +132,7 @@ func flow(root yaml.Node, env dynaml.Binding, shouldOverride bool) yaml.Node { if info.SourceName() != "" { source = info.SourceName() } + tag := root.GetAnnotation().Tag() result := yaml.NewNode(eval, source) _, ok = eval.(string) if ok { @@ -152,9 +176,8 @@ func flow(root yaml.Node, env dynaml.Binding, shouldOverride bool) yaml.Node { result = yaml.MergedNode(result) } } - if (flags | result.Flags()) != result.Flags() { - result = yaml.AddFlags(result, flags) - } + + result = updateNode(result, flags, tag) if expr || result.Merged() || !shouldOverride || result.Preferred() { debug.Debug(" prefer expression over override") debug.Debug("??? ---> %+v\n", result) @@ -221,6 +244,7 @@ func simpleMergeCompatibilityCheck(initial bool, node yaml.Node) bool { func flowMap(root yaml.Node, env dynaml.Binding) yaml.Node { var err error flags, stub := get_inherited_flags(env) + tag := root.GetAnnotation().Tag() processed := true template := false merged := false @@ -251,7 +275,7 @@ func flowMap(root yaml.Node, env dynaml.Binding) yaml.Node { mergefound = true debug.Debug("handle map merge %#v\n", val) _, initial := val.Value().(string) - base := flow(val, env, false) + base := _flow(val, env, false) if base.Undefined() { return yaml.UndefinedNode(root) } @@ -261,6 +285,10 @@ func flowMap(root yaml.Node, env dynaml.Binding) yaml.Node { m, ok := base.Value().(dynaml.MarkerExpr) if ok { debug.Debug("found marker\n") + if t := m.GetTag(); t != "" { + debug.Debug("found tag %q\n", t) + tag = t + } flags |= m.GetFlags() if flags.Temporary() { debug.Debug("found temporary declaration\n") @@ -377,18 +405,14 @@ func flowMap(root yaml.Node, env dynaml.Binding) yaml.Node { node = yaml.IssueNode(node, true, true, issue) } } - if (flags | node.Flags()) != node.Flags() { - node = yaml.AddFlags(node, flags) - } - - return node + return updateNode(node, flags, tag) } func flowList(root yaml.Node, env dynaml.Binding) yaml.Node { rootList := root.Value().([]yaml.Node) debug.Debug("HANDLE LIST %v\n", env.Path()) - merged, process, replaced, redirectPath, keyName, ismerged, flags, stub := processMerges(root, rootList, env) + merged, process, replaced, redirectPath, keyName, ismerged, flags, tag, stub := processMerges(root, rootList, env) if process { debug.Debug("process list (key: %s) %v\n", keyName, env.Path()) @@ -444,6 +468,9 @@ func flowList(root yaml.Node, env dynaml.Binding) yaml.Node { if (flags | root.Flags()) != root.Flags() { return yaml.AddFlags(root, flags) } + if tag != "" && tag != root.GetAnnotation().Tag() { + root = yaml.SetTag(root, tag) + } return root } @@ -494,10 +521,11 @@ func stepName(index int, value yaml.Node, keyName string, env dynaml.Binding) (s return step, true } -func processMerges(orig yaml.Node, root []yaml.Node, env dynaml.Binding) (interface{}, bool, bool, []string, string, bool, yaml.NodeFlags, yaml.Node) { +func processMerges(orig yaml.Node, root []yaml.Node, env dynaml.Binding) (interface{}, bool, bool, []string, string, bool, yaml.NodeFlags, string, yaml.Node) { var flags yaml.NodeFlags var stub yaml.Node flags, stub = get_inherited_flags(env) + tag := orig.GetAnnotation().Tag() spliced := []yaml.Node{} process := true template := false @@ -515,7 +543,7 @@ func processMerges(orig yaml.Node, root []yaml.Node, env dynaml.Binding) (interf if ok { debug.Debug("*** %+v\n", inlineNode.Value()) _, initial := inlineNode.Value().(string) - result := flow(inlineNode, env, false) + result := _flow(inlineNode, env, false) if result.KeyName() != "" { keyName = result.KeyName() } @@ -528,6 +556,9 @@ func processMerges(orig yaml.Node, root []yaml.Node, env dynaml.Binding) (interf m, ok := result.Value().(dynaml.MarkerExpr) if ok { flags |= m.GetFlags() + if t := m.GetTag(); t != "" { + tag = t + } if ok && m.Has(dynaml.TEMPLATE) { debug.Debug("found template declaration\n") template = true @@ -587,7 +618,7 @@ func processMerges(orig yaml.Node, root []yaml.Node, env dynaml.Binding) (interf } debug.Debug("--> %+v proc=%v replaced=%v redirect=%v key=%s\n", result, process, replaced, redirectPath, keyName) - return result, process, replaced, redirectPath, keyName, merged, flags, stub + return result, process, replaced, redirectPath, keyName, merged, flags, tag, stub } func ProcessKeyTag(val yaml.Node) (yaml.Node, string) { @@ -654,3 +685,13 @@ func getSortedKeys(unsortedMap map[string]yaml.Node) []string { sort.Strings(keys) return keys } + +func updateNode(node yaml.Node, flags yaml.NodeFlags, tag string) yaml.Node { + if (flags | node.Flags()) != node.Flags() { + node = yaml.AddFlags(node, flags) + } + if tag != "" && tag != node.GetAnnotation().Tag() { + node = yaml.SetTag(node, tag) + } + return node +} diff --git a/flow/flow_tag_test.go b/flow/flow_tag_test.go new file mode 100644 index 0000000..195aa0c --- /dev/null +++ b/flow/flow_tag_test.go @@ -0,0 +1,97 @@ +package flow + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +var _ = Describe("Tags", func() { + + Context("Regular", func() { + It("handles tag field", func() { + source := parseYAML(` +--- +data: + nested: + v: (( tag::c )) + a: + b: + <<: (( &tag:tag )) + c: (( "value" )) +`) + resolved := parseYAML(` +--- +data: + a: + b: + c: value + nested: + v: value + +`) + Expect(source).To(FlowAs(resolved)) + }) + It("handles tag", func() { + source := parseYAML(` +--- +data: + nested: + v: (( tag::. )) + a: + b: + <<: (( &tag:tag )) + c: (( "value" )) +`) + resolved := parseYAML(` +--- +data: + a: + b: + c: value + nested: + v: + c: value + +`) + Expect(source).To(FlowAs(resolved)) + }) + }) + + Context("Failure", func() { + It("unknown tags", func() { + source := parseYAML(` +--- +data: + nested: + v: (( catch( tag::c ) )) + a: + b: + c: (( "value" )) +`) + resolved := parseYAML(` +--- +data: + a: + b: + c: value + nested: + v: + error: tag 'tag' not found + valid: false +`) + Expect(source).To(FlowAs(resolved)) + }) + + It("reports duplicate tags", func() { + source := parseYAML(` +--- +data: + a: (( &tag:tag )) + b: (( &tag:tag )) +`) + Expect(source).To(FlowToErr( + ` (( &tag:tag )) in test data.b () *duplicate tag "tag": data.b <-> data.a`, + )) + }) + }) +}) diff --git a/flow/state.go b/flow/state.go index e1e4cfd..f18967a 100644 --- a/flow/state.go +++ b/flow/state.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "net/http" "path" + "reflect" "strings" "github.com/mandelsoft/vfs/pkg/osfs" @@ -15,6 +16,7 @@ import ( "github.com/mandelsoft/spiff/debug" "github.com/mandelsoft/spiff/dynaml" "github.com/mandelsoft/spiff/features" + "github.com/mandelsoft/spiff/yaml" ) const MODE_FILE_ACCESS = 1 // support file system access @@ -28,6 +30,7 @@ type State struct { fileSystem vfs.VFS // virtual filesystem to use for filesystem based operations functions dynaml.Registry interpolation bool + tags map[string]*dynaml.Tag } var _ dynaml.State = &State{} @@ -43,6 +46,7 @@ func NewState(key string, mode int, optfs ...vfs.FileSystem) *State { mode = mode & ^MODE_OS_ACCESS } return &State{ + tags: map[string]*dynaml.Tag{}, files: map[string]string{}, fileCache: map[string][]byte{}, key: key, @@ -112,7 +116,37 @@ func (s *State) GetTempName(data []byte) (string, error) { return name, nil } +func (s *State) SetTag(name string, node yaml.Node, path []string) error { + debug.Debug("setting tag: %v\n", path) + old := s.tags[name] + if old != nil { + if !old.Local() { + return fmt.Errorf("duplicate tag %q: %s in foreign document", name, strings.Join(path, ".")) + } + if !reflect.DeepEqual(path, old.Path()) { + return fmt.Errorf("duplicate tag %q: %s <-> %s", name, strings.Join(path, "."), strings.Join(old.Path(), ".")) + } + } + s.tags[name] = dynaml.NewTag(name, node, path) + return nil +} + +func (s *State) GetTag(name string) *dynaml.Tag { + return s.tags[name] +} + +func (s *State) ResetTags() { + s.tags = map[string]*dynaml.Tag{} +} + +func (s *State) ResetLocal() { + for _, t := range s.tags { + t.ResetLocal() + } +} + func (s *State) Cleanup() { + s.ResetLocal() for _, n := range s.files { s.fileSystem.Remove(n) } diff --git a/go.sum b/go.sum index cc2edaa..d2b5155 100644 --- a/go.sum +++ b/go.sum @@ -4,60 +4,100 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3 h1:AVXDdKsrtX33oR9fbCMu/+c1o8Ofjq6Ku/MInaLVg5Y= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1 h1:hL+ycaJpVE9M7nLoiXb/Pn10ENE2u+oddxbD8uu0ZVU= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0 h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0 h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1 h1:W9tAK3E57P75u0XLLR82LZyw8VpAnhmyTOxW9qzmyj8= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0 h1:VV2nUM3wwLLGh9lSABFgZMjInyUbJeaRSE64WuAIQ+4= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/b4b4r07/go-pipe v0.0.0-20191010045404-84b446f57366 h1:FVAkDbBxovi2ID0vaxY7vCGvdKASt9r0TGPM1u4YQyg= github.com/b4b4r07/go-pipe v0.0.0-20191010045404-84b446f57366/go.mod h1:1ymsiQNa3qebVEEVtuIdhtAXRfjO4qFCFq1bBUOT2HE= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudfoundry-incubator/candiedyaml v0.0.0-20170901234223-a41693b7b7af h1:6Cpkahw28+gcBdnXQL7LcMTX488+6jl6hfoTMRT6Hm4= github.com/cloudfoundry-incubator/candiedyaml v0.0.0-20170901234223-a41693b7b7af/go.mod h1:dOLSIXcRQJiDS1vlrYFNJicoHNZLsBKideE+70hGdV4= +github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -70,62 +110,101 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f h1:Jnx61latede7zDD3DiiP4gmNz33uK0U5HDUaF0a/HVQ= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1 h1:LnuDWGNsoajlhGyHJvuWW6FVqRl8JOTPqS6CPTsYjhY= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/joncalhoun/pipe v0.0.0-20170510025636-72505674a733 h1:/wtaMDeVpoAUkqZl/GT3lvM9nDBmRApu/Uvl7EUc9Ao= github.com/joncalhoun/pipe v0.0.0-20170510025636-72505674a733/go.mod h1:2MNFZhLx2HMHTN4xKH6FhpoQWqmD8Ato8QOE2hp5hY4= +github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0 h1:ZqfnKyx9KGpRcW04j5nnPDgRgoXUeLh2YFBeFzphcA0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -137,25 +216,38 @@ github.com/mandelsoft/filepath v0.0.0-20200909114706-3df73d378d55 h1:mFdiUG86O2i github.com/mandelsoft/filepath v0.0.0-20200909114706-3df73d378d55/go.mod h1:n4xEiUD2HNHnn2w5ZKF0qgjDecHVCWAl5DxZ7+pcFU8= github.com/mandelsoft/vfs v0.0.0-20201002080026-d03d33d5889a h1:j7Hu1c0F1HyevcYWh3TdCJrHHpFSbRhbaOh71JCqbFM= github.com/mandelsoft/vfs v0.0.0-20201002080026-d03d33d5889a/go.mod h1:74aV7kulg9C434HiI3zNALN79QHc9IZMN+SI4UdLn14= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -166,12 +258,15 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1 h1:VasscCm72135zRysgrJDKsntdmPN+OuU3+nnHYA9wyc= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -181,28 +276,43 @@ github.com/pointlander/jetset v1.0.0 h1:bNlaNAX7cDPID9SlcogmXlDWq0KcRJSpKwHXaAM3 github.com/pointlander/jetset v1.0.0/go.mod h1:zY6+WHRPB10uzTajloHtybSicLW1bf6Rz0eSaU9Deng= github.com/pointlander/peg v0.0.0-20160608205303-1d0268dfff9b h1:R5e+/H/+1WqgiqPVk+zSHPQNan9p8p9hr6C+pEdzk8s= github.com/pointlander/peg v0.0.0-20160608205303-1d0268dfff9b/go.mod h1:WJTMcgeWYr6fZz4CwHnY1oWZCXew8GWCF93FaAxPrh4= +github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.4.0 h1:jsLTaI1zwYO3vjrzHalkVcIHXTNmdQFepW4OI8H3+x8= @@ -222,6 +332,7 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -229,15 +340,24 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -252,8 +372,10 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 h1:A1gGSx58LAGVHUUsOf7IiR0u8Xb6W51gRwfDBhkdcaw= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -261,10 +383,13 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0 h1:sfUMP1Gu8qASkorDVjnMuvgJzwFbTZSeXFiGBYAVdl4= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -287,11 +412,13 @@ golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOL golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -320,6 +447,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -337,6 +465,7 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc h1:NCy3Ohtk6Iny5V/reW2Ktypo4zIpWBdRJ1uFMjBxdg8= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -346,10 +475,12 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -359,10 +490,12 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -371,16 +504,21 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10= gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/pipe.v2 v2.0.0-20140414041502-3c2ca4d52544 h1:WJH1qsOB4/zb/li+zLMn0vaAUJ5FqPv6HYLI3aQVg1k= gopkg.in/pipe.v2 v2.0.0-20140414041502-3c2ca4d52544/go.mod h1:UhTeH/yXCK/KY7TX24mqPkaQ7gZeqmWd/8SSS8B3aHw= +gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -393,5 +531,7 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/modules.txt b/vendor/modules.txt index 7337456..f838287 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -40,6 +40,7 @@ github.com/nxadm/tail/winfile ## explicit github.com/onsi/ginkgo github.com/onsi/ginkgo/config +github.com/onsi/ginkgo/extensions/table github.com/onsi/ginkgo/internal/codelocation github.com/onsi/ginkgo/internal/containernode github.com/onsi/ginkgo/internal/failer diff --git a/yaml/node.go b/yaml/node.go index 84ae2fd..615a7f6 100644 --- a/yaml/node.go +++ b/yaml/node.go @@ -150,6 +150,7 @@ type Annotation struct { failed bool undefined bool issue Issue + tag string NodeFlags } @@ -221,6 +222,10 @@ func AddFlags(node Node, flags NodeFlags) Node { return copyNodeAnnotated(node, node.GetAnnotation().AddFlags(flags)) } +func SetTag(node Node, tag string) Node { + return copyNodeAnnotated(node, node.GetAnnotation().SetTag(tag)) +} + func TemporaryNode(node Node) Node { return copyNodeAnnotated(node, node.GetAnnotation().SetTemporary()) } @@ -242,11 +247,11 @@ func MassageType(value interface{}) interface{} { } func EmptyAnnotation() Annotation { - return Annotation{nil, false, false, false, "", false, false, false, Issue{}, 0} + return Annotation{nil, false, false, false, "", false, false, false, Issue{}, "", 0} } func NewReferencedAnnotation(node Node) Annotation { - return Annotation{nil, false, false, false, node.KeyName(), node.HasError(), node.Failed(), node.Undefined(), node.Issue(), 0} + return Annotation{nil, false, false, false, node.KeyName(), node.HasError(), node.Failed(), node.Undefined(), node.Issue(), "", 0} } func (n Annotation) Flags() NodeFlags { @@ -277,6 +282,10 @@ func (n Annotation) KeyName() string { return n.keyName } +func (n Annotation) Tag() string { + return n.tag +} + func (n Annotation) HasError() bool { return n.error } @@ -333,6 +342,11 @@ func (n Annotation) SetMerged() Annotation { return n } +func (n Annotation) SetTag(tag string) Annotation { + n.tag = tag + return n +} + func (n Annotation) SetUndefined() Annotation { n.undefined = true return n From 6d1efce66790f28e44250883b2d11efdf4c07a3d Mon Sep 17 00:00:00 2001 From: Uwe Krueger Date: Mon, 24 May 2021 01:43:47 +0200 Subject: [PATCH 2/5] implicit tags + docu + tags in spiffing --- README.md | 154 +++- cmd/merge.go | 9 +- dynaml/dynaml.peg | 8 +- dynaml/dynaml.peg.go | 1749 +++++++++++++++++++++-------------------- dynaml/parser_test.go | 2 + flow/cascade.go | 7 + flow/flow_tag_test.go | 21 + flow/state.go | 10 +- spiffing/interface.go | 17 +- spiffing/spiff.go | 68 +- 10 files changed, 1158 insertions(+), 887 deletions(-) diff --git a/README.md b/README.md index 30490b9..15c41f7 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,12 @@ Contents: - [(( &inject ))](#-inject-) - [(( &default ))](#-default-) - [(( &state ))](#-state-) + - [(( &tag:name ))](#-tagname-) + - [Tags](#tags) + - [(( &tag:name(value) ))](#-tagnamevalue-) + - [(( name::path ))](#-namepath-) + - [(( name::. ))](#-name-) + - [Tags in Multi-Document Streams](#tags-in-multi-document-streams) - [Templates](#templates) - [<<: (( &template ))](#--template-) - [(( *foo.bar ))](#-foobar-) @@ -212,10 +218,12 @@ name `-`. It may be used only once. This allows using spiff as part of a pipeline to just process a single stream or to process a stream based on several templates/stubs. -The template file (first argument) may be a multiple document stream +The template file (first argument) may be a multiple-document stream containing multiple YAML documents separated by a line containing only `---`. Each YAML document will be processed independently with the given stub files. The result is the stream of processed documents in the same order. +If a document's root node is marked as temporary, the document is omitted +from the output stream. For example, this can be used to generate *kubernetes* manifests to be used by `kubectl`. @@ -2986,7 +2994,7 @@ dynaml expressions will be evaluated in the context of the reading expression. This means that the same file included at different places in a yaml document may result in different sub trees, depending on the used dynaml expressions. -If is poassible to read a multi-document yaml, also. If the type `multiyaml` +If is possible to read a multi-document yaml, also. If the type `multiyaml` is given, a list node with the yaml document root nodes is returned. The yaml or json document can also read as _template_ by specifying the type @@ -3034,7 +3042,7 @@ will not fail, because the `second` section is never evaluated. This mode should be taken with caution, because it often leads to unexpected results. -The read type `importmulti` can be used to import multi document yaml files as a +The read type `importmulti` can be used to import multi-document yaml files as a list of nodes. ##### text documents @@ -4701,6 +4709,146 @@ occurrence. Instead, they will result in a template value stored as value for the node. They can later be instantiated inside a _dynaml_ expression (see [below](#templates)). +### `(( &tag:name ))` + +The tag marker can be used to assign a logical name to a node value. +This name can then be used in tagged reference expressions to refer to this +node value (see [below](#tags)). + +A tagged reference has the form `::`. The `` may denote any +sub node of a tagged node. If the value of a complete node +(or a simple value node) should be used, the `` must denote the root path +(`.`). + +## Tags + +Tags can be used to label node values in multi-document streams +(used as template). After defined for a document the tag can then be used to +reference node values from the actual or previous document(s) of a +document sequence in a multi-document stream. Tags can be added for complex or +simple value nodes. A tagged reference may be used to refer to the tagged +value as a whole or sub structure. + +### `(( &tag:name(value) ))` + +This syntax is used to tag a node whose value is defined by a dynaml expression. +It can also be used to denote tagged simple value nodes. + +e.g.: + +**template.yaml** +```yaml +data: + <<: (( &tag:persons )) + alice: (( &tag:alice(25) +``` + +### `(( name::path ))` + +Reference a sub path of the value of a tagged node. + +e.g.: + +**template.yaml** +```yaml +data: + <<: (( &tag:persons )) + alice: 25 + +tagref: (( persons::alice )) +``` + +resolves `tagref` to `25` + +### `(( name::. ))` + +Reference the value of tagged node. + +e.g.: + +**template.yaml** +```yaml +data: + alice: (( &tag:alice(25) )) + +tagref: (( alice::. )) +``` + +resolves `tagref` to `25` + +### Tags in Multi-Document Streams + +If the template file is a multi-document stream the tags are preserved during +the complete processing. This means tags defined in a earlier document can be used +in all following documents, also. But the tag names must be unique across all +documents in a multi-document stream. + +e.g.: + +**template.yaml** +```yaml +<<: (( &temporary )) +data: + <<: (( &tag:persons )) + alice: 25 + bob: 24 +--- +alice: (( persons::alice )) +--- +bob: (( persons::bob )) +``` + +resolves to + +```yaml +--- +alice: 25 +--- +bob: 24 +``` + +Tags defined by tag markers are available for stubs and templates. +Additionally to the tags explicitly set by tag markers, there are implicit +document tags given by the document index during the processing of a +(multi-document) template. + +e.g.: + +**template.yaml** +```yaml +<<: (( &temporary )) +data: + <<: (( &tag:persons )) + alice: 25 + bob: 24 +--- +alice: (( persons::alice )) +prev: (( 1::. )) +--- +bob: (( persons::bob )) +prev: (( 2::. )) +``` + +resolves to + +```yaml +--- +alice: 25 +prev: + data: + alice: 25 + bob: 24 +--- +bob: 24 +prev: + alice: 25 + prev: + data: + alice: 25 + bob: 24 +``` + + ## Templates A map can be tagged by a dynaml expression to be used as template. Dynaml expressions in a template are not evaluated at its definition location in the document, but can be inserted at other locations using dynaml. diff --git a/cmd/merge.go b/cmd/merge.go index ad1de0c..2248cca 100644 --- a/cmd/merge.go +++ b/cmd/merge.go @@ -63,7 +63,7 @@ func init() { mergeCmd.Flags().BoolVar(&debug.DebugFlag, "debug", false, "Print state info") mergeCmd.Flags().BoolVar(&processingOptions.Partial, "partial", false, "Allow partial evaluation only") mergeCmd.Flags().StringVar(&outputPath, "path", "", "output is taken from given path") - mergeCmd.Flags().BoolVar(&split, "split", false, "if the output is alist it will be split into separate documents") + mergeCmd.Flags().BoolVar(&split, "split", false, "if the output is a list it will be split into separate documents") mergeCmd.Flags().BoolVar(&processingOptions.PreserveEscapes, "preserve-escapes", false, "preserve escaping for escaped expressions and merges") mergeCmd.Flags().BoolVar(&processingOptions.PreserveTemporary, "preserve-temporary", false, "preserve temporary fields") mergeCmd.Flags().StringVar(&state, "state", "", "select state file to maintain") @@ -237,6 +237,13 @@ func merge(stdin bool, templateFilePath string, opts flow.Options, json, split b } if err != nil { flowed = dynaml.ResetUnresolvedNodes(flowed) + } else { + if binding != nil { + binding.GetState().SetTag(fmt.Sprintf("%d", count), flowed, nil) + } + } + if !opts.PreserveTemporary && flowed.Temporary() { + continue } if subpath != "" { comps := dynaml.PathComponents(subpath, false) diff --git a/dynaml/dynaml.peg b/dynaml/dynaml.peg index 482de5c..6f9947d 100644 --- a/dynaml/dynaml.peg +++ b/dynaml/dynaml.peg @@ -45,7 +45,7 @@ Division <- '/' req_ws Level0 Modulo <- '%' req_ws Level0 Level0 <- IP / String / Number / Boolean / Undefined / Nil / Symbol / Not / - Substitution / Merge / Auto / Lambda / Chained + Substitution / Merge / Auto / Lambda / Chained Chained <- ( MapMapping / Sync / Catch / Mapping / MapSelection / Selection / Sum / List / Map / Range / Grouped / Reference ) ChainedQualifiedExpression* ChainedQualifiedExpression <- ChainedCall / Currying / ChainedRef / ChainedDynRef / Projection @@ -72,7 +72,7 @@ Range <- StartRange Expression? RangeOp Expression? ']' StartRange <- '[' RangeOp <- '..' -Number <- '-'? [0-9] [0-9_]* ( '.' [0-9] [0-9]* )? ( ( 'e' / 'E' ) '-'? [0-9] [0-9]* )? +Number <- '-'? [0-9] [0-9_]* ( '.' [0-9] [0-9]* )? ( ( 'e' / 'E' ) '-'? [0-9] [0-9]* )? !'::' String <- '"' ('\\"' / !'"' .)* '"' Boolean <- 'true' / 'false' Nil <- 'nil' / '~' @@ -120,8 +120,8 @@ DefaultValue <- '=' Expression VarParams <- '...' ws Reference <- (( Tag ('.' / Key)) / ( '.'? Key )) FollowUpRef -Tag <- TagName '::' -TagName <- [a-zA-Z0-9_]+ +Tag <- ( TagName / [0-9]+ ) '::' +TagName <- [a-zA-Z_] [a-zA-Z0-9_]* FollowUpRef <- PathComponent* PathComponent <- ( '.' Key ) / ( '.'? Index ) diff --git a/dynaml/dynaml.peg.go b/dynaml/dynaml.peg.go index c9dd40d..e0fb8b2 100644 --- a/dynaml/dynaml.peg.go +++ b/dynaml/dynaml.peg.go @@ -2666,7 +2666,7 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position210, tokenIndex210, depth210 return false }, - /* 53 Number <- <('-'? [0-9] ([0-9] / '_')* ('.' [0-9] [0-9]*)? (('e' / 'E') '-'? [0-9] [0-9]*)?)> */ + /* 53 Number <- <('-'? [0-9] ([0-9] / '_')* ('.' [0-9] [0-9]*)? (('e' / 'E') '-'? [0-9] [0-9]*)? !(':' ':'))> */ func() bool { position212, tokenIndex212, depth212 := position, tokenIndex, depth { @@ -2783,6 +2783,20 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position224, tokenIndex224, depth224 } l225: + { + position232, tokenIndex232, depth232 := position, tokenIndex, depth + if buffer[position] != rune(':') { + goto l232 + } + position++ + if buffer[position] != rune(':') { + goto l232 + } + position++ + goto l212 + l232: + position, tokenIndex, depth = position232, tokenIndex232, depth232 + } depth-- add(ruleNumber, position213) } @@ -2793,2146 +2807,2161 @@ func (p *DynamlGrammar) Init() { }, /* 54 String <- <('"' (('\\' '"') / (!'"' .))* '"')> */ func() bool { - position232, tokenIndex232, depth232 := position, tokenIndex, depth + position233, tokenIndex233, depth233 := position, tokenIndex, depth { - position233 := position + position234 := position depth++ if buffer[position] != rune('"') { - goto l232 + goto l233 } position++ - l234: + l235: { - position235, tokenIndex235, depth235 := position, tokenIndex, depth + position236, tokenIndex236, depth236 := position, tokenIndex, depth { - position236, tokenIndex236, depth236 := position, tokenIndex, depth + position237, tokenIndex237, depth237 := position, tokenIndex, depth if buffer[position] != rune('\\') { - goto l237 + goto l238 } position++ if buffer[position] != rune('"') { - goto l237 + goto l238 } position++ - goto l236 - l237: - position, tokenIndex, depth = position236, tokenIndex236, depth236 + goto l237 + l238: + position, tokenIndex, depth = position237, tokenIndex237, depth237 { - position238, tokenIndex238, depth238 := position, tokenIndex, depth + position239, tokenIndex239, depth239 := position, tokenIndex, depth if buffer[position] != rune('"') { - goto l238 + goto l239 } position++ - goto l235 - l238: - position, tokenIndex, depth = position238, tokenIndex238, depth238 + goto l236 + l239: + position, tokenIndex, depth = position239, tokenIndex239, depth239 } if !matchDot() { - goto l235 + goto l236 } } + l237: + goto l235 l236: - goto l234 - l235: - position, tokenIndex, depth = position235, tokenIndex235, depth235 + position, tokenIndex, depth = position236, tokenIndex236, depth236 } if buffer[position] != rune('"') { - goto l232 + goto l233 } position++ depth-- - add(ruleString, position233) + add(ruleString, position234) } return true - l232: - position, tokenIndex, depth = position232, tokenIndex232, depth232 + l233: + position, tokenIndex, depth = position233, tokenIndex233, depth233 return false }, /* 55 Boolean <- <(('t' 'r' 'u' 'e') / ('f' 'a' 'l' 's' 'e'))> */ func() bool { - position239, tokenIndex239, depth239 := position, tokenIndex, depth + position240, tokenIndex240, depth240 := position, tokenIndex, depth { - position240 := position + position241 := position depth++ { - position241, tokenIndex241, depth241 := position, tokenIndex, depth + position242, tokenIndex242, depth242 := position, tokenIndex, depth if buffer[position] != rune('t') { - goto l242 + goto l243 } position++ if buffer[position] != rune('r') { - goto l242 + goto l243 } position++ if buffer[position] != rune('u') { - goto l242 + goto l243 } position++ if buffer[position] != rune('e') { - goto l242 + goto l243 } position++ - goto l241 - l242: - position, tokenIndex, depth = position241, tokenIndex241, depth241 + goto l242 + l243: + position, tokenIndex, depth = position242, tokenIndex242, depth242 if buffer[position] != rune('f') { - goto l239 + goto l240 } position++ if buffer[position] != rune('a') { - goto l239 + goto l240 } position++ if buffer[position] != rune('l') { - goto l239 + goto l240 } position++ if buffer[position] != rune('s') { - goto l239 + goto l240 } position++ if buffer[position] != rune('e') { - goto l239 + goto l240 } position++ } - l241: + l242: depth-- - add(ruleBoolean, position240) + add(ruleBoolean, position241) } return true - l239: - position, tokenIndex, depth = position239, tokenIndex239, depth239 + l240: + position, tokenIndex, depth = position240, tokenIndex240, depth240 return false }, /* 56 Nil <- <(('n' 'i' 'l') / '~')> */ func() bool { - position243, tokenIndex243, depth243 := position, tokenIndex, depth + position244, tokenIndex244, depth244 := position, tokenIndex, depth { - position244 := position + position245 := position depth++ { - position245, tokenIndex245, depth245 := position, tokenIndex, depth + position246, tokenIndex246, depth246 := position, tokenIndex, depth if buffer[position] != rune('n') { - goto l246 + goto l247 } position++ if buffer[position] != rune('i') { - goto l246 + goto l247 } position++ if buffer[position] != rune('l') { - goto l246 + goto l247 } position++ - goto l245 - l246: - position, tokenIndex, depth = position245, tokenIndex245, depth245 + goto l246 + l247: + position, tokenIndex, depth = position246, tokenIndex246, depth246 if buffer[position] != rune('~') { - goto l243 + goto l244 } position++ } - l245: + l246: depth-- - add(ruleNil, position244) + add(ruleNil, position245) } return true - l243: - position, tokenIndex, depth = position243, tokenIndex243, depth243 + l244: + position, tokenIndex, depth = position244, tokenIndex244, depth244 return false }, /* 57 Undefined <- <('~' '~')> */ func() bool { - position247, tokenIndex247, depth247 := position, tokenIndex, depth + position248, tokenIndex248, depth248 := position, tokenIndex, depth { - position248 := position + position249 := position depth++ if buffer[position] != rune('~') { - goto l247 + goto l248 } position++ if buffer[position] != rune('~') { - goto l247 + goto l248 } position++ depth-- - add(ruleUndefined, position248) + add(ruleUndefined, position249) } return true - l247: - position, tokenIndex, depth = position247, tokenIndex247, depth247 + l248: + position, tokenIndex, depth = position248, tokenIndex248, depth248 return false }, /* 58 Symbol <- <('$' Name)> */ func() bool { - position249, tokenIndex249, depth249 := position, tokenIndex, depth + position250, tokenIndex250, depth250 := position, tokenIndex, depth { - position250 := position + position251 := position depth++ if buffer[position] != rune('$') { - goto l249 + goto l250 } position++ if !_rules[ruleName]() { - goto l249 + goto l250 } depth-- - add(ruleSymbol, position250) + add(ruleSymbol, position251) } return true - l249: - position, tokenIndex, depth = position249, tokenIndex249, depth249 + l250: + position, tokenIndex, depth = position250, tokenIndex250, depth250 return false }, /* 59 List <- <(StartList ExpressionList? ']')> */ func() bool { - position251, tokenIndex251, depth251 := position, tokenIndex, depth + position252, tokenIndex252, depth252 := position, tokenIndex, depth { - position252 := position + position253 := position depth++ if !_rules[ruleStartList]() { - goto l251 + goto l252 } { - position253, tokenIndex253, depth253 := position, tokenIndex, depth + position254, tokenIndex254, depth254 := position, tokenIndex, depth if !_rules[ruleExpressionList]() { - goto l253 + goto l254 } - goto l254 - l253: - position, tokenIndex, depth = position253, tokenIndex253, depth253 + goto l255 + l254: + position, tokenIndex, depth = position254, tokenIndex254, depth254 } - l254: + l255: if buffer[position] != rune(']') { - goto l251 + goto l252 } position++ depth-- - add(ruleList, position252) + add(ruleList, position253) } return true - l251: - position, tokenIndex, depth = position251, tokenIndex251, depth251 + l252: + position, tokenIndex, depth = position252, tokenIndex252, depth252 return false }, /* 60 StartList <- <('[' ws)> */ func() bool { - position255, tokenIndex255, depth255 := position, tokenIndex, depth + position256, tokenIndex256, depth256 := position, tokenIndex, depth { - position256 := position + position257 := position depth++ if buffer[position] != rune('[') { - goto l255 + goto l256 } position++ if !_rules[rulews]() { - goto l255 + goto l256 } depth-- - add(ruleStartList, position256) + add(ruleStartList, position257) } return true - l255: - position, tokenIndex, depth = position255, tokenIndex255, depth255 + l256: + position, tokenIndex, depth = position256, tokenIndex256, depth256 return false }, /* 61 Map <- <(CreateMap ws Assignments? '}')> */ func() bool { - position257, tokenIndex257, depth257 := position, tokenIndex, depth + position258, tokenIndex258, depth258 := position, tokenIndex, depth { - position258 := position + position259 := position depth++ if !_rules[ruleCreateMap]() { - goto l257 + goto l258 } if !_rules[rulews]() { - goto l257 + goto l258 } { - position259, tokenIndex259, depth259 := position, tokenIndex, depth + position260, tokenIndex260, depth260 := position, tokenIndex, depth if !_rules[ruleAssignments]() { - goto l259 + goto l260 } - goto l260 - l259: - position, tokenIndex, depth = position259, tokenIndex259, depth259 + goto l261 + l260: + position, tokenIndex, depth = position260, tokenIndex260, depth260 } - l260: + l261: if buffer[position] != rune('}') { - goto l257 + goto l258 } position++ depth-- - add(ruleMap, position258) + add(ruleMap, position259) } return true - l257: - position, tokenIndex, depth = position257, tokenIndex257, depth257 + l258: + position, tokenIndex, depth = position258, tokenIndex258, depth258 return false }, /* 62 CreateMap <- <'{'> */ func() bool { - position261, tokenIndex261, depth261 := position, tokenIndex, depth + position262, tokenIndex262, depth262 := position, tokenIndex, depth { - position262 := position + position263 := position depth++ if buffer[position] != rune('{') { - goto l261 + goto l262 } position++ depth-- - add(ruleCreateMap, position262) + add(ruleCreateMap, position263) } return true - l261: - position, tokenIndex, depth = position261, tokenIndex261, depth261 + l262: + position, tokenIndex, depth = position262, tokenIndex262, depth262 return false }, /* 63 Assignments <- <(Assignment (',' Assignment)*)> */ func() bool { - position263, tokenIndex263, depth263 := position, tokenIndex, depth + position264, tokenIndex264, depth264 := position, tokenIndex, depth { - position264 := position + position265 := position depth++ if !_rules[ruleAssignment]() { - goto l263 + goto l264 } - l265: + l266: { - position266, tokenIndex266, depth266 := position, tokenIndex, depth + position267, tokenIndex267, depth267 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l266 + goto l267 } position++ if !_rules[ruleAssignment]() { - goto l266 + goto l267 } - goto l265 - l266: - position, tokenIndex, depth = position266, tokenIndex266, depth266 + goto l266 + l267: + position, tokenIndex, depth = position267, tokenIndex267, depth267 } depth-- - add(ruleAssignments, position264) + add(ruleAssignments, position265) } return true - l263: - position, tokenIndex, depth = position263, tokenIndex263, depth263 + l264: + position, tokenIndex, depth = position264, tokenIndex264, depth264 return false }, /* 64 Assignment <- <(Expression '=' Expression)> */ func() bool { - position267, tokenIndex267, depth267 := position, tokenIndex, depth + position268, tokenIndex268, depth268 := position, tokenIndex, depth { - position268 := position + position269 := position depth++ if !_rules[ruleExpression]() { - goto l267 + goto l268 } if buffer[position] != rune('=') { - goto l267 + goto l268 } position++ if !_rules[ruleExpression]() { - goto l267 + goto l268 } depth-- - add(ruleAssignment, position268) + add(ruleAssignment, position269) } return true - l267: - position, tokenIndex, depth = position267, tokenIndex267, depth267 + l268: + position, tokenIndex, depth = position268, tokenIndex268, depth268 return false }, /* 65 Merge <- <(RefMerge / SimpleMerge)> */ func() bool { - position269, tokenIndex269, depth269 := position, tokenIndex, depth + position270, tokenIndex270, depth270 := position, tokenIndex, depth { - position270 := position + position271 := position depth++ { - position271, tokenIndex271, depth271 := position, tokenIndex, depth + position272, tokenIndex272, depth272 := position, tokenIndex, depth if !_rules[ruleRefMerge]() { - goto l272 + goto l273 } - goto l271 - l272: - position, tokenIndex, depth = position271, tokenIndex271, depth271 + goto l272 + l273: + position, tokenIndex, depth = position272, tokenIndex272, depth272 if !_rules[ruleSimpleMerge]() { - goto l269 + goto l270 } } - l271: + l272: depth-- - add(ruleMerge, position270) + add(ruleMerge, position271) } return true - l269: - position, tokenIndex, depth = position269, tokenIndex269, depth269 + l270: + position, tokenIndex, depth = position270, tokenIndex270, depth270 return false }, /* 66 RefMerge <- <('m' 'e' 'r' 'g' 'e' !(req_ws Required) (req_ws (Replace / On))? req_ws Reference)> */ func() bool { - position273, tokenIndex273, depth273 := position, tokenIndex, depth + position274, tokenIndex274, depth274 := position, tokenIndex, depth { - position274 := position + position275 := position depth++ if buffer[position] != rune('m') { - goto l273 + goto l274 } position++ if buffer[position] != rune('e') { - goto l273 + goto l274 } position++ if buffer[position] != rune('r') { - goto l273 + goto l274 } position++ if buffer[position] != rune('g') { - goto l273 + goto l274 } position++ if buffer[position] != rune('e') { - goto l273 + goto l274 } position++ { - position275, tokenIndex275, depth275 := position, tokenIndex, depth + position276, tokenIndex276, depth276 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l275 + goto l276 } if !_rules[ruleRequired]() { - goto l275 + goto l276 } - goto l273 - l275: - position, tokenIndex, depth = position275, tokenIndex275, depth275 + goto l274 + l276: + position, tokenIndex, depth = position276, tokenIndex276, depth276 } { - position276, tokenIndex276, depth276 := position, tokenIndex, depth + position277, tokenIndex277, depth277 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l276 + goto l277 } { - position278, tokenIndex278, depth278 := position, tokenIndex, depth + position279, tokenIndex279, depth279 := position, tokenIndex, depth if !_rules[ruleReplace]() { - goto l279 + goto l280 } - goto l278 - l279: - position, tokenIndex, depth = position278, tokenIndex278, depth278 + goto l279 + l280: + position, tokenIndex, depth = position279, tokenIndex279, depth279 if !_rules[ruleOn]() { - goto l276 + goto l277 } } - l278: - goto l277 - l276: - position, tokenIndex, depth = position276, tokenIndex276, depth276 + l279: + goto l278 + l277: + position, tokenIndex, depth = position277, tokenIndex277, depth277 } - l277: + l278: if !_rules[rulereq_ws]() { - goto l273 + goto l274 } if !_rules[ruleReference]() { - goto l273 + goto l274 } depth-- - add(ruleRefMerge, position274) + add(ruleRefMerge, position275) } return true - l273: - position, tokenIndex, depth = position273, tokenIndex273, depth273 + l274: + position, tokenIndex, depth = position274, tokenIndex274, depth274 return false }, /* 67 SimpleMerge <- <('m' 'e' 'r' 'g' 'e' !'(' (req_ws (Replace / Required / On))?)> */ func() bool { - position280, tokenIndex280, depth280 := position, tokenIndex, depth + position281, tokenIndex281, depth281 := position, tokenIndex, depth { - position281 := position + position282 := position depth++ if buffer[position] != rune('m') { - goto l280 + goto l281 } position++ if buffer[position] != rune('e') { - goto l280 + goto l281 } position++ if buffer[position] != rune('r') { - goto l280 + goto l281 } position++ if buffer[position] != rune('g') { - goto l280 + goto l281 } position++ if buffer[position] != rune('e') { - goto l280 + goto l281 } position++ { - position282, tokenIndex282, depth282 := position, tokenIndex, depth + position283, tokenIndex283, depth283 := position, tokenIndex, depth if buffer[position] != rune('(') { - goto l282 + goto l283 } position++ - goto l280 - l282: - position, tokenIndex, depth = position282, tokenIndex282, depth282 + goto l281 + l283: + position, tokenIndex, depth = position283, tokenIndex283, depth283 } { - position283, tokenIndex283, depth283 := position, tokenIndex, depth + position284, tokenIndex284, depth284 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l283 + goto l284 } { - position285, tokenIndex285, depth285 := position, tokenIndex, depth + position286, tokenIndex286, depth286 := position, tokenIndex, depth if !_rules[ruleReplace]() { - goto l286 - } - goto l285 - l286: - position, tokenIndex, depth = position285, tokenIndex285, depth285 - if !_rules[ruleRequired]() { goto l287 } - goto l285 + goto l286 l287: - position, tokenIndex, depth = position285, tokenIndex285, depth285 + position, tokenIndex, depth = position286, tokenIndex286, depth286 + if !_rules[ruleRequired]() { + goto l288 + } + goto l286 + l288: + position, tokenIndex, depth = position286, tokenIndex286, depth286 if !_rules[ruleOn]() { - goto l283 + goto l284 } } - l285: - goto l284 - l283: - position, tokenIndex, depth = position283, tokenIndex283, depth283 + l286: + goto l285 + l284: + position, tokenIndex, depth = position284, tokenIndex284, depth284 } - l284: + l285: depth-- - add(ruleSimpleMerge, position281) + add(ruleSimpleMerge, position282) } return true - l280: - position, tokenIndex, depth = position280, tokenIndex280, depth280 + l281: + position, tokenIndex, depth = position281, tokenIndex281, depth281 return false }, /* 68 Replace <- <('r' 'e' 'p' 'l' 'a' 'c' 'e')> */ func() bool { - position288, tokenIndex288, depth288 := position, tokenIndex, depth + position289, tokenIndex289, depth289 := position, tokenIndex, depth { - position289 := position + position290 := position depth++ if buffer[position] != rune('r') { - goto l288 + goto l289 } position++ if buffer[position] != rune('e') { - goto l288 + goto l289 } position++ if buffer[position] != rune('p') { - goto l288 + goto l289 } position++ if buffer[position] != rune('l') { - goto l288 + goto l289 } position++ if buffer[position] != rune('a') { - goto l288 + goto l289 } position++ if buffer[position] != rune('c') { - goto l288 + goto l289 } position++ if buffer[position] != rune('e') { - goto l288 + goto l289 } position++ depth-- - add(ruleReplace, position289) + add(ruleReplace, position290) } return true - l288: - position, tokenIndex, depth = position288, tokenIndex288, depth288 + l289: + position, tokenIndex, depth = position289, tokenIndex289, depth289 return false }, /* 69 Required <- <('r' 'e' 'q' 'u' 'i' 'r' 'e' 'd')> */ func() bool { - position290, tokenIndex290, depth290 := position, tokenIndex, depth + position291, tokenIndex291, depth291 := position, tokenIndex, depth { - position291 := position + position292 := position depth++ if buffer[position] != rune('r') { - goto l290 + goto l291 } position++ if buffer[position] != rune('e') { - goto l290 + goto l291 } position++ if buffer[position] != rune('q') { - goto l290 + goto l291 } position++ if buffer[position] != rune('u') { - goto l290 + goto l291 } position++ if buffer[position] != rune('i') { - goto l290 + goto l291 } position++ if buffer[position] != rune('r') { - goto l290 + goto l291 } position++ if buffer[position] != rune('e') { - goto l290 + goto l291 } position++ if buffer[position] != rune('d') { - goto l290 + goto l291 } position++ depth-- - add(ruleRequired, position291) + add(ruleRequired, position292) } return true - l290: - position, tokenIndex, depth = position290, tokenIndex290, depth290 + l291: + position, tokenIndex, depth = position291, tokenIndex291, depth291 return false }, /* 70 On <- <('o' 'n' req_ws Name)> */ func() bool { - position292, tokenIndex292, depth292 := position, tokenIndex, depth + position293, tokenIndex293, depth293 := position, tokenIndex, depth { - position293 := position + position294 := position depth++ if buffer[position] != rune('o') { - goto l292 + goto l293 } position++ if buffer[position] != rune('n') { - goto l292 + goto l293 } position++ if !_rules[rulereq_ws]() { - goto l292 + goto l293 } if !_rules[ruleName]() { - goto l292 + goto l293 } depth-- - add(ruleOn, position293) + add(ruleOn, position294) } return true - l292: - position, tokenIndex, depth = position292, tokenIndex292, depth292 + l293: + position, tokenIndex, depth = position293, tokenIndex293, depth293 return false }, /* 71 Auto <- <('a' 'u' 't' 'o')> */ func() bool { - position294, tokenIndex294, depth294 := position, tokenIndex, depth + position295, tokenIndex295, depth295 := position, tokenIndex, depth { - position295 := position + position296 := position depth++ if buffer[position] != rune('a') { - goto l294 + goto l295 } position++ if buffer[position] != rune('u') { - goto l294 + goto l295 } position++ if buffer[position] != rune('t') { - goto l294 + goto l295 } position++ if buffer[position] != rune('o') { - goto l294 + goto l295 } position++ depth-- - add(ruleAuto, position295) + add(ruleAuto, position296) } return true - l294: - position, tokenIndex, depth = position294, tokenIndex294, depth294 + l295: + position, tokenIndex, depth = position295, tokenIndex295, depth295 return false }, /* 72 Default <- */ func() bool { - position296, tokenIndex296, depth296 := position, tokenIndex, depth + position297, tokenIndex297, depth297 := position, tokenIndex, depth { - position297 := position + position298 := position depth++ if !_rules[ruleAction1]() { - goto l296 + goto l297 } depth-- - add(ruleDefault, position297) + add(ruleDefault, position298) } return true - l296: - position, tokenIndex, depth = position296, tokenIndex296, depth296 + l297: + position, tokenIndex, depth = position297, tokenIndex297, depth297 return false }, /* 73 Sync <- <('s' 'y' 'n' 'c' '[' Level7 ((((LambdaExpr LambdaExt) / (LambdaOrExpr LambdaOrExpr)) (('|' Expression) / Default)) / (LambdaOrExpr Default Default)) ']')> */ func() bool { - position298, tokenIndex298, depth298 := position, tokenIndex, depth + position299, tokenIndex299, depth299 := position, tokenIndex, depth { - position299 := position + position300 := position depth++ if buffer[position] != rune('s') { - goto l298 + goto l299 } position++ if buffer[position] != rune('y') { - goto l298 + goto l299 } position++ if buffer[position] != rune('n') { - goto l298 + goto l299 } position++ if buffer[position] != rune('c') { - goto l298 + goto l299 } position++ if buffer[position] != rune('[') { - goto l298 + goto l299 } position++ if !_rules[ruleLevel7]() { - goto l298 + goto l299 } { - position300, tokenIndex300, depth300 := position, tokenIndex, depth + position301, tokenIndex301, depth301 := position, tokenIndex, depth { - position302, tokenIndex302, depth302 := position, tokenIndex, depth + position303, tokenIndex303, depth303 := position, tokenIndex, depth if !_rules[ruleLambdaExpr]() { - goto l303 + goto l304 } if !_rules[ruleLambdaExt]() { - goto l303 + goto l304 } - goto l302 - l303: - position, tokenIndex, depth = position302, tokenIndex302, depth302 + goto l303 + l304: + position, tokenIndex, depth = position303, tokenIndex303, depth303 if !_rules[ruleLambdaOrExpr]() { - goto l301 + goto l302 } if !_rules[ruleLambdaOrExpr]() { - goto l301 + goto l302 } } - l302: + l303: { - position304, tokenIndex304, depth304 := position, tokenIndex, depth + position305, tokenIndex305, depth305 := position, tokenIndex, depth if buffer[position] != rune('|') { - goto l305 + goto l306 } position++ if !_rules[ruleExpression]() { - goto l305 + goto l306 } - goto l304 - l305: - position, tokenIndex, depth = position304, tokenIndex304, depth304 + goto l305 + l306: + position, tokenIndex, depth = position305, tokenIndex305, depth305 if !_rules[ruleDefault]() { - goto l301 + goto l302 } } - l304: - goto l300 - l301: - position, tokenIndex, depth = position300, tokenIndex300, depth300 + l305: + goto l301 + l302: + position, tokenIndex, depth = position301, tokenIndex301, depth301 if !_rules[ruleLambdaOrExpr]() { - goto l298 + goto l299 } if !_rules[ruleDefault]() { - goto l298 + goto l299 } if !_rules[ruleDefault]() { - goto l298 + goto l299 } } - l300: + l301: if buffer[position] != rune(']') { - goto l298 + goto l299 } position++ depth-- - add(ruleSync, position299) + add(ruleSync, position300) } return true - l298: - position, tokenIndex, depth = position298, tokenIndex298, depth298 + l299: + position, tokenIndex, depth = position299, tokenIndex299, depth299 return false }, /* 74 LambdaExt <- <(',' Expression)> */ func() bool { - position306, tokenIndex306, depth306 := position, tokenIndex, depth + position307, tokenIndex307, depth307 := position, tokenIndex, depth { - position307 := position + position308 := position depth++ if buffer[position] != rune(',') { - goto l306 + goto l307 } position++ if !_rules[ruleExpression]() { - goto l306 + goto l307 } depth-- - add(ruleLambdaExt, position307) + add(ruleLambdaExt, position308) } return true - l306: - position, tokenIndex, depth = position306, tokenIndex306, depth306 + l307: + position, tokenIndex, depth = position307, tokenIndex307, depth307 return false }, /* 75 LambdaOrExpr <- <(LambdaExpr / ('|' Expression))> */ func() bool { - position308, tokenIndex308, depth308 := position, tokenIndex, depth + position309, tokenIndex309, depth309 := position, tokenIndex, depth { - position309 := position + position310 := position depth++ { - position310, tokenIndex310, depth310 := position, tokenIndex, depth + position311, tokenIndex311, depth311 := position, tokenIndex, depth if !_rules[ruleLambdaExpr]() { - goto l311 + goto l312 } - goto l310 - l311: - position, tokenIndex, depth = position310, tokenIndex310, depth310 + goto l311 + l312: + position, tokenIndex, depth = position311, tokenIndex311, depth311 if buffer[position] != rune('|') { - goto l308 + goto l309 } position++ if !_rules[ruleExpression]() { - goto l308 + goto l309 } } - l310: + l311: depth-- - add(ruleLambdaOrExpr, position309) + add(ruleLambdaOrExpr, position310) } return true - l308: - position, tokenIndex, depth = position308, tokenIndex308, depth308 + l309: + position, tokenIndex, depth = position309, tokenIndex309, depth309 return false }, /* 76 Catch <- <('c' 'a' 't' 'c' 'h' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position312, tokenIndex312, depth312 := position, tokenIndex, depth + position313, tokenIndex313, depth313 := position, tokenIndex, depth { - position313 := position + position314 := position depth++ if buffer[position] != rune('c') { - goto l312 + goto l313 } position++ if buffer[position] != rune('a') { - goto l312 + goto l313 } position++ if buffer[position] != rune('t') { - goto l312 + goto l313 } position++ if buffer[position] != rune('c') { - goto l312 + goto l313 } position++ if buffer[position] != rune('h') { - goto l312 + goto l313 } position++ if buffer[position] != rune('[') { - goto l312 + goto l313 } position++ if !_rules[ruleLevel7]() { - goto l312 + goto l313 } if !_rules[ruleLambdaOrExpr]() { - goto l312 + goto l313 } if buffer[position] != rune(']') { - goto l312 + goto l313 } position++ depth-- - add(ruleCatch, position313) + add(ruleCatch, position314) } return true - l312: - position, tokenIndex, depth = position312, tokenIndex312, depth312 + l313: + position, tokenIndex, depth = position313, tokenIndex313, depth313 return false }, /* 77 MapMapping <- <('m' 'a' 'p' '{' Level7 LambdaOrExpr '}')> */ func() bool { - position314, tokenIndex314, depth314 := position, tokenIndex, depth + position315, tokenIndex315, depth315 := position, tokenIndex, depth { - position315 := position + position316 := position depth++ if buffer[position] != rune('m') { - goto l314 + goto l315 } position++ if buffer[position] != rune('a') { - goto l314 + goto l315 } position++ if buffer[position] != rune('p') { - goto l314 + goto l315 } position++ if buffer[position] != rune('{') { - goto l314 + goto l315 } position++ if !_rules[ruleLevel7]() { - goto l314 + goto l315 } if !_rules[ruleLambdaOrExpr]() { - goto l314 + goto l315 } if buffer[position] != rune('}') { - goto l314 + goto l315 } position++ depth-- - add(ruleMapMapping, position315) + add(ruleMapMapping, position316) } return true - l314: - position, tokenIndex, depth = position314, tokenIndex314, depth314 + l315: + position, tokenIndex, depth = position315, tokenIndex315, depth315 return false }, /* 78 Mapping <- <('m' 'a' 'p' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position316, tokenIndex316, depth316 := position, tokenIndex, depth + position317, tokenIndex317, depth317 := position, tokenIndex, depth { - position317 := position + position318 := position depth++ if buffer[position] != rune('m') { - goto l316 + goto l317 } position++ if buffer[position] != rune('a') { - goto l316 + goto l317 } position++ if buffer[position] != rune('p') { - goto l316 + goto l317 } position++ if buffer[position] != rune('[') { - goto l316 + goto l317 } position++ if !_rules[ruleLevel7]() { - goto l316 + goto l317 } if !_rules[ruleLambdaOrExpr]() { - goto l316 + goto l317 } if buffer[position] != rune(']') { - goto l316 + goto l317 } position++ depth-- - add(ruleMapping, position317) + add(ruleMapping, position318) } return true - l316: - position, tokenIndex, depth = position316, tokenIndex316, depth316 + l317: + position, tokenIndex, depth = position317, tokenIndex317, depth317 return false }, /* 79 MapSelection <- <('s' 'e' 'l' 'e' 'c' 't' '{' Level7 LambdaOrExpr '}')> */ func() bool { - position318, tokenIndex318, depth318 := position, tokenIndex, depth + position319, tokenIndex319, depth319 := position, tokenIndex, depth { - position319 := position + position320 := position depth++ if buffer[position] != rune('s') { - goto l318 + goto l319 } position++ if buffer[position] != rune('e') { - goto l318 + goto l319 } position++ if buffer[position] != rune('l') { - goto l318 + goto l319 } position++ if buffer[position] != rune('e') { - goto l318 + goto l319 } position++ if buffer[position] != rune('c') { - goto l318 + goto l319 } position++ if buffer[position] != rune('t') { - goto l318 + goto l319 } position++ if buffer[position] != rune('{') { - goto l318 + goto l319 } position++ if !_rules[ruleLevel7]() { - goto l318 + goto l319 } if !_rules[ruleLambdaOrExpr]() { - goto l318 + goto l319 } if buffer[position] != rune('}') { - goto l318 + goto l319 } position++ depth-- - add(ruleMapSelection, position319) + add(ruleMapSelection, position320) } return true - l318: - position, tokenIndex, depth = position318, tokenIndex318, depth318 + l319: + position, tokenIndex, depth = position319, tokenIndex319, depth319 return false }, /* 80 Selection <- <('s' 'e' 'l' 'e' 'c' 't' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position320, tokenIndex320, depth320 := position, tokenIndex, depth + position321, tokenIndex321, depth321 := position, tokenIndex, depth { - position321 := position + position322 := position depth++ if buffer[position] != rune('s') { - goto l320 + goto l321 } position++ if buffer[position] != rune('e') { - goto l320 + goto l321 } position++ if buffer[position] != rune('l') { - goto l320 + goto l321 } position++ if buffer[position] != rune('e') { - goto l320 + goto l321 } position++ if buffer[position] != rune('c') { - goto l320 + goto l321 } position++ if buffer[position] != rune('t') { - goto l320 + goto l321 } position++ if buffer[position] != rune('[') { - goto l320 + goto l321 } position++ if !_rules[ruleLevel7]() { - goto l320 + goto l321 } if !_rules[ruleLambdaOrExpr]() { - goto l320 + goto l321 } if buffer[position] != rune(']') { - goto l320 + goto l321 } position++ depth-- - add(ruleSelection, position321) + add(ruleSelection, position322) } return true - l320: - position, tokenIndex, depth = position320, tokenIndex320, depth320 + l321: + position, tokenIndex, depth = position321, tokenIndex321, depth321 return false }, /* 81 Sum <- <('s' 'u' 'm' '[' Level7 '|' Level7 LambdaOrExpr ']')> */ func() bool { - position322, tokenIndex322, depth322 := position, tokenIndex, depth + position323, tokenIndex323, depth323 := position, tokenIndex, depth { - position323 := position + position324 := position depth++ if buffer[position] != rune('s') { - goto l322 + goto l323 } position++ if buffer[position] != rune('u') { - goto l322 + goto l323 } position++ if buffer[position] != rune('m') { - goto l322 + goto l323 } position++ if buffer[position] != rune('[') { - goto l322 + goto l323 } position++ if !_rules[ruleLevel7]() { - goto l322 + goto l323 } if buffer[position] != rune('|') { - goto l322 + goto l323 } position++ if !_rules[ruleLevel7]() { - goto l322 + goto l323 } if !_rules[ruleLambdaOrExpr]() { - goto l322 + goto l323 } if buffer[position] != rune(']') { - goto l322 + goto l323 } position++ depth-- - add(ruleSum, position323) + add(ruleSum, position324) } return true - l322: - position, tokenIndex, depth = position322, tokenIndex322, depth322 + l323: + position, tokenIndex, depth = position323, tokenIndex323, depth323 return false }, /* 82 Lambda <- <('l' 'a' 'm' 'b' 'd' 'a' (LambdaRef / LambdaExpr))> */ func() bool { - position324, tokenIndex324, depth324 := position, tokenIndex, depth + position325, tokenIndex325, depth325 := position, tokenIndex, depth { - position325 := position + position326 := position depth++ if buffer[position] != rune('l') { - goto l324 + goto l325 } position++ if buffer[position] != rune('a') { - goto l324 + goto l325 } position++ if buffer[position] != rune('m') { - goto l324 + goto l325 } position++ if buffer[position] != rune('b') { - goto l324 + goto l325 } position++ if buffer[position] != rune('d') { - goto l324 + goto l325 } position++ if buffer[position] != rune('a') { - goto l324 + goto l325 } position++ { - position326, tokenIndex326, depth326 := position, tokenIndex, depth + position327, tokenIndex327, depth327 := position, tokenIndex, depth if !_rules[ruleLambdaRef]() { - goto l327 + goto l328 } - goto l326 - l327: - position, tokenIndex, depth = position326, tokenIndex326, depth326 + goto l327 + l328: + position, tokenIndex, depth = position327, tokenIndex327, depth327 if !_rules[ruleLambdaExpr]() { - goto l324 + goto l325 } } - l326: + l327: depth-- - add(ruleLambda, position325) + add(ruleLambda, position326) } return true - l324: - position, tokenIndex, depth = position324, tokenIndex324, depth324 + l325: + position, tokenIndex, depth = position325, tokenIndex325, depth325 return false }, /* 83 LambdaRef <- <(req_ws Expression)> */ func() bool { - position328, tokenIndex328, depth328 := position, tokenIndex, depth + position329, tokenIndex329, depth329 := position, tokenIndex, depth { - position329 := position + position330 := position depth++ if !_rules[rulereq_ws]() { - goto l328 + goto l329 } if !_rules[ruleExpression]() { - goto l328 + goto l329 } depth-- - add(ruleLambdaRef, position329) + add(ruleLambdaRef, position330) } return true - l328: - position, tokenIndex, depth = position328, tokenIndex328, depth328 + l329: + position, tokenIndex, depth = position329, tokenIndex329, depth329 return false }, /* 84 LambdaExpr <- <(ws Params ws ('-' '>') Expression)> */ func() bool { - position330, tokenIndex330, depth330 := position, tokenIndex, depth + position331, tokenIndex331, depth331 := position, tokenIndex, depth { - position331 := position + position332 := position depth++ if !_rules[rulews]() { - goto l330 + goto l331 } if !_rules[ruleParams]() { - goto l330 + goto l331 } if !_rules[rulews]() { - goto l330 + goto l331 } if buffer[position] != rune('-') { - goto l330 + goto l331 } position++ if buffer[position] != rune('>') { - goto l330 + goto l331 } position++ if !_rules[ruleExpression]() { - goto l330 + goto l331 } depth-- - add(ruleLambdaExpr, position331) + add(ruleLambdaExpr, position332) } return true - l330: - position, tokenIndex, depth = position330, tokenIndex330, depth330 + l331: + position, tokenIndex, depth = position331, tokenIndex331, depth331 return false }, /* 85 Params <- <('|' StartParams ws Names? '|')> */ func() bool { - position332, tokenIndex332, depth332 := position, tokenIndex, depth + position333, tokenIndex333, depth333 := position, tokenIndex, depth { - position333 := position + position334 := position depth++ if buffer[position] != rune('|') { - goto l332 + goto l333 } position++ if !_rules[ruleStartParams]() { - goto l332 + goto l333 } if !_rules[rulews]() { - goto l332 + goto l333 } { - position334, tokenIndex334, depth334 := position, tokenIndex, depth + position335, tokenIndex335, depth335 := position, tokenIndex, depth if !_rules[ruleNames]() { - goto l334 + goto l335 } - goto l335 - l334: - position, tokenIndex, depth = position334, tokenIndex334, depth334 + goto l336 + l335: + position, tokenIndex, depth = position335, tokenIndex335, depth335 } - l335: + l336: if buffer[position] != rune('|') { - goto l332 + goto l333 } position++ depth-- - add(ruleParams, position333) + add(ruleParams, position334) } return true - l332: - position, tokenIndex, depth = position332, tokenIndex332, depth332 + l333: + position, tokenIndex, depth = position333, tokenIndex333, depth333 return false }, /* 86 StartParams <- */ func() bool { - position336, tokenIndex336, depth336 := position, tokenIndex, depth + position337, tokenIndex337, depth337 := position, tokenIndex, depth { - position337 := position + position338 := position depth++ if !_rules[ruleAction2]() { - goto l336 + goto l337 } depth-- - add(ruleStartParams, position337) + add(ruleStartParams, position338) } return true - l336: - position, tokenIndex, depth = position336, tokenIndex336, depth336 + l337: + position, tokenIndex, depth = position337, tokenIndex337, depth337 return false }, /* 87 Names <- <(NextName (',' NextName)* DefaultValue? (',' NextName DefaultValue)* VarParams?)> */ func() bool { - position338, tokenIndex338, depth338 := position, tokenIndex, depth + position339, tokenIndex339, depth339 := position, tokenIndex, depth { - position339 := position + position340 := position depth++ if !_rules[ruleNextName]() { - goto l338 + goto l339 } - l340: + l341: { - position341, tokenIndex341, depth341 := position, tokenIndex, depth + position342, tokenIndex342, depth342 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l341 + goto l342 } position++ if !_rules[ruleNextName]() { - goto l341 + goto l342 } - goto l340 - l341: - position, tokenIndex, depth = position341, tokenIndex341, depth341 + goto l341 + l342: + position, tokenIndex, depth = position342, tokenIndex342, depth342 } { - position342, tokenIndex342, depth342 := position, tokenIndex, depth + position343, tokenIndex343, depth343 := position, tokenIndex, depth if !_rules[ruleDefaultValue]() { - goto l342 + goto l343 } - goto l343 - l342: - position, tokenIndex, depth = position342, tokenIndex342, depth342 + goto l344 + l343: + position, tokenIndex, depth = position343, tokenIndex343, depth343 } - l343: l344: + l345: { - position345, tokenIndex345, depth345 := position, tokenIndex, depth + position346, tokenIndex346, depth346 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l345 + goto l346 } position++ if !_rules[ruleNextName]() { - goto l345 + goto l346 } if !_rules[ruleDefaultValue]() { - goto l345 + goto l346 } - goto l344 - l345: - position, tokenIndex, depth = position345, tokenIndex345, depth345 + goto l345 + l346: + position, tokenIndex, depth = position346, tokenIndex346, depth346 } { - position346, tokenIndex346, depth346 := position, tokenIndex, depth + position347, tokenIndex347, depth347 := position, tokenIndex, depth if !_rules[ruleVarParams]() { - goto l346 + goto l347 } - goto l347 - l346: - position, tokenIndex, depth = position346, tokenIndex346, depth346 + goto l348 + l347: + position, tokenIndex, depth = position347, tokenIndex347, depth347 } - l347: + l348: depth-- - add(ruleNames, position339) + add(ruleNames, position340) } return true - l338: - position, tokenIndex, depth = position338, tokenIndex338, depth338 + l339: + position, tokenIndex, depth = position339, tokenIndex339, depth339 return false }, /* 88 NextName <- <(ws Name ws)> */ func() bool { - position348, tokenIndex348, depth348 := position, tokenIndex, depth + position349, tokenIndex349, depth349 := position, tokenIndex, depth { - position349 := position + position350 := position depth++ if !_rules[rulews]() { - goto l348 + goto l349 } if !_rules[ruleName]() { - goto l348 + goto l349 } if !_rules[rulews]() { - goto l348 + goto l349 } depth-- - add(ruleNextName, position349) + add(ruleNextName, position350) } return true - l348: - position, tokenIndex, depth = position348, tokenIndex348, depth348 + l349: + position, tokenIndex, depth = position349, tokenIndex349, depth349 return false }, /* 89 Name <- <([a-z] / [A-Z] / [0-9] / '_')+> */ func() bool { - position350, tokenIndex350, depth350 := position, tokenIndex, depth + position351, tokenIndex351, depth351 := position, tokenIndex, depth { - position351 := position + position352 := position depth++ { - position354, tokenIndex354, depth354 := position, tokenIndex, depth + position355, tokenIndex355, depth355 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l355 - } - position++ - goto l354 - l355: - position, tokenIndex, depth = position354, tokenIndex354, depth354 - if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l356 } position++ - goto l354 + goto l355 l356: - position, tokenIndex, depth = position354, tokenIndex354, depth354 - if c := buffer[position]; c < rune('0') || c > rune('9') { + position, tokenIndex, depth = position355, tokenIndex355, depth355 + if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l357 } position++ - goto l354 + goto l355 l357: - position, tokenIndex, depth = position354, tokenIndex354, depth354 + position, tokenIndex, depth = position355, tokenIndex355, depth355 + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l358 + } + position++ + goto l355 + l358: + position, tokenIndex, depth = position355, tokenIndex355, depth355 if buffer[position] != rune('_') { - goto l350 + goto l351 } position++ } - l354: - l352: + l355: + l353: { - position353, tokenIndex353, depth353 := position, tokenIndex, depth + position354, tokenIndex354, depth354 := position, tokenIndex, depth { - position358, tokenIndex358, depth358 := position, tokenIndex, depth + position359, tokenIndex359, depth359 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l359 - } - position++ - goto l358 - l359: - position, tokenIndex, depth = position358, tokenIndex358, depth358 - if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l360 } position++ - goto l358 + goto l359 l360: - position, tokenIndex, depth = position358, tokenIndex358, depth358 - if c := buffer[position]; c < rune('0') || c > rune('9') { + position, tokenIndex, depth = position359, tokenIndex359, depth359 + if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l361 } position++ - goto l358 + goto l359 l361: - position, tokenIndex, depth = position358, tokenIndex358, depth358 + position, tokenIndex, depth = position359, tokenIndex359, depth359 + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l362 + } + position++ + goto l359 + l362: + position, tokenIndex, depth = position359, tokenIndex359, depth359 if buffer[position] != rune('_') { - goto l353 + goto l354 } position++ } - l358: - goto l352 - l353: - position, tokenIndex, depth = position353, tokenIndex353, depth353 + l359: + goto l353 + l354: + position, tokenIndex, depth = position354, tokenIndex354, depth354 } depth-- - add(ruleName, position351) + add(ruleName, position352) } return true - l350: - position, tokenIndex, depth = position350, tokenIndex350, depth350 + l351: + position, tokenIndex, depth = position351, tokenIndex351, depth351 return false }, /* 90 DefaultValue <- <('=' Expression)> */ func() bool { - position362, tokenIndex362, depth362 := position, tokenIndex, depth + position363, tokenIndex363, depth363 := position, tokenIndex, depth { - position363 := position + position364 := position depth++ if buffer[position] != rune('=') { - goto l362 + goto l363 } position++ if !_rules[ruleExpression]() { - goto l362 + goto l363 } depth-- - add(ruleDefaultValue, position363) + add(ruleDefaultValue, position364) } return true - l362: - position, tokenIndex, depth = position362, tokenIndex362, depth362 + l363: + position, tokenIndex, depth = position363, tokenIndex363, depth363 return false }, /* 91 VarParams <- <('.' '.' '.' ws)> */ func() bool { - position364, tokenIndex364, depth364 := position, tokenIndex, depth + position365, tokenIndex365, depth365 := position, tokenIndex, depth { - position365 := position + position366 := position depth++ if buffer[position] != rune('.') { - goto l364 + goto l365 } position++ if buffer[position] != rune('.') { - goto l364 + goto l365 } position++ if buffer[position] != rune('.') { - goto l364 + goto l365 } position++ if !_rules[rulews]() { - goto l364 + goto l365 } depth-- - add(ruleVarParams, position365) + add(ruleVarParams, position366) } return true - l364: - position, tokenIndex, depth = position364, tokenIndex364, depth364 + l365: + position, tokenIndex, depth = position365, tokenIndex365, depth365 return false }, /* 92 Reference <- <(((Tag ('.' / Key)) / ('.'? Key)) FollowUpRef)> */ func() bool { - position366, tokenIndex366, depth366 := position, tokenIndex, depth + position367, tokenIndex367, depth367 := position, tokenIndex, depth { - position367 := position + position368 := position depth++ { - position368, tokenIndex368, depth368 := position, tokenIndex, depth + position369, tokenIndex369, depth369 := position, tokenIndex, depth if !_rules[ruleTag]() { - goto l369 + goto l370 } { - position370, tokenIndex370, depth370 := position, tokenIndex, depth + position371, tokenIndex371, depth371 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l371 + goto l372 } position++ - goto l370 - l371: - position, tokenIndex, depth = position370, tokenIndex370, depth370 + goto l371 + l372: + position, tokenIndex, depth = position371, tokenIndex371, depth371 if !_rules[ruleKey]() { - goto l369 + goto l370 } } + l371: + goto l369 l370: - goto l368 - l369: - position, tokenIndex, depth = position368, tokenIndex368, depth368 + position, tokenIndex, depth = position369, tokenIndex369, depth369 { - position372, tokenIndex372, depth372 := position, tokenIndex, depth + position373, tokenIndex373, depth373 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l372 + goto l373 } position++ - goto l373 - l372: - position, tokenIndex, depth = position372, tokenIndex372, depth372 + goto l374 + l373: + position, tokenIndex, depth = position373, tokenIndex373, depth373 } - l373: + l374: if !_rules[ruleKey]() { - goto l366 + goto l367 } } - l368: + l369: if !_rules[ruleFollowUpRef]() { - goto l366 + goto l367 } depth-- - add(ruleReference, position367) + add(ruleReference, position368) } return true - l366: - position, tokenIndex, depth = position366, tokenIndex366, depth366 + l367: + position, tokenIndex, depth = position367, tokenIndex367, depth367 return false }, - /* 93 Tag <- <(TagName (':' ':'))> */ + /* 93 Tag <- <((TagName / [0-9]+) (':' ':'))> */ func() bool { - position374, tokenIndex374, depth374 := position, tokenIndex, depth + position375, tokenIndex375, depth375 := position, tokenIndex, depth { - position375 := position + position376 := position depth++ - if !_rules[ruleTagName]() { - goto l374 + { + position377, tokenIndex377, depth377 := position, tokenIndex, depth + if !_rules[ruleTagName]() { + goto l378 + } + goto l377 + l378: + position, tokenIndex, depth = position377, tokenIndex377, depth377 + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l375 + } + position++ + l379: + { + position380, tokenIndex380, depth380 := position, tokenIndex, depth + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l380 + } + position++ + goto l379 + l380: + position, tokenIndex, depth = position380, tokenIndex380, depth380 + } } + l377: if buffer[position] != rune(':') { - goto l374 + goto l375 } position++ if buffer[position] != rune(':') { - goto l374 + goto l375 } position++ depth-- - add(ruleTag, position375) + add(ruleTag, position376) } return true - l374: - position, tokenIndex, depth = position374, tokenIndex374, depth374 + l375: + position, tokenIndex, depth = position375, tokenIndex375, depth375 return false }, - /* 94 TagName <- <([a-z] / [A-Z] / [0-9] / '_')+> */ + /* 94 TagName <- <(([a-z] / [A-Z] / '_') ([a-z] / [A-Z] / [0-9] / '_')*)> */ func() bool { - position376, tokenIndex376, depth376 := position, tokenIndex, depth + position381, tokenIndex381, depth381 := position, tokenIndex, depth { - position377 := position + position382 := position depth++ { - position380, tokenIndex380, depth380 := position, tokenIndex, depth + position383, tokenIndex383, depth383 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l381 + goto l384 } position++ - goto l380 - l381: - position, tokenIndex, depth = position380, tokenIndex380, depth380 + goto l383 + l384: + position, tokenIndex, depth = position383, tokenIndex383, depth383 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l382 + goto l385 } position++ - goto l380 - l382: - position, tokenIndex, depth = position380, tokenIndex380, depth380 - if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l383 - } - position++ - goto l380 - l383: - position, tokenIndex, depth = position380, tokenIndex380, depth380 + goto l383 + l385: + position, tokenIndex, depth = position383, tokenIndex383, depth383 if buffer[position] != rune('_') { - goto l376 + goto l381 } position++ } - l380: - l378: + l383: + l386: { - position379, tokenIndex379, depth379 := position, tokenIndex, depth + position387, tokenIndex387, depth387 := position, tokenIndex, depth { - position384, tokenIndex384, depth384 := position, tokenIndex, depth + position388, tokenIndex388, depth388 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l385 + goto l389 } position++ - goto l384 - l385: - position, tokenIndex, depth = position384, tokenIndex384, depth384 + goto l388 + l389: + position, tokenIndex, depth = position388, tokenIndex388, depth388 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l386 + goto l390 } position++ - goto l384 - l386: - position, tokenIndex, depth = position384, tokenIndex384, depth384 + goto l388 + l390: + position, tokenIndex, depth = position388, tokenIndex388, depth388 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l387 + goto l391 } position++ - goto l384 - l387: - position, tokenIndex, depth = position384, tokenIndex384, depth384 + goto l388 + l391: + position, tokenIndex, depth = position388, tokenIndex388, depth388 if buffer[position] != rune('_') { - goto l379 + goto l387 } position++ } - l384: - goto l378 - l379: - position, tokenIndex, depth = position379, tokenIndex379, depth379 + l388: + goto l386 + l387: + position, tokenIndex, depth = position387, tokenIndex387, depth387 } depth-- - add(ruleTagName, position377) + add(ruleTagName, position382) } return true - l376: - position, tokenIndex, depth = position376, tokenIndex376, depth376 + l381: + position, tokenIndex, depth = position381, tokenIndex381, depth381 return false }, /* 95 FollowUpRef <- */ func() bool { { - position389 := position + position393 := position depth++ - l390: + l394: { - position391, tokenIndex391, depth391 := position, tokenIndex, depth + position395, tokenIndex395, depth395 := position, tokenIndex, depth if !_rules[rulePathComponent]() { - goto l391 + goto l395 } - goto l390 - l391: - position, tokenIndex, depth = position391, tokenIndex391, depth391 + goto l394 + l395: + position, tokenIndex, depth = position395, tokenIndex395, depth395 } depth-- - add(ruleFollowUpRef, position389) + add(ruleFollowUpRef, position393) } return true }, /* 96 PathComponent <- <(('.' Key) / ('.'? Index))> */ func() bool { - position392, tokenIndex392, depth392 := position, tokenIndex, depth + position396, tokenIndex396, depth396 := position, tokenIndex, depth { - position393 := position + position397 := position depth++ { - position394, tokenIndex394, depth394 := position, tokenIndex, depth + position398, tokenIndex398, depth398 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l395 + goto l399 } position++ if !_rules[ruleKey]() { - goto l395 + goto l399 } - goto l394 - l395: - position, tokenIndex, depth = position394, tokenIndex394, depth394 + goto l398 + l399: + position, tokenIndex, depth = position398, tokenIndex398, depth398 { - position396, tokenIndex396, depth396 := position, tokenIndex, depth + position400, tokenIndex400, depth400 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l396 + goto l400 } position++ - goto l397 - l396: - position, tokenIndex, depth = position396, tokenIndex396, depth396 + goto l401 + l400: + position, tokenIndex, depth = position400, tokenIndex400, depth400 } - l397: + l401: if !_rules[ruleIndex]() { - goto l392 + goto l396 } } - l394: + l398: depth-- - add(rulePathComponent, position393) + add(rulePathComponent, position397) } return true - l392: - position, tokenIndex, depth = position392, tokenIndex392, depth392 + l396: + position, tokenIndex, depth = position396, tokenIndex396, depth396 return false }, /* 97 Key <- <(([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')* (':' ([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')*)?)> */ func() bool { - position398, tokenIndex398, depth398 := position, tokenIndex, depth + position402, tokenIndex402, depth402 := position, tokenIndex, depth { - position399 := position + position403 := position depth++ { - position400, tokenIndex400, depth400 := position, tokenIndex, depth + position404, tokenIndex404, depth404 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l401 + goto l405 } position++ - goto l400 - l401: - position, tokenIndex, depth = position400, tokenIndex400, depth400 + goto l404 + l405: + position, tokenIndex, depth = position404, tokenIndex404, depth404 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l402 + goto l406 } position++ - goto l400 - l402: - position, tokenIndex, depth = position400, tokenIndex400, depth400 + goto l404 + l406: + position, tokenIndex, depth = position404, tokenIndex404, depth404 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l403 + goto l407 } position++ - goto l400 - l403: - position, tokenIndex, depth = position400, tokenIndex400, depth400 + goto l404 + l407: + position, tokenIndex, depth = position404, tokenIndex404, depth404 if buffer[position] != rune('_') { - goto l398 + goto l402 } position++ } - l400: l404: + l408: { - position405, tokenIndex405, depth405 := position, tokenIndex, depth + position409, tokenIndex409, depth409 := position, tokenIndex, depth { - position406, tokenIndex406, depth406 := position, tokenIndex, depth + position410, tokenIndex410, depth410 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l407 + goto l411 } position++ - goto l406 - l407: - position, tokenIndex, depth = position406, tokenIndex406, depth406 + goto l410 + l411: + position, tokenIndex, depth = position410, tokenIndex410, depth410 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l408 + goto l412 } position++ - goto l406 - l408: - position, tokenIndex, depth = position406, tokenIndex406, depth406 + goto l410 + l412: + position, tokenIndex, depth = position410, tokenIndex410, depth410 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l413 } position++ - goto l406 - l409: - position, tokenIndex, depth = position406, tokenIndex406, depth406 + goto l410 + l413: + position, tokenIndex, depth = position410, tokenIndex410, depth410 if buffer[position] != rune('_') { - goto l410 + goto l414 } position++ - goto l406 - l410: - position, tokenIndex, depth = position406, tokenIndex406, depth406 + goto l410 + l414: + position, tokenIndex, depth = position410, tokenIndex410, depth410 if buffer[position] != rune('-') { - goto l405 + goto l409 } position++ } - l406: - goto l404 - l405: - position, tokenIndex, depth = position405, tokenIndex405, depth405 + l410: + goto l408 + l409: + position, tokenIndex, depth = position409, tokenIndex409, depth409 } { - position411, tokenIndex411, depth411 := position, tokenIndex, depth + position415, tokenIndex415, depth415 := position, tokenIndex, depth if buffer[position] != rune(':') { - goto l411 + goto l415 } position++ { - position413, tokenIndex413, depth413 := position, tokenIndex, depth + position417, tokenIndex417, depth417 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l414 + goto l418 } position++ - goto l413 - l414: - position, tokenIndex, depth = position413, tokenIndex413, depth413 + goto l417 + l418: + position, tokenIndex, depth = position417, tokenIndex417, depth417 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l415 + goto l419 } position++ - goto l413 - l415: - position, tokenIndex, depth = position413, tokenIndex413, depth413 + goto l417 + l419: + position, tokenIndex, depth = position417, tokenIndex417, depth417 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l416 + goto l420 } position++ - goto l413 - l416: - position, tokenIndex, depth = position413, tokenIndex413, depth413 + goto l417 + l420: + position, tokenIndex, depth = position417, tokenIndex417, depth417 if buffer[position] != rune('_') { - goto l411 + goto l415 } position++ } - l413: l417: + l421: { - position418, tokenIndex418, depth418 := position, tokenIndex, depth + position422, tokenIndex422, depth422 := position, tokenIndex, depth { - position419, tokenIndex419, depth419 := position, tokenIndex, depth + position423, tokenIndex423, depth423 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l420 + goto l424 } position++ - goto l419 - l420: - position, tokenIndex, depth = position419, tokenIndex419, depth419 + goto l423 + l424: + position, tokenIndex, depth = position423, tokenIndex423, depth423 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l421 + goto l425 } position++ - goto l419 - l421: - position, tokenIndex, depth = position419, tokenIndex419, depth419 + goto l423 + l425: + position, tokenIndex, depth = position423, tokenIndex423, depth423 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l422 + goto l426 } position++ - goto l419 - l422: - position, tokenIndex, depth = position419, tokenIndex419, depth419 + goto l423 + l426: + position, tokenIndex, depth = position423, tokenIndex423, depth423 if buffer[position] != rune('_') { - goto l423 + goto l427 } position++ - goto l419 - l423: - position, tokenIndex, depth = position419, tokenIndex419, depth419 + goto l423 + l427: + position, tokenIndex, depth = position423, tokenIndex423, depth423 if buffer[position] != rune('-') { - goto l418 + goto l422 } position++ } - l419: - goto l417 - l418: - position, tokenIndex, depth = position418, tokenIndex418, depth418 + l423: + goto l421 + l422: + position, tokenIndex, depth = position422, tokenIndex422, depth422 } - goto l412 - l411: - position, tokenIndex, depth = position411, tokenIndex411, depth411 + goto l416 + l415: + position, tokenIndex, depth = position415, tokenIndex415, depth415 } - l412: + l416: depth-- - add(ruleKey, position399) + add(ruleKey, position403) } return true - l398: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + l402: + position, tokenIndex, depth = position402, tokenIndex402, depth402 return false }, /* 98 Index <- <('[' '-'? [0-9]+ ']')> */ func() bool { - position424, tokenIndex424, depth424 := position, tokenIndex, depth + position428, tokenIndex428, depth428 := position, tokenIndex, depth { - position425 := position + position429 := position depth++ if buffer[position] != rune('[') { - goto l424 + goto l428 } position++ { - position426, tokenIndex426, depth426 := position, tokenIndex, depth + position430, tokenIndex430, depth430 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l426 + goto l430 } position++ - goto l427 - l426: - position, tokenIndex, depth = position426, tokenIndex426, depth426 + goto l431 + l430: + position, tokenIndex, depth = position430, tokenIndex430, depth430 } - l427: + l431: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l424 + goto l428 } position++ - l428: + l432: { - position429, tokenIndex429, depth429 := position, tokenIndex, depth + position433, tokenIndex433, depth433 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l429 + goto l433 } position++ - goto l428 - l429: - position, tokenIndex, depth = position429, tokenIndex429, depth429 + goto l432 + l433: + position, tokenIndex, depth = position433, tokenIndex433, depth433 } if buffer[position] != rune(']') { - goto l424 + goto l428 } position++ depth-- - add(ruleIndex, position425) + add(ruleIndex, position429) } return true - l424: - position, tokenIndex, depth = position424, tokenIndex424, depth424 + l428: + position, tokenIndex, depth = position428, tokenIndex428, depth428 return false }, /* 99 IP <- <([0-9]+ '.' [0-9]+ '.' [0-9]+ '.' [0-9]+)> */ func() bool { - position430, tokenIndex430, depth430 := position, tokenIndex, depth + position434, tokenIndex434, depth434 := position, tokenIndex, depth { - position431 := position + position435 := position depth++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l430 + goto l434 } position++ - l432: + l436: { - position433, tokenIndex433, depth433 := position, tokenIndex, depth + position437, tokenIndex437, depth437 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l433 + goto l437 } position++ - goto l432 - l433: - position, tokenIndex, depth = position433, tokenIndex433, depth433 + goto l436 + l437: + position, tokenIndex, depth = position437, tokenIndex437, depth437 } if buffer[position] != rune('.') { - goto l430 + goto l434 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l430 + goto l434 } position++ - l434: + l438: { - position435, tokenIndex435, depth435 := position, tokenIndex, depth + position439, tokenIndex439, depth439 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l435 + goto l439 } position++ - goto l434 - l435: - position, tokenIndex, depth = position435, tokenIndex435, depth435 + goto l438 + l439: + position, tokenIndex, depth = position439, tokenIndex439, depth439 } if buffer[position] != rune('.') { - goto l430 + goto l434 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l430 + goto l434 } position++ - l436: + l440: { - position437, tokenIndex437, depth437 := position, tokenIndex, depth + position441, tokenIndex441, depth441 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l437 + goto l441 } position++ - goto l436 - l437: - position, tokenIndex, depth = position437, tokenIndex437, depth437 + goto l440 + l441: + position, tokenIndex, depth = position441, tokenIndex441, depth441 } if buffer[position] != rune('.') { - goto l430 + goto l434 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l430 + goto l434 } position++ - l438: + l442: { - position439, tokenIndex439, depth439 := position, tokenIndex, depth + position443, tokenIndex443, depth443 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l439 + goto l443 } position++ - goto l438 - l439: - position, tokenIndex, depth = position439, tokenIndex439, depth439 + goto l442 + l443: + position, tokenIndex, depth = position443, tokenIndex443, depth443 } depth-- - add(ruleIP, position431) + add(ruleIP, position435) } return true - l430: - position, tokenIndex, depth = position430, tokenIndex430, depth430 + l434: + position, tokenIndex, depth = position434, tokenIndex434, depth434 return false }, /* 100 ws <- <(' ' / '\t' / '\n' / '\r')*> */ func() bool { { - position441 := position + position445 := position depth++ - l442: + l446: { - position443, tokenIndex443, depth443 := position, tokenIndex, depth + position447, tokenIndex447, depth447 := position, tokenIndex, depth { - position444, tokenIndex444, depth444 := position, tokenIndex, depth + position448, tokenIndex448, depth448 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l445 + goto l449 } position++ - goto l444 - l445: - position, tokenIndex, depth = position444, tokenIndex444, depth444 + goto l448 + l449: + position, tokenIndex, depth = position448, tokenIndex448, depth448 if buffer[position] != rune('\t') { - goto l446 + goto l450 } position++ - goto l444 - l446: - position, tokenIndex, depth = position444, tokenIndex444, depth444 + goto l448 + l450: + position, tokenIndex, depth = position448, tokenIndex448, depth448 if buffer[position] != rune('\n') { - goto l447 + goto l451 } position++ - goto l444 - l447: - position, tokenIndex, depth = position444, tokenIndex444, depth444 + goto l448 + l451: + position, tokenIndex, depth = position448, tokenIndex448, depth448 if buffer[position] != rune('\r') { - goto l443 + goto l447 } position++ } - l444: - goto l442 - l443: - position, tokenIndex, depth = position443, tokenIndex443, depth443 + l448: + goto l446 + l447: + position, tokenIndex, depth = position447, tokenIndex447, depth447 } depth-- - add(rulews, position441) + add(rulews, position445) } return true }, /* 101 req_ws <- <(' ' / '\t' / '\n' / '\r')+> */ func() bool { - position448, tokenIndex448, depth448 := position, tokenIndex, depth + position452, tokenIndex452, depth452 := position, tokenIndex, depth { - position449 := position + position453 := position depth++ { - position452, tokenIndex452, depth452 := position, tokenIndex, depth + position456, tokenIndex456, depth456 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l453 + goto l457 } position++ - goto l452 - l453: - position, tokenIndex, depth = position452, tokenIndex452, depth452 + goto l456 + l457: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\t') { - goto l454 + goto l458 } position++ - goto l452 - l454: - position, tokenIndex, depth = position452, tokenIndex452, depth452 + goto l456 + l458: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\n') { - goto l455 + goto l459 } position++ - goto l452 - l455: - position, tokenIndex, depth = position452, tokenIndex452, depth452 + goto l456 + l459: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\r') { - goto l448 + goto l452 } position++ } - l452: - l450: + l456: + l454: { - position451, tokenIndex451, depth451 := position, tokenIndex, depth + position455, tokenIndex455, depth455 := position, tokenIndex, depth { - position456, tokenIndex456, depth456 := position, tokenIndex, depth + position460, tokenIndex460, depth460 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l457 + goto l461 } position++ - goto l456 - l457: - position, tokenIndex, depth = position456, tokenIndex456, depth456 + goto l460 + l461: + position, tokenIndex, depth = position460, tokenIndex460, depth460 if buffer[position] != rune('\t') { - goto l458 + goto l462 } position++ - goto l456 - l458: - position, tokenIndex, depth = position456, tokenIndex456, depth456 + goto l460 + l462: + position, tokenIndex, depth = position460, tokenIndex460, depth460 if buffer[position] != rune('\n') { - goto l459 + goto l463 } position++ - goto l456 - l459: - position, tokenIndex, depth = position456, tokenIndex456, depth456 + goto l460 + l463: + position, tokenIndex, depth = position460, tokenIndex460, depth460 if buffer[position] != rune('\r') { - goto l451 + goto l455 } position++ } - l456: - goto l450 - l451: - position, tokenIndex, depth = position451, tokenIndex451, depth451 + l460: + goto l454 + l455: + position, tokenIndex, depth = position455, tokenIndex455, depth455 } depth-- - add(rulereq_ws, position449) + add(rulereq_ws, position453) } return true - l448: - position, tokenIndex, depth = position448, tokenIndex448, depth448 + l452: + position, tokenIndex, depth = position452, tokenIndex452, depth452 return false }, /* 103 Action0 <- <{}> */ diff --git a/dynaml/parser_test.go b/dynaml/parser_test.go index 4ecbc79..35f215a 100644 --- a/dynaml/parser_test.go +++ b/dynaml/parser_test.go @@ -42,6 +42,8 @@ var _ = Describe("parsing", func() { "&temporary", "&state", "&inject", + "&local", + "&default", "&tag:test", } var entries []TableEntry diff --git a/flow/cascade.go b/flow/cascade.go index 6f449dc..40997b9 100644 --- a/flow/cascade.go +++ b/flow/cascade.go @@ -57,6 +57,13 @@ func discardTemporary(node yaml.Node) (yaml.Node, CleanupFunction) { return node, discardTemporary } +func discardTags(node yaml.Node) (yaml.Node, CleanupFunction) { + if node.GetAnnotation().Tag() != "" { + return yaml.SetTag(node, ""), discardTags + } + return node, discardTags +} + func unescapeDynamlFunc(binding dynaml.Binding) CleanupFunction { interpol := binding != nil && binding.GetState().InterpolationEnabled() var f CleanupFunction diff --git a/flow/flow_tag_test.go b/flow/flow_tag_test.go index 195aa0c..58e2f68 100644 --- a/flow/flow_tag_test.go +++ b/flow/flow_tag_test.go @@ -52,6 +52,27 @@ data: v: c: value +`) + Expect(source).To(FlowAs(resolved)) + }) + It("handles simple value tag", func() { + source := parseYAML(` +--- +data: + nested: + v: (( tag::. )) + a: + b: + c: (( &tag:tag("value") )) +`) + resolved := parseYAML(` +--- +data: + a: + b: + c: value + nested: + v: value `) Expect(source).To(FlowAs(resolved)) }) diff --git a/flow/state.go b/flow/state.go index f18967a..7fc361e 100644 --- a/flow/state.go +++ b/flow/state.go @@ -64,6 +64,14 @@ func (s *State) SetFunctions(f dynaml.Registry) *State { return s } +func (s *State) SetTags(tags ...*dynaml.Tag) *State { + s.tags = map[string]*dynaml.Tag{} + for _, v := range tags { + s.tags[v.Name()] = v + } + return s +} + func (s *State) EnableInterpolation() { s.interpolation = true } @@ -127,7 +135,7 @@ func (s *State) SetTag(name string, node yaml.Node, path []string) error { return fmt.Errorf("duplicate tag %q: %s <-> %s", name, strings.Join(path, "."), strings.Join(old.Path(), ".")) } } - s.tags[name] = dynaml.NewTag(name, node, path) + s.tags[name] = dynaml.NewTag(name, Cleanup(node, discardTags), path) return nil } diff --git a/spiffing/interface.go b/spiffing/interface.go index c5464bc..fd531d3 100644 --- a/spiffing/interface.go +++ b/spiffing/interface.go @@ -55,6 +55,18 @@ type Spiff interface { // elements in the processed documents. WithValues(values map[string]interface{}) (Spiff, error) + // SetTag sets/resets a tag for subsequent processings. + // This can be used to set implicit document tags + // when simulating a multi-document processing. + // Please note: preconfiguted tags are only used by the + // ApplyStubs method. + SetTag(tag string, node yaml.Node) Spiff + + // CleanupTags deletes tags of spiff context + CleanupTags() Spiff + // Reset flushes the binding state + Reset() Spiff + // FileSystem return the virtual filesystem set for the execution context. FileSystem() vfs.FileSystem // FileSource create a new file source based on the configured file system. @@ -84,12 +96,15 @@ type Spiff interface { Normalize(node Node) (interface{}, error) // Cascade processes a template with a list of given subs and state - // documents + // documents. + // Please note: configured implicit tag settings are ignored. Cascade(template Node, stubs []Node, states ...Node) (Node, error) // PrepareStubs processes a list a stubs and returns a prepared // represenation usable to process a template + // Please note: configured implicit tag settings are ignored. PrepareStubs(stubs ...Node) ([]Node, error) // ApplyStubs uses already prepared subs to process a template. + // Please note: configured implicit tag settings are obeyed. ApplyStubs(template Node, preparedstubs []Node) (Node, error) } diff --git a/spiffing/spiff.go b/spiffing/spiff.go index 9442c56..114fb57 100644 --- a/spiffing/spiff.go +++ b/spiffing/spiff.go @@ -67,6 +67,7 @@ type spiff struct { opts flow.Options values map[string]yaml.Node functions Functions + tags map[string]*dynaml.Tag interpolation bool binding dynaml.Binding @@ -88,23 +89,43 @@ func New() Spiff { } } -func (s *spiff) reset() Spiff { +func (s *spiff) Reset() Spiff { s.binding = nil return s } +func (s *spiff) assureBinding(useTags bool) { + if s.binding == nil { + state := flow.NewState(s.key, s.mode, s.fs). + SetFunctions(s.functions). + SetInterpolation(s.interpolation) + if useTags && len(s.tags) > 0 { + var tags []*dynaml.Tag + for _, t := range s.tags { + tags = append(tags, t) + } + state.SetTags(tags...) + } + s.binding = flow.NewEnvironment( + nil, "context", state) + if s.values != nil { + s.binding = s.binding.WithLocalScope(s.values) + } + } +} + // WithInterpolation creates a new context with // enabled/disabled string interpolation feature func (s spiff) WithInterpolation(b bool) Spiff { s.interpolation = b - return s.reset() + return s.Reset() } // WithEncryptionKey creates a new context with // dedicated encryption key used for the spiff encryption feature func (s spiff) WithEncryptionKey(key string) Spiff { s.key = key - return s.reset() + return s.Reset() } // WithMode creates a new context with the given processing mode. @@ -114,7 +135,7 @@ func (s spiff) WithMode(mode int) Spiff { mode = mode & ^MODE_OS_ACCESS } s.mode = mode - return s.reset() + return s.Reset() } // WithFileSystem creates a new context with the given @@ -126,14 +147,14 @@ func (s spiff) WithFileSystem(fs vfs.FileSystem) Spiff { if fs != nil { s.mode = s.mode & ^MODE_OS_ACCESS } - return s.reset() + return s.Reset() } // WithFunctions creates a new context with the given // additional function definitions func (s spiff) WithFunctions(functions Functions) Spiff { s.functions = functions - return s.reset() + return s.Reset() } // WithValues creates a new context with the given @@ -152,7 +173,15 @@ func (s spiff) WithValues(values map[string]interface{}) (Spiff, error) { } else { s.values = nil } - return s.reset(), nil + return s.Reset(), nil +} + +// SetTag sets/resets a tag for subsequent processings. +// This can be used to set implicit document tags +// when simulating a multi-document processing +func (s spiff) SetTag(tag string, node yaml.Node) Spiff { + s.tags[tag] = dynaml.NewTag(tag, node, nil) + return s.Reset() } // FileSystem return the virtual filesystem set for the execution context. @@ -165,30 +194,35 @@ func (s *spiff) FileSource(path string) Source { return NewSourceFile(path, s.fs) } +// CleanupTags deletes all gathered tags +func (s *spiff) CleanupTags() Spiff { + s.binding = nil + s.tags = map[string]*dynaml.Tag{} + return s +} + // Cascade processes a template with a list of given subs and state // documents func (s *spiff) Cascade(template Node, stubs []Node, states ...Node) (Node, error) { - if s.binding == nil { - s.binding = flow.NewEnvironment( - nil, "context", - flow.NewState(s.key, s.mode, s.fs). - SetFunctions(s.functions). - SetInterpolation(s.interpolation)) - if s.values != nil { - s.binding = s.binding.WithLocalScope(s.values) - } - } + s.Reset() + s.assureBinding(false) + defer s.Reset() return flow.Cascade(s.binding, template, s.opts, append(stubs, states...)...) } // PrepareStubs processes a list a stubs and returns a prepared // represenation usable to process a template func (s *spiff) PrepareStubs(stubs ...Node) ([]Node, error) { + s.Reset() + s.assureBinding(false) + defer s.Reset() return flow.PrepareStubs(s.binding, s.opts.Partial, stubs...) } // ApplyStubs uses already prepared subs to process a template. +// It uses the configured implicit tag settings. func (s *spiff) ApplyStubs(template Node, preparedstubs []Node) (Node, error) { + s.assureBinding(true) return flow.Apply(s.binding, template, preparedstubs, s.opts) } From 46ed65f493fe53263c36687907181ab73d309227 Mon Sep 17 00:00:00 2001 From: Uwe Krueger Date: Mon, 24 May 2021 23:46:40 +0200 Subject: [PATCH 3/5] relative document tags --- README.md | 11 + cmd/merge.go | 30 ++- dynaml/dynaml.peg | 2 +- dynaml/dynaml.peg.go | 547 +++++++++++++++++++++--------------------- dynaml/expression.go | 24 +- dynaml/reference.go | 25 +- flow/cascade.go | 4 +- flow/environment.go | 11 +- flow/state.go | 36 ++- spiffing/interface.go | 19 +- spiffing/spiff.go | 31 +-- 11 files changed, 427 insertions(+), 313 deletions(-) diff --git a/README.md b/README.md index 15c41f7..0984cb9 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,12 @@ The ` merge` command offers several options: consist of a map. Each key is used as additional binding. The bindings document is not processed, the values are used as defined. +- With option `--tag :` a yaml file can be specified, whose content + is used as value for a predefined global tag (see [Tags](#tags)). + Tags can be accessed by reference expressions of the form `::`. + In contrast to bindings tagged content does not compete with the nodes + in the document, it uses another reference namespace. + - With option `--define =` (shorthand`-D`) additional binding values can be specified on the command line overriding binding values from the binding file. The option may occur multiple times. @@ -4848,6 +4854,11 @@ prev: bob: 24 ``` +If the given document index is negative it denotes the document relative to the +one actually processed (so, the tag `-1` denotes the previous document). +The index `0` can be used to denote the actual document. Here always a path +must be specified, it is not possible to refer to the complete document +(with `.`). ## Templates diff --git a/cmd/merge.go b/cmd/merge.go index 2248cca..cdc7901 100644 --- a/cmd/merge.go +++ b/cmd/merge.go @@ -23,6 +23,7 @@ import ( var asJSON bool var outputPath string var selection []string +var tagdefs []string var expr string var split bool var interpolation bool @@ -70,6 +71,7 @@ func init() { mergeCmd.Flags().StringVar(&bindings, "bindings", "", "yaml file with additional bindings to use") mergeCmd.Flags().StringArrayVarP(&values, "define", "D", nil, "key/value bindings") mergeCmd.Flags().StringArrayVar(&selection, "select", []string{}, "filter dedicated output fields") + mergeCmd.Flags().StringArrayVar(&tagdefs, "tag", []string{}, "tag files (tag:path)") mergeCmd.Flags().StringVar(&expr, "evaluate", "", "evaluation expression") } @@ -164,6 +166,27 @@ func merge(stdin bool, templateFilePath string, opts flow.Options, json, split b } } + tags := []*dynaml.Tag{} + + for _, tagDef := range tagdefs { + i := strings.Index(tagDef, ":") + if i <= 0 { + log.Fatalln(fmt.Sprintf("tag file must be preceeded by a tag (:)")) + } + tagFilePath := tagDef[i+1:] + tagFile, err := ReadFile(tagFilePath) + if err != nil { + log.Fatalln(fmt.Sprintf("error reading tag gile [%s]:", path.Clean(tagFilePath)), err) + } + + tagYAML, err := yaml.Parse(tagFilePath, tagFile) + if err != nil { + log.Fatalln(fmt.Sprintf("error parsing tag gile [%s]:", path.Clean(tagFilePath)), err) + } + + tags = append(tags, dynaml.NewTag(tagDef[:i], tagYAML, nil, true)) + } + if stubs == nil { stubs = []yaml.Node{} } @@ -203,8 +226,9 @@ func merge(stdin bool, templateFilePath string, opts flow.Options, json, split b " -: depending on a node with an error" var binding dynaml.Binding - if bindingYAML != nil || interpolation { + if bindingYAML != nil || interpolation || len(tags) > 0 || len(templateYAMLs) > 1 { defstate := flow.NewDefaultState().SetInterpolation(interpolation) + defstate.SetTags(tags...) binding = flow.NewEnvironment( nil, "context", defstate) if bindingYAML != nil { @@ -237,10 +261,6 @@ func merge(stdin bool, templateFilePath string, opts flow.Options, json, split b } if err != nil { flowed = dynaml.ResetUnresolvedNodes(flowed) - } else { - if binding != nil { - binding.GetState().SetTag(fmt.Sprintf("%d", count), flowed, nil) - } } if !opts.PreserveTemporary && flowed.Temporary() { continue diff --git a/dynaml/dynaml.peg b/dynaml/dynaml.peg index 6f9947d..498f55d 100644 --- a/dynaml/dynaml.peg +++ b/dynaml/dynaml.peg @@ -120,7 +120,7 @@ DefaultValue <- '=' Expression VarParams <- '...' ws Reference <- (( Tag ('.' / Key)) / ( '.'? Key )) FollowUpRef -Tag <- ( TagName / [0-9]+ ) '::' +Tag <- ( TagName / ('-'? [0-9]+) ) '::' TagName <- [a-zA-Z_] [a-zA-Z0-9_]* FollowUpRef <- PathComponent* PathComponent <- ( '.' Key ) / ( '.'? Index ) diff --git a/dynaml/dynaml.peg.go b/dynaml/dynaml.peg.go index e0fb8b2..11017c6 100644 --- a/dynaml/dynaml.peg.go +++ b/dynaml/dynaml.peg.go @@ -4355,7 +4355,7 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position367, tokenIndex367, depth367 return false }, - /* 93 Tag <- <((TagName / [0-9]+) (':' ':'))> */ + /* 93 Tag <- <((TagName / ('-'? [0-9]+)) (':' ':'))> */ func() bool { position375, tokenIndex375, depth375 := position, tokenIndex, depth { @@ -4369,20 +4369,31 @@ func (p *DynamlGrammar) Init() { goto l377 l378: position, tokenIndex, depth = position377, tokenIndex377, depth377 + { + position379, tokenIndex379, depth379 := position, tokenIndex, depth + if buffer[position] != rune('-') { + goto l379 + } + position++ + goto l380 + l379: + position, tokenIndex, depth = position379, tokenIndex379, depth379 + } + l380: if c := buffer[position]; c < rune('0') || c > rune('9') { goto l375 } position++ - l379: + l381: { - position380, tokenIndex380, depth380 := position, tokenIndex, depth + position382, tokenIndex382, depth382 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l380 + goto l382 } position++ - goto l379 - l380: - position, tokenIndex, depth = position380, tokenIndex380, depth380 + goto l381 + l382: + position, tokenIndex, depth = position382, tokenIndex382, depth382 } } l377: @@ -4404,382 +4415,363 @@ func (p *DynamlGrammar) Init() { }, /* 94 TagName <- <(([a-z] / [A-Z] / '_') ([a-z] / [A-Z] / [0-9] / '_')*)> */ func() bool { - position381, tokenIndex381, depth381 := position, tokenIndex, depth + position383, tokenIndex383, depth383 := position, tokenIndex, depth { - position382 := position + position384 := position depth++ { - position383, tokenIndex383, depth383 := position, tokenIndex, depth + position385, tokenIndex385, depth385 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l384 + goto l386 } position++ - goto l383 - l384: - position, tokenIndex, depth = position383, tokenIndex383, depth383 + goto l385 + l386: + position, tokenIndex, depth = position385, tokenIndex385, depth385 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l385 + goto l387 } position++ - goto l383 - l385: - position, tokenIndex, depth = position383, tokenIndex383, depth383 + goto l385 + l387: + position, tokenIndex, depth = position385, tokenIndex385, depth385 if buffer[position] != rune('_') { - goto l381 + goto l383 } position++ } - l383: - l386: + l385: + l388: { - position387, tokenIndex387, depth387 := position, tokenIndex, depth + position389, tokenIndex389, depth389 := position, tokenIndex, depth { - position388, tokenIndex388, depth388 := position, tokenIndex, depth + position390, tokenIndex390, depth390 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l389 + goto l391 } position++ - goto l388 - l389: - position, tokenIndex, depth = position388, tokenIndex388, depth388 + goto l390 + l391: + position, tokenIndex, depth = position390, tokenIndex390, depth390 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l390 + goto l392 } position++ - goto l388 - l390: - position, tokenIndex, depth = position388, tokenIndex388, depth388 + goto l390 + l392: + position, tokenIndex, depth = position390, tokenIndex390, depth390 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l391 + goto l393 } position++ - goto l388 - l391: - position, tokenIndex, depth = position388, tokenIndex388, depth388 + goto l390 + l393: + position, tokenIndex, depth = position390, tokenIndex390, depth390 if buffer[position] != rune('_') { - goto l387 + goto l389 } position++ } - l388: - goto l386 - l387: - position, tokenIndex, depth = position387, tokenIndex387, depth387 + l390: + goto l388 + l389: + position, tokenIndex, depth = position389, tokenIndex389, depth389 } depth-- - add(ruleTagName, position382) + add(ruleTagName, position384) } return true - l381: - position, tokenIndex, depth = position381, tokenIndex381, depth381 + l383: + position, tokenIndex, depth = position383, tokenIndex383, depth383 return false }, /* 95 FollowUpRef <- */ func() bool { { - position393 := position + position395 := position depth++ - l394: + l396: { - position395, tokenIndex395, depth395 := position, tokenIndex, depth + position397, tokenIndex397, depth397 := position, tokenIndex, depth if !_rules[rulePathComponent]() { - goto l395 + goto l397 } - goto l394 - l395: - position, tokenIndex, depth = position395, tokenIndex395, depth395 + goto l396 + l397: + position, tokenIndex, depth = position397, tokenIndex397, depth397 } depth-- - add(ruleFollowUpRef, position393) + add(ruleFollowUpRef, position395) } return true }, /* 96 PathComponent <- <(('.' Key) / ('.'? Index))> */ func() bool { - position396, tokenIndex396, depth396 := position, tokenIndex, depth + position398, tokenIndex398, depth398 := position, tokenIndex, depth { - position397 := position + position399 := position depth++ { - position398, tokenIndex398, depth398 := position, tokenIndex, depth + position400, tokenIndex400, depth400 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l399 + goto l401 } position++ if !_rules[ruleKey]() { - goto l399 + goto l401 } - goto l398 - l399: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l400 + l401: + position, tokenIndex, depth = position400, tokenIndex400, depth400 { - position400, tokenIndex400, depth400 := position, tokenIndex, depth + position402, tokenIndex402, depth402 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l400 + goto l402 } position++ - goto l401 - l400: - position, tokenIndex, depth = position400, tokenIndex400, depth400 + goto l403 + l402: + position, tokenIndex, depth = position402, tokenIndex402, depth402 } - l401: + l403: if !_rules[ruleIndex]() { - goto l396 + goto l398 } } - l398: + l400: depth-- - add(rulePathComponent, position397) + add(rulePathComponent, position399) } return true - l396: - position, tokenIndex, depth = position396, tokenIndex396, depth396 + l398: + position, tokenIndex, depth = position398, tokenIndex398, depth398 return false }, /* 97 Key <- <(([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')* (':' ([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')*)?)> */ func() bool { - position402, tokenIndex402, depth402 := position, tokenIndex, depth + position404, tokenIndex404, depth404 := position, tokenIndex, depth { - position403 := position + position405 := position depth++ { - position404, tokenIndex404, depth404 := position, tokenIndex, depth + position406, tokenIndex406, depth406 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l405 + goto l407 } position++ - goto l404 - l405: - position, tokenIndex, depth = position404, tokenIndex404, depth404 + goto l406 + l407: + position, tokenIndex, depth = position406, tokenIndex406, depth406 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l406 + goto l408 } position++ - goto l404 - l406: - position, tokenIndex, depth = position404, tokenIndex404, depth404 + goto l406 + l408: + position, tokenIndex, depth = position406, tokenIndex406, depth406 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l407 + goto l409 } position++ - goto l404 - l407: - position, tokenIndex, depth = position404, tokenIndex404, depth404 + goto l406 + l409: + position, tokenIndex, depth = position406, tokenIndex406, depth406 if buffer[position] != rune('_') { - goto l402 + goto l404 } position++ } - l404: - l408: + l406: + l410: { - position409, tokenIndex409, depth409 := position, tokenIndex, depth + position411, tokenIndex411, depth411 := position, tokenIndex, depth { - position410, tokenIndex410, depth410 := position, tokenIndex, depth + position412, tokenIndex412, depth412 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l411 + goto l413 } position++ - goto l410 - l411: - position, tokenIndex, depth = position410, tokenIndex410, depth410 + goto l412 + l413: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l412 + goto l414 } position++ - goto l410 - l412: - position, tokenIndex, depth = position410, tokenIndex410, depth410 + goto l412 + l414: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l413 + goto l415 } position++ - goto l410 - l413: - position, tokenIndex, depth = position410, tokenIndex410, depth410 + goto l412 + l415: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if buffer[position] != rune('_') { - goto l414 + goto l416 } position++ - goto l410 - l414: - position, tokenIndex, depth = position410, tokenIndex410, depth410 + goto l412 + l416: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if buffer[position] != rune('-') { - goto l409 + goto l411 } position++ } - l410: - goto l408 - l409: - position, tokenIndex, depth = position409, tokenIndex409, depth409 + l412: + goto l410 + l411: + position, tokenIndex, depth = position411, tokenIndex411, depth411 } { - position415, tokenIndex415, depth415 := position, tokenIndex, depth + position417, tokenIndex417, depth417 := position, tokenIndex, depth if buffer[position] != rune(':') { - goto l415 + goto l417 } position++ { - position417, tokenIndex417, depth417 := position, tokenIndex, depth + position419, tokenIndex419, depth419 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l418 + goto l420 } position++ - goto l417 - l418: - position, tokenIndex, depth = position417, tokenIndex417, depth417 + goto l419 + l420: + position, tokenIndex, depth = position419, tokenIndex419, depth419 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l419 + goto l421 } position++ - goto l417 - l419: - position, tokenIndex, depth = position417, tokenIndex417, depth417 + goto l419 + l421: + position, tokenIndex, depth = position419, tokenIndex419, depth419 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l420 + goto l422 } position++ - goto l417 - l420: - position, tokenIndex, depth = position417, tokenIndex417, depth417 + goto l419 + l422: + position, tokenIndex, depth = position419, tokenIndex419, depth419 if buffer[position] != rune('_') { - goto l415 + goto l417 } position++ } - l417: - l421: + l419: + l423: { - position422, tokenIndex422, depth422 := position, tokenIndex, depth + position424, tokenIndex424, depth424 := position, tokenIndex, depth { - position423, tokenIndex423, depth423 := position, tokenIndex, depth + position425, tokenIndex425, depth425 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l424 + goto l426 } position++ - goto l423 - l424: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l425 + l426: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l425 + goto l427 } position++ - goto l423 - l425: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l425 + l427: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l426 + goto l428 } position++ - goto l423 - l426: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l425 + l428: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if buffer[position] != rune('_') { - goto l427 + goto l429 } position++ - goto l423 - l427: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l425 + l429: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if buffer[position] != rune('-') { - goto l422 + goto l424 } position++ } - l423: - goto l421 - l422: - position, tokenIndex, depth = position422, tokenIndex422, depth422 + l425: + goto l423 + l424: + position, tokenIndex, depth = position424, tokenIndex424, depth424 } - goto l416 - l415: - position, tokenIndex, depth = position415, tokenIndex415, depth415 + goto l418 + l417: + position, tokenIndex, depth = position417, tokenIndex417, depth417 } - l416: + l418: depth-- - add(ruleKey, position403) + add(ruleKey, position405) } return true - l402: - position, tokenIndex, depth = position402, tokenIndex402, depth402 + l404: + position, tokenIndex, depth = position404, tokenIndex404, depth404 return false }, /* 98 Index <- <('[' '-'? [0-9]+ ']')> */ func() bool { - position428, tokenIndex428, depth428 := position, tokenIndex, depth + position430, tokenIndex430, depth430 := position, tokenIndex, depth { - position429 := position + position431 := position depth++ if buffer[position] != rune('[') { - goto l428 + goto l430 } position++ { - position430, tokenIndex430, depth430 := position, tokenIndex, depth + position432, tokenIndex432, depth432 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l430 + goto l432 } position++ - goto l431 - l430: - position, tokenIndex, depth = position430, tokenIndex430, depth430 + goto l433 + l432: + position, tokenIndex, depth = position432, tokenIndex432, depth432 } - l431: + l433: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l428 + goto l430 } position++ - l432: + l434: { - position433, tokenIndex433, depth433 := position, tokenIndex, depth + position435, tokenIndex435, depth435 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l433 + goto l435 } position++ - goto l432 - l433: - position, tokenIndex, depth = position433, tokenIndex433, depth433 + goto l434 + l435: + position, tokenIndex, depth = position435, tokenIndex435, depth435 } if buffer[position] != rune(']') { - goto l428 + goto l430 } position++ depth-- - add(ruleIndex, position429) + add(ruleIndex, position431) } return true - l428: - position, tokenIndex, depth = position428, tokenIndex428, depth428 + l430: + position, tokenIndex, depth = position430, tokenIndex430, depth430 return false }, /* 99 IP <- <([0-9]+ '.' [0-9]+ '.' [0-9]+ '.' [0-9]+)> */ func() bool { - position434, tokenIndex434, depth434 := position, tokenIndex, depth + position436, tokenIndex436, depth436 := position, tokenIndex, depth { - position435 := position + position437 := position depth++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l434 - } - position++ - l436: - { - position437, tokenIndex437, depth437 := position, tokenIndex, depth - if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l437 - } - position++ goto l436 - l437: - position, tokenIndex, depth = position437, tokenIndex437, depth437 - } - if buffer[position] != rune('.') { - goto l434 - } - position++ - if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l434 } position++ l438: @@ -4794,11 +4786,11 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position439, tokenIndex439, depth439 } if buffer[position] != rune('.') { - goto l434 + goto l436 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l434 + goto l436 } position++ l440: @@ -4813,11 +4805,11 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position441, tokenIndex441, depth441 } if buffer[position] != rune('.') { - goto l434 + goto l436 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l434 + goto l436 } position++ l442: @@ -4831,137 +4823,156 @@ func (p *DynamlGrammar) Init() { l443: position, tokenIndex, depth = position443, tokenIndex443, depth443 } + if buffer[position] != rune('.') { + goto l436 + } + position++ + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l436 + } + position++ + l444: + { + position445, tokenIndex445, depth445 := position, tokenIndex, depth + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l445 + } + position++ + goto l444 + l445: + position, tokenIndex, depth = position445, tokenIndex445, depth445 + } depth-- - add(ruleIP, position435) + add(ruleIP, position437) } return true - l434: - position, tokenIndex, depth = position434, tokenIndex434, depth434 + l436: + position, tokenIndex, depth = position436, tokenIndex436, depth436 return false }, /* 100 ws <- <(' ' / '\t' / '\n' / '\r')*> */ func() bool { { - position445 := position + position447 := position depth++ - l446: + l448: { - position447, tokenIndex447, depth447 := position, tokenIndex, depth + position449, tokenIndex449, depth449 := position, tokenIndex, depth { - position448, tokenIndex448, depth448 := position, tokenIndex, depth + position450, tokenIndex450, depth450 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l449 + goto l451 } position++ - goto l448 - l449: - position, tokenIndex, depth = position448, tokenIndex448, depth448 + goto l450 + l451: + position, tokenIndex, depth = position450, tokenIndex450, depth450 if buffer[position] != rune('\t') { - goto l450 + goto l452 } position++ - goto l448 - l450: - position, tokenIndex, depth = position448, tokenIndex448, depth448 + goto l450 + l452: + position, tokenIndex, depth = position450, tokenIndex450, depth450 if buffer[position] != rune('\n') { - goto l451 + goto l453 } position++ - goto l448 - l451: - position, tokenIndex, depth = position448, tokenIndex448, depth448 + goto l450 + l453: + position, tokenIndex, depth = position450, tokenIndex450, depth450 if buffer[position] != rune('\r') { - goto l447 + goto l449 } position++ } - l448: - goto l446 - l447: - position, tokenIndex, depth = position447, tokenIndex447, depth447 + l450: + goto l448 + l449: + position, tokenIndex, depth = position449, tokenIndex449, depth449 } depth-- - add(rulews, position445) + add(rulews, position447) } return true }, /* 101 req_ws <- <(' ' / '\t' / '\n' / '\r')+> */ func() bool { - position452, tokenIndex452, depth452 := position, tokenIndex, depth + position454, tokenIndex454, depth454 := position, tokenIndex, depth { - position453 := position + position455 := position depth++ { - position456, tokenIndex456, depth456 := position, tokenIndex, depth + position458, tokenIndex458, depth458 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l457 + goto l459 } position++ - goto l456 - l457: - position, tokenIndex, depth = position456, tokenIndex456, depth456 + goto l458 + l459: + position, tokenIndex, depth = position458, tokenIndex458, depth458 if buffer[position] != rune('\t') { - goto l458 + goto l460 } position++ - goto l456 - l458: - position, tokenIndex, depth = position456, tokenIndex456, depth456 + goto l458 + l460: + position, tokenIndex, depth = position458, tokenIndex458, depth458 if buffer[position] != rune('\n') { - goto l459 + goto l461 } position++ - goto l456 - l459: - position, tokenIndex, depth = position456, tokenIndex456, depth456 + goto l458 + l461: + position, tokenIndex, depth = position458, tokenIndex458, depth458 if buffer[position] != rune('\r') { - goto l452 + goto l454 } position++ } + l458: l456: - l454: { - position455, tokenIndex455, depth455 := position, tokenIndex, depth + position457, tokenIndex457, depth457 := position, tokenIndex, depth { - position460, tokenIndex460, depth460 := position, tokenIndex, depth + position462, tokenIndex462, depth462 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l461 + goto l463 } position++ - goto l460 - l461: - position, tokenIndex, depth = position460, tokenIndex460, depth460 + goto l462 + l463: + position, tokenIndex, depth = position462, tokenIndex462, depth462 if buffer[position] != rune('\t') { - goto l462 + goto l464 } position++ - goto l460 - l462: - position, tokenIndex, depth = position460, tokenIndex460, depth460 + goto l462 + l464: + position, tokenIndex, depth = position462, tokenIndex462, depth462 if buffer[position] != rune('\n') { - goto l463 + goto l465 } position++ - goto l460 - l463: - position, tokenIndex, depth = position460, tokenIndex460, depth460 + goto l462 + l465: + position, tokenIndex, depth = position462, tokenIndex462, depth462 if buffer[position] != rune('\r') { - goto l455 + goto l457 } position++ } - l460: - goto l454 - l455: - position, tokenIndex, depth = position455, tokenIndex455, depth455 + l462: + goto l456 + l457: + position, tokenIndex, depth = position457, tokenIndex457, depth457 } depth-- - add(rulereq_ws, position453) + add(rulereq_ws, position455) } return true - l452: - position, tokenIndex, depth = position452, tokenIndex452, depth452 + l454: + position, tokenIndex, depth = position454, tokenIndex454, depth454 return false }, /* 103 Action0 <- <{}> */ diff --git a/dynaml/expression.go b/dynaml/expression.go index fea9eea..1ceec76 100644 --- a/dynaml/expression.go +++ b/dynaml/expression.go @@ -16,15 +16,25 @@ type SourceProvider interface { SourceName() string } +const TAG_GLOBAL = TagScope(1) +const TAG_STREAM = TagScope(2) +const TAG_LOCAL = TagScope(3) + +type TagScope int + type Tag struct { name string node yaml.Node path []string - local bool + scope TagScope } -func NewTag(name string, node yaml.Node, path []string) *Tag { - return &Tag{name, node, path, true} +func NewTag(name string, node yaml.Node, path []string, global bool) *Tag { + scope := TAG_LOCAL + if global { + scope = TAG_GLOBAL + } + return &Tag{name, node, path, scope} } func (t *Tag) Name() string { @@ -39,12 +49,14 @@ func (t *Tag) Path() []string { return t.path } -func (t *Tag) Local() bool { - return t.local +func (t *Tag) Scope() TagScope { + return t.scope } func (t *Tag) ResetLocal() { - t.local = false + if t.scope == TAG_LOCAL { + t.scope = TAG_STREAM + } } type State interface { diff --git a/dynaml/reference.go b/dynaml/reference.go index a07d618..eaae1ee 100644 --- a/dynaml/reference.go +++ b/dynaml/reference.go @@ -26,18 +26,29 @@ func (e ReferenceExpr) Evaluate(binding Binding, locally bool) (interface{}, Eva debug.Debug("reference: (%s)%v\n", e.Tag, e.Path) if e.Tag != "" { - tag = binding.GetState().GetTag(e.Tag) info := DefaultInfo() - if tag == nil { - return info.Error("tag '%s' not found", e.Tag) - } - if len(e.Path) == 1 && e.Path[0] == "" { - return tag.Node().Value(), info, true + if e.Tag != "0" { + tag = binding.GetState().GetTag(e.Tag) + if tag == nil { + return info.Error("tag '%s' not found", e.Tag) + } + if len(e.Path) == 1 && e.Path[0] == "" { + return tag.Node().Value(), info, true + } + } else { + if len(e.Path) == 1 && e.Path[0] == "" { + return info.Error("no reference to actual document possible") + } + fromRoot = true } } return e.find(func(end int, path []string) (yaml.Node, bool) { if fromRoot { - return binding.FindFromRoot(path[1 : end+1]) + start := 0 + if e.Path[0] == "" { + start = 1 + } + return binding.FindFromRoot(path[start : end+1]) } else { if tag != nil { return yaml.Find(tag.Node(), path...) diff --git a/flow/cascade.go b/flow/cascade.go index 40997b9..ef7a6da 100644 --- a/flow/cascade.go +++ b/flow/cascade.go @@ -17,14 +17,15 @@ type Options struct { func PrepareStubs(outer dynaml.Binding, partial bool, stubs ...yaml.Node) ([]yaml.Node, error) { for i := len(stubs) - 1; i >= 0; i-- { + ResetStream(outer) flowed, err := NestedFlow(outer, stubs[i], stubs[i+1:]...) if !partial && err != nil { return nil, err } stubs[i] = Cleanup(flowed, discardLocal) - ResetTags(outer) } + ResetStream(outer) return stubs, nil } @@ -37,6 +38,7 @@ func Apply(outer dynaml.Binding, template yaml.Node, prepared []yaml.Node, opts if !opts.PreserveEscapes { result = Cleanup(result, unescapeDynamlFunc(outer)) } + PushDocument(outer, result) } return result, err } diff --git a/flow/environment.go b/flow/environment.go index a28123b..9e5ce31 100644 --- a/flow/environment.go +++ b/flow/environment.go @@ -327,10 +327,17 @@ func ResetTags(binding dynaml.Binding) { } } -func ResetLocalTags(binding dynaml.Binding) { +func ResetStream(binding dynaml.Binding) { env, ok := binding.(DefaultEnvironment) if ok && env.state != nil { - env.state.ResetLocal() + env.state.ResetStream() + } +} + +func PushDocument(binding dynaml.Binding, doc yaml.Node) { + env, ok := binding.(DefaultEnvironment) + if ok && env.state != nil { + env.state.PushDocument(doc) } } diff --git a/flow/state.go b/flow/state.go index 7fc361e..aa44304 100644 --- a/flow/state.go +++ b/flow/state.go @@ -8,6 +8,7 @@ import ( "net/http" "path" "reflect" + "strconv" "strings" "github.com/mandelsoft/vfs/pkg/osfs" @@ -31,6 +32,7 @@ type State struct { functions dynaml.Registry interpolation bool tags map[string]*dynaml.Tag + docno int // document number } var _ dynaml.State = &State{} @@ -52,6 +54,7 @@ func NewState(key string, mode int, optfs ...vfs.FileSystem) *State { key: key, mode: mode, fileSystem: vfs.New(fs), + docno: 1, } } @@ -128,33 +131,58 @@ func (s *State) SetTag(name string, node yaml.Node, path []string) error { debug.Debug("setting tag: %v\n", path) old := s.tags[name] if old != nil { - if !old.Local() { + if old.Scope() != dynaml.TAG_LOCAL { return fmt.Errorf("duplicate tag %q: %s in foreign document", name, strings.Join(path, ".")) } if !reflect.DeepEqual(path, old.Path()) { return fmt.Errorf("duplicate tag %q: %s <-> %s", name, strings.Join(path, "."), strings.Join(old.Path(), ".")) } } - s.tags[name] = dynaml.NewTag(name, Cleanup(node, discardTags), path) + s.tags[name] = dynaml.NewTag(name, Cleanup(node, discardTags), path, false) return nil } func (s *State) GetTag(name string) *dynaml.Tag { + i, err := strconv.Atoi(name) + if err == nil { + if i <= 0 { + i += s.docno + if i <= 0 { + return nil + } + name = fmt.Sprintf("%d", i) + } + } return s.tags[name] } func (s *State) ResetTags() { s.tags = map[string]*dynaml.Tag{} + s.docno = 1 +} + +func (s *State) ResetStream() { + n := map[string]*dynaml.Tag{} + for _, v := range s.tags { + if v.Scope() == dynaml.TAG_GLOBAL { + n[v.Name()] = v + } + } + s.docno = 1 + s.tags = n } -func (s *State) ResetLocal() { +func (s *State) PushDocument(node yaml.Node) { for _, t := range s.tags { t.ResetLocal() } + if node != nil { + s.SetTag(fmt.Sprintf("%d", s.docno), node, nil) + } + s.docno++ } func (s *State) Cleanup() { - s.ResetLocal() for _, n := range s.files { s.fileSystem.Remove(n) } diff --git a/spiffing/interface.go b/spiffing/interface.go index fd531d3..c4e8e3f 100644 --- a/spiffing/interface.go +++ b/spiffing/interface.go @@ -66,6 +66,9 @@ type Spiff interface { CleanupTags() Spiff // Reset flushes the binding state Reset() Spiff + // ResetStream flushes the document history + // and removes all implicit document stream tags. + ResetStream() Spiff // FileSystem return the virtual filesystem set for the execution context. FileSystem() vfs.FileSystem @@ -97,15 +100,21 @@ type Spiff interface { // Cascade processes a template with a list of given subs and state // documents. - // Please note: configured implicit tag settings are ignored. + // The document stream history (implicit tags) is resetted prior + // to the execution. Cascade(template Node, stubs []Node, states ...Node) (Node, error) // PrepareStubs processes a list a stubs and returns a prepared - // represenation usable to process a template - // Please note: configured implicit tag settings are ignored. + // represenation usable to process a template. + // The document stream history (implicit tags) is resetted prior + // to the execution. PrepareStubs(stubs ...Node) ([]Node, error) // ApplyStubs uses already prepared subs to process a template. - // Please note: configured implicit tag settings are obeyed. - ApplyStubs(template Node, preparedstubs []Node) (Node, error) + // The document stream history (implicit tags) is resetted prior + // to the execution. If the call is part of the processing + // of a document stream, the optional argument must be set to + // true. In this case every call add an entry to the document + // history. + ApplyStubs(template Node, preparedstubs []Node, stream ...bool) (Node, error) } // Source is used to get access to a template or stub source data and name diff --git a/spiffing/spiff.go b/spiffing/spiff.go index 114fb57..3519787 100644 --- a/spiffing/spiff.go +++ b/spiffing/spiff.go @@ -94,12 +94,17 @@ func (s *spiff) Reset() Spiff { return s } -func (s *spiff) assureBinding(useTags bool) { +func (s *spiff) ResetStream() Spiff { + flow.ResetStream(s.binding) + return s +} + +func (s *spiff) assureBinding() { if s.binding == nil { state := flow.NewState(s.key, s.mode, s.fs). SetFunctions(s.functions). SetInterpolation(s.interpolation) - if useTags && len(s.tags) > 0 { + if len(s.tags) > 0 { var tags []*dynaml.Tag for _, t := range s.tags { tags = append(tags, t) @@ -176,11 +181,9 @@ func (s spiff) WithValues(values map[string]interface{}) (Spiff, error) { return s.Reset(), nil } -// SetTag sets/resets a tag for subsequent processings. -// This can be used to set implicit document tags -// when simulating a multi-document processing +// SetTag sets/resets a global tag for subsequent processings. func (s spiff) SetTag(tag string, node yaml.Node) Spiff { - s.tags[tag] = dynaml.NewTag(tag, node, nil) + s.tags[tag] = dynaml.NewTag(tag, node, nil, true) return s.Reset() } @@ -204,25 +207,25 @@ func (s *spiff) CleanupTags() Spiff { // Cascade processes a template with a list of given subs and state // documents func (s *spiff) Cascade(template Node, stubs []Node, states ...Node) (Node, error) { - s.Reset() - s.assureBinding(false) - defer s.Reset() + s.assureBinding() + defer s.ResetStream() return flow.Cascade(s.binding, template, s.opts, append(stubs, states...)...) } // PrepareStubs processes a list a stubs and returns a prepared // represenation usable to process a template func (s *spiff) PrepareStubs(stubs ...Node) ([]Node, error) { - s.Reset() - s.assureBinding(false) - defer s.Reset() + s.assureBinding() return flow.PrepareStubs(s.binding, s.opts.Partial, stubs...) } // ApplyStubs uses already prepared subs to process a template. // It uses the configured implicit tag settings. -func (s *spiff) ApplyStubs(template Node, preparedstubs []Node) (Node, error) { - s.assureBinding(true) +func (s *spiff) ApplyStubs(template Node, preparedstubs []Node, stream ...bool) (Node, error) { + s.assureBinding() + if len(stream) == 0 || !stream[0] { + s.ResetStream() + } return flow.Apply(s.binding, template, preparedstubs, s.opts) } From 6fe60c7b2196d4f830095f81d20dea2e27bb1890 Mon Sep 17 00:00:00 2001 From: Uwe Krueger Date: Wed, 26 May 2021 00:34:00 +0200 Subject: [PATCH 4/5] dynamic tag def + qualified tags --- README.md | 56 +- cmd/merge.go | 2 +- dynaml/dynaml.peg | 6 +- dynaml/dynaml.peg.go | 3269 ++++++++++++++++++------------------ dynaml/expression.go | 62 +- dynaml/parser.go | 2 +- dynaml/reference.go | 2 +- dynaml/tagdef.go | 57 + dynaml/wireguard/genkey.go | 2 +- flow/flow.go | 9 +- flow/flow_tag_test.go | 67 + flow/state.go | 23 +- spiffing/spiff.go | 8 +- 13 files changed, 1921 insertions(+), 1644 deletions(-) create mode 100644 dynaml/tagdef.go diff --git a/README.md b/README.md index 0984cb9..f93ec9d 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ Contents: - [(( valid(foobar) ))](#-validfoobar-) - [(( require(foobar) ))](#-requirefoobar-) - [(( stub(foo.bar) ))](#-stubfoobar-) + - [(( tagdef("tag", value) ))](#-tagdeftag-valiue-) - [(( eval(foo "." bar ) ))](#-evalfoo--bar--) - [(( env( HOME" ) ))](#-envHOME--) - [(( static_ips(0, 1, 3) ))](#-static_ips0-1-3-) @@ -2196,6 +2197,39 @@ by denoting `(ref)` or `[] ref` for a list expression. Alternatively the `merge` operation could be used, for example `merge foo.bar`. The difference is that `stub` does not merge, therefore the field will still be merged (with the original path in the document). + +### `(( tagdef("tag", value) ))` + +The function `tagdef` can be used to define dynamic tags (see [Tags](#tags)). +In contrast to the tag marker this function aloows to specify the tag name +and its intended value by an expression. Therefit can be used in composing +elements like `map` or `sum` to create dynamic tag with calculated values. + +An optional third argument can be used to specify the intended scope +(`local` or `global`). By default a local tag is created. Local tags are visible +only at the actual processing level (template or sub), while global tags, +once defined, can be used in all further processing levels (stub or template). + +Alternatively the tag name can be prefixed with a start (`*`) to declare +a global tag. + +The specified tag value will be used as result for the function. + +e.g.: + +**template.yml** +```yaml +value: (( tagdef("tag:alice", 25) )) +alice: (( tag:alice::. )) +``` + +evaluates to + +```yaml +value: 25 +alice: 25 +``` + ### `(( eval(foo "." bar ) ))` Evaluate the evaluation result of a string expression again as dynaml expression. This can, for example, be used to realize indirections. @@ -4749,6 +4783,12 @@ data: alice: (( &tag:alice(25) ``` +If the name is prefixed with a star (`*`), the tag is defined globally. +Gobal tags surive stub processing and their value is visible in sub sequent +stub (and template) processings. + +A tag name may consist of multiple components separated by a colon (`:`). + ### `(( name::path ))` Reference a sub path of the value of a tagged node. @@ -4814,9 +4854,13 @@ bob: 24 ``` Tags defined by tag markers are available for stubs and templates. +Global tags are available down the stub processing to the templates. +Local tags are only avaialble on the processing level they are declared. + Additionally to the tags explicitly set by tag markers, there are implicit document tags given by the document index during the processing of a -(multi-document) template. +(multi-document) template. The implicit document tags are qualified with the +prefix `doc:`. This prefix should not be used to own tags in the documents e.g.: @@ -4829,10 +4873,10 @@ data: bob: 24 --- alice: (( persons::alice )) -prev: (( 1::. )) +prev: (( doc:1::. )) --- bob: (( persons::bob )) -prev: (( 2::. )) +prev: (( doc:2::. )) ``` resolves to @@ -4855,9 +4899,9 @@ prev: ``` If the given document index is negative it denotes the document relative to the -one actually processed (so, the tag `-1` denotes the previous document). -The index `0` can be used to denote the actual document. Here always a path -must be specified, it is not possible to refer to the complete document +one actually processed (so, the tag `doc:-1` denotes the previous document). +The index `doc:0` can be used to denote the actual document. Here always a path +must be specified, it is not possible to refer to the complete document (with `.`). ## Templates diff --git a/cmd/merge.go b/cmd/merge.go index cdc7901..24f7641 100644 --- a/cmd/merge.go +++ b/cmd/merge.go @@ -184,7 +184,7 @@ func merge(stdin bool, templateFilePath string, opts flow.Options, json, split b log.Fatalln(fmt.Sprintf("error parsing tag gile [%s]:", path.Clean(tagFilePath)), err) } - tags = append(tags, dynaml.NewTag(tagDef[:i], tagYAML, nil, true)) + tags = append(tags, dynaml.NewTag(tagDef[:i], tagYAML, nil, dynaml.TAG_SCOPE_GLOBAL)) } if stubs == nil { diff --git a/dynaml/dynaml.peg b/dynaml/dynaml.peg index 498f55d..9b2e007 100644 --- a/dynaml/dynaml.peg +++ b/dynaml/dynaml.peg @@ -8,7 +8,7 @@ Prefer <- ws 'prefer' req_ws Expression MarkedExpression <- ws Marker ( req_ws SubsequentMarker )* ws MarkerExpression ? ws SubsequentMarker <- Marker Marker <- '&' ( 'template' / 'temporary' / 'local' / 'inject' / 'state' / 'default' / TagMarker ) -TagMarker <- 'tag:' TagName +TagMarker <- 'tag:' '*'? TagName ( ':' TagName )* MarkerExpression <- Grouped Expression <- ( Scoped / LambdaExpr / Level7 ) ws @@ -119,8 +119,8 @@ Name <- [a-zA-Z0-9_]+ DefaultValue <- '=' Expression VarParams <- '...' ws -Reference <- (( Tag ('.' / Key)) / ( '.'? Key )) FollowUpRef -Tag <- ( TagName / ('-'? [0-9]+) ) '::' +Reference <- (( Tag ('.' / Key )) / ( '.'? Key )) FollowUpRef +Tag <- ( ('doc:' '-'? [0-9]+) / (TagName ( ':' TagName )*) ) '::' TagName <- [a-zA-Z_] [a-zA-Z0-9_]* FollowUpRef <- PathComponent* PathComponent <- ( '.' Key ) / ( '.'? Index ) diff --git a/dynaml/dynaml.peg.go b/dynaml/dynaml.peg.go index 11017c6..cf6b3e4 100644 --- a/dynaml/dynaml.peg.go +++ b/dynaml/dynaml.peg.go @@ -1064,7 +1064,7 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position16, tokenIndex16, depth16 return false }, - /* 5 TagMarker <- <('t' 'a' 'g' ':' TagName)> */ + /* 5 TagMarker <- <('t' 'a' 'g' ':' '*'? TagName (':' TagName)*)> */ func() bool { position25, tokenIndex25, depth25 := position, tokenIndex, depth { @@ -1086,9 +1086,34 @@ func (p *DynamlGrammar) Init() { goto l25 } position++ + { + position27, tokenIndex27, depth27 := position, tokenIndex, depth + if buffer[position] != rune('*') { + goto l27 + } + position++ + goto l28 + l27: + position, tokenIndex, depth = position27, tokenIndex27, depth27 + } + l28: if !_rules[ruleTagName]() { goto l25 } + l29: + { + position30, tokenIndex30, depth30 := position, tokenIndex, depth + if buffer[position] != rune(':') { + goto l30 + } + position++ + if !_rules[ruleTagName]() { + goto l30 + } + goto l29 + l30: + position, tokenIndex, depth = position30, tokenIndex30, depth30 + } depth-- add(ruleTagMarker, position26) } @@ -1099,3880 +1124,3910 @@ func (p *DynamlGrammar) Init() { }, /* 6 MarkerExpression <- */ func() bool { - position27, tokenIndex27, depth27 := position, tokenIndex, depth + position31, tokenIndex31, depth31 := position, tokenIndex, depth { - position28 := position + position32 := position depth++ if !_rules[ruleGrouped]() { - goto l27 + goto l31 } depth-- - add(ruleMarkerExpression, position28) + add(ruleMarkerExpression, position32) } return true - l27: - position, tokenIndex, depth = position27, tokenIndex27, depth27 + l31: + position, tokenIndex, depth = position31, tokenIndex31, depth31 return false }, /* 7 Expression <- <((Scoped / LambdaExpr / Level7) ws)> */ func() bool { - position29, tokenIndex29, depth29 := position, tokenIndex, depth + position33, tokenIndex33, depth33 := position, tokenIndex, depth { - position30 := position + position34 := position depth++ { - position31, tokenIndex31, depth31 := position, tokenIndex, depth + position35, tokenIndex35, depth35 := position, tokenIndex, depth if !_rules[ruleScoped]() { - goto l32 + goto l36 } - goto l31 - l32: - position, tokenIndex, depth = position31, tokenIndex31, depth31 + goto l35 + l36: + position, tokenIndex, depth = position35, tokenIndex35, depth35 if !_rules[ruleLambdaExpr]() { - goto l33 + goto l37 } - goto l31 - l33: - position, tokenIndex, depth = position31, tokenIndex31, depth31 + goto l35 + l37: + position, tokenIndex, depth = position35, tokenIndex35, depth35 if !_rules[ruleLevel7]() { - goto l29 + goto l33 } } - l31: + l35: if !_rules[rulews]() { - goto l29 + goto l33 } depth-- - add(ruleExpression, position30) + add(ruleExpression, position34) } return true - l29: - position, tokenIndex, depth = position29, tokenIndex29, depth29 + l33: + position, tokenIndex, depth = position33, tokenIndex33, depth33 return false }, /* 8 Scoped <- <(ws Scope ws Expression)> */ func() bool { - position34, tokenIndex34, depth34 := position, tokenIndex, depth + position38, tokenIndex38, depth38 := position, tokenIndex, depth { - position35 := position + position39 := position depth++ if !_rules[rulews]() { - goto l34 + goto l38 } if !_rules[ruleScope]() { - goto l34 + goto l38 } if !_rules[rulews]() { - goto l34 + goto l38 } if !_rules[ruleExpression]() { - goto l34 + goto l38 } depth-- - add(ruleScoped, position35) + add(ruleScoped, position39) } return true - l34: - position, tokenIndex, depth = position34, tokenIndex34, depth34 + l38: + position, tokenIndex, depth = position38, tokenIndex38, depth38 return false }, /* 9 Scope <- <(CreateScope ws Assignments? ')')> */ func() bool { - position36, tokenIndex36, depth36 := position, tokenIndex, depth + position40, tokenIndex40, depth40 := position, tokenIndex, depth { - position37 := position + position41 := position depth++ if !_rules[ruleCreateScope]() { - goto l36 + goto l40 } if !_rules[rulews]() { - goto l36 + goto l40 } { - position38, tokenIndex38, depth38 := position, tokenIndex, depth + position42, tokenIndex42, depth42 := position, tokenIndex, depth if !_rules[ruleAssignments]() { - goto l38 + goto l42 } - goto l39 - l38: - position, tokenIndex, depth = position38, tokenIndex38, depth38 + goto l43 + l42: + position, tokenIndex, depth = position42, tokenIndex42, depth42 } - l39: + l43: if buffer[position] != rune(')') { - goto l36 + goto l40 } position++ depth-- - add(ruleScope, position37) + add(ruleScope, position41) } return true - l36: - position, tokenIndex, depth = position36, tokenIndex36, depth36 + l40: + position, tokenIndex, depth = position40, tokenIndex40, depth40 return false }, /* 10 CreateScope <- <'('> */ func() bool { - position40, tokenIndex40, depth40 := position, tokenIndex, depth + position44, tokenIndex44, depth44 := position, tokenIndex, depth { - position41 := position + position45 := position depth++ if buffer[position] != rune('(') { - goto l40 + goto l44 } position++ depth-- - add(ruleCreateScope, position41) + add(ruleCreateScope, position45) } return true - l40: - position, tokenIndex, depth = position40, tokenIndex40, depth40 + l44: + position, tokenIndex, depth = position44, tokenIndex44, depth44 return false }, /* 11 Level7 <- <(ws Level6 (req_ws Or)*)> */ func() bool { - position42, tokenIndex42, depth42 := position, tokenIndex, depth + position46, tokenIndex46, depth46 := position, tokenIndex, depth { - position43 := position + position47 := position depth++ if !_rules[rulews]() { - goto l42 + goto l46 } if !_rules[ruleLevel6]() { - goto l42 + goto l46 } - l44: + l48: { - position45, tokenIndex45, depth45 := position, tokenIndex, depth + position49, tokenIndex49, depth49 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l45 + goto l49 } if !_rules[ruleOr]() { - goto l45 + goto l49 } - goto l44 - l45: - position, tokenIndex, depth = position45, tokenIndex45, depth45 + goto l48 + l49: + position, tokenIndex, depth = position49, tokenIndex49, depth49 } depth-- - add(ruleLevel7, position43) + add(ruleLevel7, position47) } return true - l42: - position, tokenIndex, depth = position42, tokenIndex42, depth42 + l46: + position, tokenIndex, depth = position46, tokenIndex46, depth46 return false }, /* 12 Or <- <(OrOp req_ws Level6)> */ func() bool { - position46, tokenIndex46, depth46 := position, tokenIndex, depth + position50, tokenIndex50, depth50 := position, tokenIndex, depth { - position47 := position + position51 := position depth++ if !_rules[ruleOrOp]() { - goto l46 + goto l50 } if !_rules[rulereq_ws]() { - goto l46 + goto l50 } if !_rules[ruleLevel6]() { - goto l46 + goto l50 } depth-- - add(ruleOr, position47) + add(ruleOr, position51) } return true - l46: - position, tokenIndex, depth = position46, tokenIndex46, depth46 + l50: + position, tokenIndex, depth = position50, tokenIndex50, depth50 return false }, /* 13 OrOp <- <(('|' '|') / ('/' '/'))> */ func() bool { - position48, tokenIndex48, depth48 := position, tokenIndex, depth + position52, tokenIndex52, depth52 := position, tokenIndex, depth { - position49 := position + position53 := position depth++ { - position50, tokenIndex50, depth50 := position, tokenIndex, depth + position54, tokenIndex54, depth54 := position, tokenIndex, depth if buffer[position] != rune('|') { - goto l51 + goto l55 } position++ if buffer[position] != rune('|') { - goto l51 + goto l55 } position++ - goto l50 - l51: - position, tokenIndex, depth = position50, tokenIndex50, depth50 + goto l54 + l55: + position, tokenIndex, depth = position54, tokenIndex54, depth54 if buffer[position] != rune('/') { - goto l48 + goto l52 } position++ if buffer[position] != rune('/') { - goto l48 + goto l52 } position++ } - l50: + l54: depth-- - add(ruleOrOp, position49) + add(ruleOrOp, position53) } return true - l48: - position, tokenIndex, depth = position48, tokenIndex48, depth48 + l52: + position, tokenIndex, depth = position52, tokenIndex52, depth52 return false }, /* 14 Level6 <- <(Conditional / Level5)> */ func() bool { - position52, tokenIndex52, depth52 := position, tokenIndex, depth + position56, tokenIndex56, depth56 := position, tokenIndex, depth { - position53 := position + position57 := position depth++ { - position54, tokenIndex54, depth54 := position, tokenIndex, depth + position58, tokenIndex58, depth58 := position, tokenIndex, depth if !_rules[ruleConditional]() { - goto l55 + goto l59 } - goto l54 - l55: - position, tokenIndex, depth = position54, tokenIndex54, depth54 + goto l58 + l59: + position, tokenIndex, depth = position58, tokenIndex58, depth58 if !_rules[ruleLevel5]() { - goto l52 + goto l56 } } - l54: + l58: depth-- - add(ruleLevel6, position53) + add(ruleLevel6, position57) } return true - l52: - position, tokenIndex, depth = position52, tokenIndex52, depth52 + l56: + position, tokenIndex, depth = position56, tokenIndex56, depth56 return false }, /* 15 Conditional <- <(Level5 ws '?' Expression ':' Expression)> */ func() bool { - position56, tokenIndex56, depth56 := position, tokenIndex, depth + position60, tokenIndex60, depth60 := position, tokenIndex, depth { - position57 := position + position61 := position depth++ if !_rules[ruleLevel5]() { - goto l56 + goto l60 } if !_rules[rulews]() { - goto l56 + goto l60 } if buffer[position] != rune('?') { - goto l56 + goto l60 } position++ if !_rules[ruleExpression]() { - goto l56 + goto l60 } if buffer[position] != rune(':') { - goto l56 + goto l60 } position++ if !_rules[ruleExpression]() { - goto l56 + goto l60 } depth-- - add(ruleConditional, position57) + add(ruleConditional, position61) } return true - l56: - position, tokenIndex, depth = position56, tokenIndex56, depth56 + l60: + position, tokenIndex, depth = position60, tokenIndex60, depth60 return false }, /* 16 Level5 <- <(Level4 Concatenation*)> */ func() bool { - position58, tokenIndex58, depth58 := position, tokenIndex, depth + position62, tokenIndex62, depth62 := position, tokenIndex, depth { - position59 := position + position63 := position depth++ if !_rules[ruleLevel4]() { - goto l58 + goto l62 } - l60: + l64: { - position61, tokenIndex61, depth61 := position, tokenIndex, depth + position65, tokenIndex65, depth65 := position, tokenIndex, depth if !_rules[ruleConcatenation]() { - goto l61 + goto l65 } - goto l60 - l61: - position, tokenIndex, depth = position61, tokenIndex61, depth61 + goto l64 + l65: + position, tokenIndex, depth = position65, tokenIndex65, depth65 } depth-- - add(ruleLevel5, position59) + add(ruleLevel5, position63) } return true - l58: - position, tokenIndex, depth = position58, tokenIndex58, depth58 + l62: + position, tokenIndex, depth = position62, tokenIndex62, depth62 return false }, /* 17 Concatenation <- <(req_ws Level4)> */ func() bool { - position62, tokenIndex62, depth62 := position, tokenIndex, depth + position66, tokenIndex66, depth66 := position, tokenIndex, depth { - position63 := position + position67 := position depth++ if !_rules[rulereq_ws]() { - goto l62 + goto l66 } if !_rules[ruleLevel4]() { - goto l62 + goto l66 } depth-- - add(ruleConcatenation, position63) + add(ruleConcatenation, position67) } return true - l62: - position, tokenIndex, depth = position62, tokenIndex62, depth62 + l66: + position, tokenIndex, depth = position66, tokenIndex66, depth66 return false }, /* 18 Level4 <- <(Level3 (req_ws (LogOr / LogAnd))*)> */ func() bool { - position64, tokenIndex64, depth64 := position, tokenIndex, depth + position68, tokenIndex68, depth68 := position, tokenIndex, depth { - position65 := position + position69 := position depth++ if !_rules[ruleLevel3]() { - goto l64 + goto l68 } - l66: + l70: { - position67, tokenIndex67, depth67 := position, tokenIndex, depth + position71, tokenIndex71, depth71 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l67 + goto l71 } { - position68, tokenIndex68, depth68 := position, tokenIndex, depth + position72, tokenIndex72, depth72 := position, tokenIndex, depth if !_rules[ruleLogOr]() { - goto l69 + goto l73 } - goto l68 - l69: - position, tokenIndex, depth = position68, tokenIndex68, depth68 + goto l72 + l73: + position, tokenIndex, depth = position72, tokenIndex72, depth72 if !_rules[ruleLogAnd]() { - goto l67 + goto l71 } } - l68: - goto l66 - l67: - position, tokenIndex, depth = position67, tokenIndex67, depth67 + l72: + goto l70 + l71: + position, tokenIndex, depth = position71, tokenIndex71, depth71 } depth-- - add(ruleLevel4, position65) + add(ruleLevel4, position69) } return true - l64: - position, tokenIndex, depth = position64, tokenIndex64, depth64 + l68: + position, tokenIndex, depth = position68, tokenIndex68, depth68 return false }, /* 19 LogOr <- <('-' 'o' 'r' req_ws Level3)> */ func() bool { - position70, tokenIndex70, depth70 := position, tokenIndex, depth + position74, tokenIndex74, depth74 := position, tokenIndex, depth { - position71 := position + position75 := position depth++ if buffer[position] != rune('-') { - goto l70 + goto l74 } position++ if buffer[position] != rune('o') { - goto l70 + goto l74 } position++ if buffer[position] != rune('r') { - goto l70 + goto l74 } position++ if !_rules[rulereq_ws]() { - goto l70 + goto l74 } if !_rules[ruleLevel3]() { - goto l70 + goto l74 } depth-- - add(ruleLogOr, position71) + add(ruleLogOr, position75) } return true - l70: - position, tokenIndex, depth = position70, tokenIndex70, depth70 + l74: + position, tokenIndex, depth = position74, tokenIndex74, depth74 return false }, /* 20 LogAnd <- <('-' 'a' 'n' 'd' req_ws Level3)> */ func() bool { - position72, tokenIndex72, depth72 := position, tokenIndex, depth + position76, tokenIndex76, depth76 := position, tokenIndex, depth { - position73 := position + position77 := position depth++ if buffer[position] != rune('-') { - goto l72 + goto l76 } position++ if buffer[position] != rune('a') { - goto l72 + goto l76 } position++ if buffer[position] != rune('n') { - goto l72 + goto l76 } position++ if buffer[position] != rune('d') { - goto l72 + goto l76 } position++ if !_rules[rulereq_ws]() { - goto l72 + goto l76 } if !_rules[ruleLevel3]() { - goto l72 + goto l76 } depth-- - add(ruleLogAnd, position73) + add(ruleLogAnd, position77) } return true - l72: - position, tokenIndex, depth = position72, tokenIndex72, depth72 + l76: + position, tokenIndex, depth = position76, tokenIndex76, depth76 return false }, /* 21 Level3 <- <(Level2 (req_ws Comparison)*)> */ func() bool { - position74, tokenIndex74, depth74 := position, tokenIndex, depth + position78, tokenIndex78, depth78 := position, tokenIndex, depth { - position75 := position + position79 := position depth++ if !_rules[ruleLevel2]() { - goto l74 + goto l78 } - l76: + l80: { - position77, tokenIndex77, depth77 := position, tokenIndex, depth + position81, tokenIndex81, depth81 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l77 + goto l81 } if !_rules[ruleComparison]() { - goto l77 + goto l81 } - goto l76 - l77: - position, tokenIndex, depth = position77, tokenIndex77, depth77 + goto l80 + l81: + position, tokenIndex, depth = position81, tokenIndex81, depth81 } depth-- - add(ruleLevel3, position75) + add(ruleLevel3, position79) } return true - l74: - position, tokenIndex, depth = position74, tokenIndex74, depth74 + l78: + position, tokenIndex, depth = position78, tokenIndex78, depth78 return false }, /* 22 Comparison <- <(CompareOp req_ws Level2)> */ func() bool { - position78, tokenIndex78, depth78 := position, tokenIndex, depth + position82, tokenIndex82, depth82 := position, tokenIndex, depth { - position79 := position + position83 := position depth++ if !_rules[ruleCompareOp]() { - goto l78 + goto l82 } if !_rules[rulereq_ws]() { - goto l78 + goto l82 } if !_rules[ruleLevel2]() { - goto l78 + goto l82 } depth-- - add(ruleComparison, position79) + add(ruleComparison, position83) } return true - l78: - position, tokenIndex, depth = position78, tokenIndex78, depth78 + l82: + position, tokenIndex, depth = position82, tokenIndex82, depth82 return false }, /* 23 CompareOp <- <(('=' '=') / ('!' '=') / ('<' '=') / ('>' '=') / '>' / '<' / '>')> */ func() bool { - position80, tokenIndex80, depth80 := position, tokenIndex, depth + position84, tokenIndex84, depth84 := position, tokenIndex, depth { - position81 := position + position85 := position depth++ { - position82, tokenIndex82, depth82 := position, tokenIndex, depth + position86, tokenIndex86, depth86 := position, tokenIndex, depth if buffer[position] != rune('=') { - goto l83 + goto l87 } position++ if buffer[position] != rune('=') { - goto l83 + goto l87 } position++ - goto l82 - l83: - position, tokenIndex, depth = position82, tokenIndex82, depth82 + goto l86 + l87: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('!') { - goto l84 + goto l88 } position++ if buffer[position] != rune('=') { - goto l84 + goto l88 } position++ - goto l82 - l84: - position, tokenIndex, depth = position82, tokenIndex82, depth82 + goto l86 + l88: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('<') { - goto l85 + goto l89 } position++ if buffer[position] != rune('=') { - goto l85 + goto l89 } position++ - goto l82 - l85: - position, tokenIndex, depth = position82, tokenIndex82, depth82 + goto l86 + l89: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('>') { - goto l86 + goto l90 } position++ if buffer[position] != rune('=') { - goto l86 + goto l90 } position++ - goto l82 - l86: - position, tokenIndex, depth = position82, tokenIndex82, depth82 + goto l86 + l90: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('>') { - goto l87 + goto l91 } position++ - goto l82 - l87: - position, tokenIndex, depth = position82, tokenIndex82, depth82 + goto l86 + l91: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('<') { - goto l88 + goto l92 } position++ - goto l82 - l88: - position, tokenIndex, depth = position82, tokenIndex82, depth82 + goto l86 + l92: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('>') { - goto l80 + goto l84 } position++ } - l82: + l86: depth-- - add(ruleCompareOp, position81) + add(ruleCompareOp, position85) } return true - l80: - position, tokenIndex, depth = position80, tokenIndex80, depth80 + l84: + position, tokenIndex, depth = position84, tokenIndex84, depth84 return false }, /* 24 Level2 <- <(Level1 (req_ws (Addition / Subtraction))*)> */ func() bool { - position89, tokenIndex89, depth89 := position, tokenIndex, depth + position93, tokenIndex93, depth93 := position, tokenIndex, depth { - position90 := position + position94 := position depth++ if !_rules[ruleLevel1]() { - goto l89 + goto l93 } - l91: + l95: { - position92, tokenIndex92, depth92 := position, tokenIndex, depth + position96, tokenIndex96, depth96 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l92 + goto l96 } { - position93, tokenIndex93, depth93 := position, tokenIndex, depth + position97, tokenIndex97, depth97 := position, tokenIndex, depth if !_rules[ruleAddition]() { - goto l94 + goto l98 } - goto l93 - l94: - position, tokenIndex, depth = position93, tokenIndex93, depth93 + goto l97 + l98: + position, tokenIndex, depth = position97, tokenIndex97, depth97 if !_rules[ruleSubtraction]() { - goto l92 + goto l96 } } - l93: - goto l91 - l92: - position, tokenIndex, depth = position92, tokenIndex92, depth92 + l97: + goto l95 + l96: + position, tokenIndex, depth = position96, tokenIndex96, depth96 } depth-- - add(ruleLevel2, position90) + add(ruleLevel2, position94) } return true - l89: - position, tokenIndex, depth = position89, tokenIndex89, depth89 + l93: + position, tokenIndex, depth = position93, tokenIndex93, depth93 return false }, /* 25 Addition <- <('+' req_ws Level1)> */ func() bool { - position95, tokenIndex95, depth95 := position, tokenIndex, depth + position99, tokenIndex99, depth99 := position, tokenIndex, depth { - position96 := position + position100 := position depth++ if buffer[position] != rune('+') { - goto l95 + goto l99 } position++ if !_rules[rulereq_ws]() { - goto l95 + goto l99 } if !_rules[ruleLevel1]() { - goto l95 + goto l99 } depth-- - add(ruleAddition, position96) + add(ruleAddition, position100) } return true - l95: - position, tokenIndex, depth = position95, tokenIndex95, depth95 + l99: + position, tokenIndex, depth = position99, tokenIndex99, depth99 return false }, /* 26 Subtraction <- <('-' req_ws Level1)> */ func() bool { - position97, tokenIndex97, depth97 := position, tokenIndex, depth + position101, tokenIndex101, depth101 := position, tokenIndex, depth { - position98 := position + position102 := position depth++ if buffer[position] != rune('-') { - goto l97 + goto l101 } position++ if !_rules[rulereq_ws]() { - goto l97 + goto l101 } if !_rules[ruleLevel1]() { - goto l97 + goto l101 } depth-- - add(ruleSubtraction, position98) + add(ruleSubtraction, position102) } return true - l97: - position, tokenIndex, depth = position97, tokenIndex97, depth97 + l101: + position, tokenIndex, depth = position101, tokenIndex101, depth101 return false }, /* 27 Level1 <- <(Level0 (req_ws (Multiplication / Division / Modulo))*)> */ func() bool { - position99, tokenIndex99, depth99 := position, tokenIndex, depth + position103, tokenIndex103, depth103 := position, tokenIndex, depth { - position100 := position + position104 := position depth++ if !_rules[ruleLevel0]() { - goto l99 + goto l103 } - l101: + l105: { - position102, tokenIndex102, depth102 := position, tokenIndex, depth + position106, tokenIndex106, depth106 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l102 + goto l106 } { - position103, tokenIndex103, depth103 := position, tokenIndex, depth + position107, tokenIndex107, depth107 := position, tokenIndex, depth if !_rules[ruleMultiplication]() { - goto l104 + goto l108 } - goto l103 - l104: - position, tokenIndex, depth = position103, tokenIndex103, depth103 + goto l107 + l108: + position, tokenIndex, depth = position107, tokenIndex107, depth107 if !_rules[ruleDivision]() { - goto l105 + goto l109 } - goto l103 - l105: - position, tokenIndex, depth = position103, tokenIndex103, depth103 + goto l107 + l109: + position, tokenIndex, depth = position107, tokenIndex107, depth107 if !_rules[ruleModulo]() { - goto l102 + goto l106 } } - l103: - goto l101 - l102: - position, tokenIndex, depth = position102, tokenIndex102, depth102 + l107: + goto l105 + l106: + position, tokenIndex, depth = position106, tokenIndex106, depth106 } depth-- - add(ruleLevel1, position100) + add(ruleLevel1, position104) } return true - l99: - position, tokenIndex, depth = position99, tokenIndex99, depth99 + l103: + position, tokenIndex, depth = position103, tokenIndex103, depth103 return false }, /* 28 Multiplication <- <('*' req_ws Level0)> */ func() bool { - position106, tokenIndex106, depth106 := position, tokenIndex, depth + position110, tokenIndex110, depth110 := position, tokenIndex, depth { - position107 := position + position111 := position depth++ if buffer[position] != rune('*') { - goto l106 + goto l110 } position++ if !_rules[rulereq_ws]() { - goto l106 + goto l110 } if !_rules[ruleLevel0]() { - goto l106 + goto l110 } depth-- - add(ruleMultiplication, position107) + add(ruleMultiplication, position111) } return true - l106: - position, tokenIndex, depth = position106, tokenIndex106, depth106 + l110: + position, tokenIndex, depth = position110, tokenIndex110, depth110 return false }, /* 29 Division <- <('/' req_ws Level0)> */ func() bool { - position108, tokenIndex108, depth108 := position, tokenIndex, depth + position112, tokenIndex112, depth112 := position, tokenIndex, depth { - position109 := position + position113 := position depth++ if buffer[position] != rune('/') { - goto l108 + goto l112 } position++ if !_rules[rulereq_ws]() { - goto l108 + goto l112 } if !_rules[ruleLevel0]() { - goto l108 + goto l112 } depth-- - add(ruleDivision, position109) + add(ruleDivision, position113) } return true - l108: - position, tokenIndex, depth = position108, tokenIndex108, depth108 + l112: + position, tokenIndex, depth = position112, tokenIndex112, depth112 return false }, /* 30 Modulo <- <('%' req_ws Level0)> */ func() bool { - position110, tokenIndex110, depth110 := position, tokenIndex, depth + position114, tokenIndex114, depth114 := position, tokenIndex, depth { - position111 := position + position115 := position depth++ if buffer[position] != rune('%') { - goto l110 + goto l114 } position++ if !_rules[rulereq_ws]() { - goto l110 + goto l114 } if !_rules[ruleLevel0]() { - goto l110 + goto l114 } depth-- - add(ruleModulo, position111) + add(ruleModulo, position115) } return true - l110: - position, tokenIndex, depth = position110, tokenIndex110, depth110 + l114: + position, tokenIndex, depth = position114, tokenIndex114, depth114 return false }, /* 31 Level0 <- <(IP / String / Number / Boolean / Undefined / Nil / Symbol / Not / Substitution / Merge / Auto / Lambda / Chained)> */ func() bool { - position112, tokenIndex112, depth112 := position, tokenIndex, depth + position116, tokenIndex116, depth116 := position, tokenIndex, depth { - position113 := position + position117 := position depth++ { - position114, tokenIndex114, depth114 := position, tokenIndex, depth + position118, tokenIndex118, depth118 := position, tokenIndex, depth if !_rules[ruleIP]() { - goto l115 - } - goto l114 - l115: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleString]() { - goto l116 - } - goto l114 - l116: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleNumber]() { - goto l117 - } - goto l114 - l117: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleBoolean]() { - goto l118 - } - goto l114 - l118: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleUndefined]() { goto l119 } - goto l114 + goto l118 l119: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleNil]() { + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleString]() { goto l120 } - goto l114 + goto l118 l120: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleSymbol]() { + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleNumber]() { goto l121 } - goto l114 + goto l118 l121: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleNot]() { + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleBoolean]() { goto l122 } - goto l114 + goto l118 l122: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleSubstitution]() { + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleUndefined]() { goto l123 } - goto l114 + goto l118 l123: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleMerge]() { + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleNil]() { goto l124 } - goto l114 + goto l118 l124: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleAuto]() { + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleSymbol]() { goto l125 } - goto l114 + goto l118 l125: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleLambda]() { + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleNot]() { goto l126 } - goto l114 + goto l118 l126: - position, tokenIndex, depth = position114, tokenIndex114, depth114 - if !_rules[ruleChained]() { - goto l112 + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleSubstitution]() { + goto l127 } - } - l114: - depth-- - add(ruleLevel0, position113) - } + goto l118 + l127: + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleMerge]() { + goto l128 + } + goto l118 + l128: + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleAuto]() { + goto l129 + } + goto l118 + l129: + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleLambda]() { + goto l130 + } + goto l118 + l130: + position, tokenIndex, depth = position118, tokenIndex118, depth118 + if !_rules[ruleChained]() { + goto l116 + } + } + l118: + depth-- + add(ruleLevel0, position117) + } return true - l112: - position, tokenIndex, depth = position112, tokenIndex112, depth112 + l116: + position, tokenIndex, depth = position116, tokenIndex116, depth116 return false }, /* 32 Chained <- <((MapMapping / Sync / Catch / Mapping / MapSelection / Selection / Sum / List / Map / Range / Grouped / Reference) ChainedQualifiedExpression*)> */ func() bool { - position127, tokenIndex127, depth127 := position, tokenIndex, depth + position131, tokenIndex131, depth131 := position, tokenIndex, depth { - position128 := position + position132 := position depth++ { - position129, tokenIndex129, depth129 := position, tokenIndex, depth + position133, tokenIndex133, depth133 := position, tokenIndex, depth if !_rules[ruleMapMapping]() { - goto l130 - } - goto l129 - l130: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleSync]() { - goto l131 - } - goto l129 - l131: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleCatch]() { - goto l132 - } - goto l129 - l132: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleMapping]() { - goto l133 - } - goto l129 - l133: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleMapSelection]() { goto l134 } - goto l129 + goto l133 l134: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleSelection]() { + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleSync]() { goto l135 } - goto l129 + goto l133 l135: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleSum]() { + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleCatch]() { goto l136 } - goto l129 + goto l133 l136: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleList]() { + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleMapping]() { goto l137 } - goto l129 + goto l133 l137: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleMap]() { + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleMapSelection]() { goto l138 } - goto l129 + goto l133 l138: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleRange]() { + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleSelection]() { goto l139 } - goto l129 + goto l133 l139: - position, tokenIndex, depth = position129, tokenIndex129, depth129 - if !_rules[ruleGrouped]() { + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleSum]() { goto l140 } - goto l129 + goto l133 l140: - position, tokenIndex, depth = position129, tokenIndex129, depth129 + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleList]() { + goto l141 + } + goto l133 + l141: + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleMap]() { + goto l142 + } + goto l133 + l142: + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleRange]() { + goto l143 + } + goto l133 + l143: + position, tokenIndex, depth = position133, tokenIndex133, depth133 + if !_rules[ruleGrouped]() { + goto l144 + } + goto l133 + l144: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleReference]() { - goto l127 + goto l131 } } - l129: - l141: + l133: + l145: { - position142, tokenIndex142, depth142 := position, tokenIndex, depth + position146, tokenIndex146, depth146 := position, tokenIndex, depth if !_rules[ruleChainedQualifiedExpression]() { - goto l142 + goto l146 } - goto l141 - l142: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l145 + l146: + position, tokenIndex, depth = position146, tokenIndex146, depth146 } depth-- - add(ruleChained, position128) + add(ruleChained, position132) } return true - l127: - position, tokenIndex, depth = position127, tokenIndex127, depth127 + l131: + position, tokenIndex, depth = position131, tokenIndex131, depth131 return false }, /* 33 ChainedQualifiedExpression <- <(ChainedCall / Currying / ChainedRef / ChainedDynRef / Projection)> */ func() bool { - position143, tokenIndex143, depth143 := position, tokenIndex, depth + position147, tokenIndex147, depth147 := position, tokenIndex, depth { - position144 := position + position148 := position depth++ { - position145, tokenIndex145, depth145 := position, tokenIndex, depth + position149, tokenIndex149, depth149 := position, tokenIndex, depth if !_rules[ruleChainedCall]() { - goto l146 + goto l150 } - goto l145 - l146: - position, tokenIndex, depth = position145, tokenIndex145, depth145 + goto l149 + l150: + position, tokenIndex, depth = position149, tokenIndex149, depth149 if !_rules[ruleCurrying]() { - goto l147 + goto l151 } - goto l145 - l147: - position, tokenIndex, depth = position145, tokenIndex145, depth145 + goto l149 + l151: + position, tokenIndex, depth = position149, tokenIndex149, depth149 if !_rules[ruleChainedRef]() { - goto l148 + goto l152 } - goto l145 - l148: - position, tokenIndex, depth = position145, tokenIndex145, depth145 + goto l149 + l152: + position, tokenIndex, depth = position149, tokenIndex149, depth149 if !_rules[ruleChainedDynRef]() { - goto l149 + goto l153 } - goto l145 - l149: - position, tokenIndex, depth = position145, tokenIndex145, depth145 + goto l149 + l153: + position, tokenIndex, depth = position149, tokenIndex149, depth149 if !_rules[ruleProjection]() { - goto l143 + goto l147 } } - l145: + l149: depth-- - add(ruleChainedQualifiedExpression, position144) + add(ruleChainedQualifiedExpression, position148) } return true - l143: - position, tokenIndex, depth = position143, tokenIndex143, depth143 + l147: + position, tokenIndex, depth = position147, tokenIndex147, depth147 return false }, /* 34 ChainedRef <- <(PathComponent FollowUpRef)> */ func() bool { - position150, tokenIndex150, depth150 := position, tokenIndex, depth + position154, tokenIndex154, depth154 := position, tokenIndex, depth { - position151 := position + position155 := position depth++ if !_rules[rulePathComponent]() { - goto l150 + goto l154 } if !_rules[ruleFollowUpRef]() { - goto l150 + goto l154 } depth-- - add(ruleChainedRef, position151) + add(ruleChainedRef, position155) } return true - l150: - position, tokenIndex, depth = position150, tokenIndex150, depth150 + l154: + position, tokenIndex, depth = position154, tokenIndex154, depth154 return false }, /* 35 ChainedDynRef <- <('.'? '[' Expression ']')> */ func() bool { - position152, tokenIndex152, depth152 := position, tokenIndex, depth + position156, tokenIndex156, depth156 := position, tokenIndex, depth { - position153 := position + position157 := position depth++ { - position154, tokenIndex154, depth154 := position, tokenIndex, depth + position158, tokenIndex158, depth158 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l154 + goto l158 } position++ - goto l155 - l154: - position, tokenIndex, depth = position154, tokenIndex154, depth154 + goto l159 + l158: + position, tokenIndex, depth = position158, tokenIndex158, depth158 } - l155: + l159: if buffer[position] != rune('[') { - goto l152 + goto l156 } position++ if !_rules[ruleExpression]() { - goto l152 + goto l156 } if buffer[position] != rune(']') { - goto l152 + goto l156 } position++ depth-- - add(ruleChainedDynRef, position153) + add(ruleChainedDynRef, position157) } return true - l152: - position, tokenIndex, depth = position152, tokenIndex152, depth152 + l156: + position, tokenIndex, depth = position156, tokenIndex156, depth156 return false }, /* 36 Slice <- */ func() bool { - position156, tokenIndex156, depth156 := position, tokenIndex, depth + position160, tokenIndex160, depth160 := position, tokenIndex, depth { - position157 := position + position161 := position depth++ if !_rules[ruleRange]() { - goto l156 + goto l160 } depth-- - add(ruleSlice, position157) + add(ruleSlice, position161) } return true - l156: - position, tokenIndex, depth = position156, tokenIndex156, depth156 + l160: + position, tokenIndex, depth = position160, tokenIndex160, depth160 return false }, /* 37 Currying <- <('*' ChainedCall)> */ func() bool { - position158, tokenIndex158, depth158 := position, tokenIndex, depth + position162, tokenIndex162, depth162 := position, tokenIndex, depth { - position159 := position + position163 := position depth++ if buffer[position] != rune('*') { - goto l158 + goto l162 } position++ if !_rules[ruleChainedCall]() { - goto l158 + goto l162 } depth-- - add(ruleCurrying, position159) + add(ruleCurrying, position163) } return true - l158: - position, tokenIndex, depth = position158, tokenIndex158, depth158 + l162: + position, tokenIndex, depth = position162, tokenIndex162, depth162 return false }, /* 38 ChainedCall <- <(StartArguments NameArgumentList? ')')> */ func() bool { - position160, tokenIndex160, depth160 := position, tokenIndex, depth + position164, tokenIndex164, depth164 := position, tokenIndex, depth { - position161 := position + position165 := position depth++ if !_rules[ruleStartArguments]() { - goto l160 + goto l164 } { - position162, tokenIndex162, depth162 := position, tokenIndex, depth + position166, tokenIndex166, depth166 := position, tokenIndex, depth if !_rules[ruleNameArgumentList]() { - goto l162 + goto l166 } - goto l163 - l162: - position, tokenIndex, depth = position162, tokenIndex162, depth162 + goto l167 + l166: + position, tokenIndex, depth = position166, tokenIndex166, depth166 } - l163: + l167: if buffer[position] != rune(')') { - goto l160 + goto l164 } position++ depth-- - add(ruleChainedCall, position161) + add(ruleChainedCall, position165) } return true - l160: - position, tokenIndex, depth = position160, tokenIndex160, depth160 + l164: + position, tokenIndex, depth = position164, tokenIndex164, depth164 return false }, /* 39 StartArguments <- <('(' ws)> */ func() bool { - position164, tokenIndex164, depth164 := position, tokenIndex, depth + position168, tokenIndex168, depth168 := position, tokenIndex, depth { - position165 := position + position169 := position depth++ if buffer[position] != rune('(') { - goto l164 + goto l168 } position++ if !_rules[rulews]() { - goto l164 + goto l168 } depth-- - add(ruleStartArguments, position165) + add(ruleStartArguments, position169) } return true - l164: - position, tokenIndex, depth = position164, tokenIndex164, depth164 + l168: + position, tokenIndex, depth = position168, tokenIndex168, depth168 return false }, /* 40 NameArgumentList <- <(((NextNameArgument (',' NextNameArgument)*) / NextExpression) (',' NextExpression)*)> */ func() bool { - position166, tokenIndex166, depth166 := position, tokenIndex, depth + position170, tokenIndex170, depth170 := position, tokenIndex, depth { - position167 := position + position171 := position depth++ { - position168, tokenIndex168, depth168 := position, tokenIndex, depth + position172, tokenIndex172, depth172 := position, tokenIndex, depth if !_rules[ruleNextNameArgument]() { - goto l169 + goto l173 } - l170: + l174: { - position171, tokenIndex171, depth171 := position, tokenIndex, depth + position175, tokenIndex175, depth175 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l171 + goto l175 } position++ if !_rules[ruleNextNameArgument]() { - goto l171 + goto l175 } - goto l170 - l171: - position, tokenIndex, depth = position171, tokenIndex171, depth171 + goto l174 + l175: + position, tokenIndex, depth = position175, tokenIndex175, depth175 } - goto l168 - l169: - position, tokenIndex, depth = position168, tokenIndex168, depth168 + goto l172 + l173: + position, tokenIndex, depth = position172, tokenIndex172, depth172 if !_rules[ruleNextExpression]() { - goto l166 + goto l170 } } - l168: l172: + l176: { - position173, tokenIndex173, depth173 := position, tokenIndex, depth + position177, tokenIndex177, depth177 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l173 + goto l177 } position++ if !_rules[ruleNextExpression]() { - goto l173 + goto l177 } - goto l172 - l173: - position, tokenIndex, depth = position173, tokenIndex173, depth173 + goto l176 + l177: + position, tokenIndex, depth = position177, tokenIndex177, depth177 } depth-- - add(ruleNameArgumentList, position167) + add(ruleNameArgumentList, position171) } return true - l166: - position, tokenIndex, depth = position166, tokenIndex166, depth166 + l170: + position, tokenIndex, depth = position170, tokenIndex170, depth170 return false }, /* 41 NextNameArgument <- <(ws Name ws '=' ws Expression ws)> */ func() bool { - position174, tokenIndex174, depth174 := position, tokenIndex, depth + position178, tokenIndex178, depth178 := position, tokenIndex, depth { - position175 := position + position179 := position depth++ if !_rules[rulews]() { - goto l174 + goto l178 } if !_rules[ruleName]() { - goto l174 + goto l178 } if !_rules[rulews]() { - goto l174 + goto l178 } if buffer[position] != rune('=') { - goto l174 + goto l178 } position++ if !_rules[rulews]() { - goto l174 + goto l178 } if !_rules[ruleExpression]() { - goto l174 + goto l178 } if !_rules[rulews]() { - goto l174 + goto l178 } depth-- - add(ruleNextNameArgument, position175) + add(ruleNextNameArgument, position179) } return true - l174: - position, tokenIndex, depth = position174, tokenIndex174, depth174 + l178: + position, tokenIndex, depth = position178, tokenIndex178, depth178 return false }, /* 42 ExpressionList <- <(NextExpression (',' NextExpression)*)> */ func() bool { - position176, tokenIndex176, depth176 := position, tokenIndex, depth + position180, tokenIndex180, depth180 := position, tokenIndex, depth { - position177 := position + position181 := position depth++ if !_rules[ruleNextExpression]() { - goto l176 + goto l180 } - l178: + l182: { - position179, tokenIndex179, depth179 := position, tokenIndex, depth + position183, tokenIndex183, depth183 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l179 + goto l183 } position++ if !_rules[ruleNextExpression]() { - goto l179 + goto l183 } - goto l178 - l179: - position, tokenIndex, depth = position179, tokenIndex179, depth179 + goto l182 + l183: + position, tokenIndex, depth = position183, tokenIndex183, depth183 } depth-- - add(ruleExpressionList, position177) + add(ruleExpressionList, position181) } return true - l176: - position, tokenIndex, depth = position176, tokenIndex176, depth176 + l180: + position, tokenIndex, depth = position180, tokenIndex180, depth180 return false }, /* 43 NextExpression <- <(Expression ListExpansion?)> */ func() bool { - position180, tokenIndex180, depth180 := position, tokenIndex, depth + position184, tokenIndex184, depth184 := position, tokenIndex, depth { - position181 := position + position185 := position depth++ if !_rules[ruleExpression]() { - goto l180 + goto l184 } { - position182, tokenIndex182, depth182 := position, tokenIndex, depth + position186, tokenIndex186, depth186 := position, tokenIndex, depth if !_rules[ruleListExpansion]() { - goto l182 + goto l186 } - goto l183 - l182: - position, tokenIndex, depth = position182, tokenIndex182, depth182 + goto l187 + l186: + position, tokenIndex, depth = position186, tokenIndex186, depth186 } - l183: + l187: depth-- - add(ruleNextExpression, position181) + add(ruleNextExpression, position185) } return true - l180: - position, tokenIndex, depth = position180, tokenIndex180, depth180 + l184: + position, tokenIndex, depth = position184, tokenIndex184, depth184 return false }, /* 44 ListExpansion <- <('.' '.' '.' ws)> */ func() bool { - position184, tokenIndex184, depth184 := position, tokenIndex, depth + position188, tokenIndex188, depth188 := position, tokenIndex, depth { - position185 := position + position189 := position depth++ if buffer[position] != rune('.') { - goto l184 + goto l188 } position++ if buffer[position] != rune('.') { - goto l184 + goto l188 } position++ if buffer[position] != rune('.') { - goto l184 + goto l188 } position++ if !_rules[rulews]() { - goto l184 + goto l188 } depth-- - add(ruleListExpansion, position185) + add(ruleListExpansion, position189) } return true - l184: - position, tokenIndex, depth = position184, tokenIndex184, depth184 + l188: + position, tokenIndex, depth = position188, tokenIndex188, depth188 return false }, /* 45 Projection <- <('.'? (('[' '*' ']') / Slice) ProjectionValue ChainedQualifiedExpression*)> */ func() bool { - position186, tokenIndex186, depth186 := position, tokenIndex, depth + position190, tokenIndex190, depth190 := position, tokenIndex, depth { - position187 := position + position191 := position depth++ { - position188, tokenIndex188, depth188 := position, tokenIndex, depth + position192, tokenIndex192, depth192 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l188 + goto l192 } position++ - goto l189 - l188: - position, tokenIndex, depth = position188, tokenIndex188, depth188 + goto l193 + l192: + position, tokenIndex, depth = position192, tokenIndex192, depth192 } - l189: + l193: { - position190, tokenIndex190, depth190 := position, tokenIndex, depth + position194, tokenIndex194, depth194 := position, tokenIndex, depth if buffer[position] != rune('[') { - goto l191 + goto l195 } position++ if buffer[position] != rune('*') { - goto l191 + goto l195 } position++ if buffer[position] != rune(']') { - goto l191 + goto l195 } position++ - goto l190 - l191: - position, tokenIndex, depth = position190, tokenIndex190, depth190 + goto l194 + l195: + position, tokenIndex, depth = position194, tokenIndex194, depth194 if !_rules[ruleSlice]() { - goto l186 + goto l190 } } - l190: + l194: if !_rules[ruleProjectionValue]() { - goto l186 + goto l190 } - l192: + l196: { - position193, tokenIndex193, depth193 := position, tokenIndex, depth + position197, tokenIndex197, depth197 := position, tokenIndex, depth if !_rules[ruleChainedQualifiedExpression]() { - goto l193 + goto l197 } - goto l192 - l193: - position, tokenIndex, depth = position193, tokenIndex193, depth193 + goto l196 + l197: + position, tokenIndex, depth = position197, tokenIndex197, depth197 } depth-- - add(ruleProjection, position187) + add(ruleProjection, position191) } return true - l186: - position, tokenIndex, depth = position186, tokenIndex186, depth186 + l190: + position, tokenIndex, depth = position190, tokenIndex190, depth190 return false }, /* 46 ProjectionValue <- */ func() bool { - position194, tokenIndex194, depth194 := position, tokenIndex, depth + position198, tokenIndex198, depth198 := position, tokenIndex, depth { - position195 := position + position199 := position depth++ if !_rules[ruleAction0]() { - goto l194 + goto l198 } depth-- - add(ruleProjectionValue, position195) + add(ruleProjectionValue, position199) } return true - l194: - position, tokenIndex, depth = position194, tokenIndex194, depth194 + l198: + position, tokenIndex, depth = position198, tokenIndex198, depth198 return false }, /* 47 Substitution <- <('*' Level0)> */ func() bool { - position196, tokenIndex196, depth196 := position, tokenIndex, depth + position200, tokenIndex200, depth200 := position, tokenIndex, depth { - position197 := position + position201 := position depth++ if buffer[position] != rune('*') { - goto l196 + goto l200 } position++ if !_rules[ruleLevel0]() { - goto l196 + goto l200 } depth-- - add(ruleSubstitution, position197) + add(ruleSubstitution, position201) } return true - l196: - position, tokenIndex, depth = position196, tokenIndex196, depth196 + l200: + position, tokenIndex, depth = position200, tokenIndex200, depth200 return false }, /* 48 Not <- <('!' ws Level0)> */ func() bool { - position198, tokenIndex198, depth198 := position, tokenIndex, depth + position202, tokenIndex202, depth202 := position, tokenIndex, depth { - position199 := position + position203 := position depth++ if buffer[position] != rune('!') { - goto l198 + goto l202 } position++ if !_rules[rulews]() { - goto l198 + goto l202 } if !_rules[ruleLevel0]() { - goto l198 + goto l202 } depth-- - add(ruleNot, position199) + add(ruleNot, position203) } return true - l198: - position, tokenIndex, depth = position198, tokenIndex198, depth198 + l202: + position, tokenIndex, depth = position202, tokenIndex202, depth202 return false }, /* 49 Grouped <- <('(' Expression ')')> */ func() bool { - position200, tokenIndex200, depth200 := position, tokenIndex, depth + position204, tokenIndex204, depth204 := position, tokenIndex, depth { - position201 := position + position205 := position depth++ if buffer[position] != rune('(') { - goto l200 + goto l204 } position++ if !_rules[ruleExpression]() { - goto l200 + goto l204 } if buffer[position] != rune(')') { - goto l200 + goto l204 } position++ depth-- - add(ruleGrouped, position201) + add(ruleGrouped, position205) } return true - l200: - position, tokenIndex, depth = position200, tokenIndex200, depth200 + l204: + position, tokenIndex, depth = position204, tokenIndex204, depth204 return false }, /* 50 Range <- <(StartRange Expression? RangeOp Expression? ']')> */ func() bool { - position202, tokenIndex202, depth202 := position, tokenIndex, depth + position206, tokenIndex206, depth206 := position, tokenIndex, depth { - position203 := position + position207 := position depth++ if !_rules[ruleStartRange]() { - goto l202 + goto l206 } { - position204, tokenIndex204, depth204 := position, tokenIndex, depth + position208, tokenIndex208, depth208 := position, tokenIndex, depth if !_rules[ruleExpression]() { - goto l204 + goto l208 } - goto l205 - l204: - position, tokenIndex, depth = position204, tokenIndex204, depth204 + goto l209 + l208: + position, tokenIndex, depth = position208, tokenIndex208, depth208 } - l205: + l209: if !_rules[ruleRangeOp]() { - goto l202 + goto l206 } { - position206, tokenIndex206, depth206 := position, tokenIndex, depth + position210, tokenIndex210, depth210 := position, tokenIndex, depth if !_rules[ruleExpression]() { - goto l206 + goto l210 } - goto l207 - l206: - position, tokenIndex, depth = position206, tokenIndex206, depth206 + goto l211 + l210: + position, tokenIndex, depth = position210, tokenIndex210, depth210 } - l207: + l211: if buffer[position] != rune(']') { - goto l202 + goto l206 } position++ depth-- - add(ruleRange, position203) + add(ruleRange, position207) } return true - l202: - position, tokenIndex, depth = position202, tokenIndex202, depth202 + l206: + position, tokenIndex, depth = position206, tokenIndex206, depth206 return false }, /* 51 StartRange <- <'['> */ func() bool { - position208, tokenIndex208, depth208 := position, tokenIndex, depth + position212, tokenIndex212, depth212 := position, tokenIndex, depth { - position209 := position + position213 := position depth++ if buffer[position] != rune('[') { - goto l208 + goto l212 } position++ depth-- - add(ruleStartRange, position209) + add(ruleStartRange, position213) } return true - l208: - position, tokenIndex, depth = position208, tokenIndex208, depth208 + l212: + position, tokenIndex, depth = position212, tokenIndex212, depth212 return false }, /* 52 RangeOp <- <('.' '.')> */ func() bool { - position210, tokenIndex210, depth210 := position, tokenIndex, depth + position214, tokenIndex214, depth214 := position, tokenIndex, depth { - position211 := position + position215 := position depth++ if buffer[position] != rune('.') { - goto l210 + goto l214 } position++ if buffer[position] != rune('.') { - goto l210 + goto l214 } position++ depth-- - add(ruleRangeOp, position211) + add(ruleRangeOp, position215) } return true - l210: - position, tokenIndex, depth = position210, tokenIndex210, depth210 + l214: + position, tokenIndex, depth = position214, tokenIndex214, depth214 return false }, /* 53 Number <- <('-'? [0-9] ([0-9] / '_')* ('.' [0-9] [0-9]*)? (('e' / 'E') '-'? [0-9] [0-9]*)? !(':' ':'))> */ func() bool { - position212, tokenIndex212, depth212 := position, tokenIndex, depth + position216, tokenIndex216, depth216 := position, tokenIndex, depth { - position213 := position + position217 := position depth++ { - position214, tokenIndex214, depth214 := position, tokenIndex, depth + position218, tokenIndex218, depth218 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l214 + goto l218 } position++ - goto l215 - l214: - position, tokenIndex, depth = position214, tokenIndex214, depth214 + goto l219 + l218: + position, tokenIndex, depth = position218, tokenIndex218, depth218 } - l215: + l219: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l212 + goto l216 } position++ - l216: + l220: { - position217, tokenIndex217, depth217 := position, tokenIndex, depth + position221, tokenIndex221, depth221 := position, tokenIndex, depth { - position218, tokenIndex218, depth218 := position, tokenIndex, depth + position222, tokenIndex222, depth222 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l219 + goto l223 } position++ - goto l218 - l219: - position, tokenIndex, depth = position218, tokenIndex218, depth218 + goto l222 + l223: + position, tokenIndex, depth = position222, tokenIndex222, depth222 if buffer[position] != rune('_') { - goto l217 + goto l221 } position++ } - l218: - goto l216 - l217: - position, tokenIndex, depth = position217, tokenIndex217, depth217 + l222: + goto l220 + l221: + position, tokenIndex, depth = position221, tokenIndex221, depth221 } { - position220, tokenIndex220, depth220 := position, tokenIndex, depth + position224, tokenIndex224, depth224 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l220 + goto l224 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l220 + goto l224 } position++ - l222: + l226: { - position223, tokenIndex223, depth223 := position, tokenIndex, depth + position227, tokenIndex227, depth227 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l223 + goto l227 } position++ - goto l222 - l223: - position, tokenIndex, depth = position223, tokenIndex223, depth223 + goto l226 + l227: + position, tokenIndex, depth = position227, tokenIndex227, depth227 } - goto l221 - l220: - position, tokenIndex, depth = position220, tokenIndex220, depth220 + goto l225 + l224: + position, tokenIndex, depth = position224, tokenIndex224, depth224 } - l221: + l225: { - position224, tokenIndex224, depth224 := position, tokenIndex, depth + position228, tokenIndex228, depth228 := position, tokenIndex, depth { - position226, tokenIndex226, depth226 := position, tokenIndex, depth + position230, tokenIndex230, depth230 := position, tokenIndex, depth if buffer[position] != rune('e') { - goto l227 + goto l231 } position++ - goto l226 - l227: - position, tokenIndex, depth = position226, tokenIndex226, depth226 + goto l230 + l231: + position, tokenIndex, depth = position230, tokenIndex230, depth230 if buffer[position] != rune('E') { - goto l224 + goto l228 } position++ } - l226: + l230: { - position228, tokenIndex228, depth228 := position, tokenIndex, depth + position232, tokenIndex232, depth232 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l228 + goto l232 } position++ - goto l229 - l228: - position, tokenIndex, depth = position228, tokenIndex228, depth228 + goto l233 + l232: + position, tokenIndex, depth = position232, tokenIndex232, depth232 } - l229: + l233: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l224 + goto l228 } position++ - l230: + l234: { - position231, tokenIndex231, depth231 := position, tokenIndex, depth + position235, tokenIndex235, depth235 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l231 + goto l235 } position++ - goto l230 - l231: - position, tokenIndex, depth = position231, tokenIndex231, depth231 + goto l234 + l235: + position, tokenIndex, depth = position235, tokenIndex235, depth235 } - goto l225 - l224: - position, tokenIndex, depth = position224, tokenIndex224, depth224 + goto l229 + l228: + position, tokenIndex, depth = position228, tokenIndex228, depth228 } - l225: + l229: { - position232, tokenIndex232, depth232 := position, tokenIndex, depth + position236, tokenIndex236, depth236 := position, tokenIndex, depth if buffer[position] != rune(':') { - goto l232 + goto l236 } position++ if buffer[position] != rune(':') { - goto l232 + goto l236 } position++ - goto l212 - l232: - position, tokenIndex, depth = position232, tokenIndex232, depth232 + goto l216 + l236: + position, tokenIndex, depth = position236, tokenIndex236, depth236 } depth-- - add(ruleNumber, position213) + add(ruleNumber, position217) } return true - l212: - position, tokenIndex, depth = position212, tokenIndex212, depth212 + l216: + position, tokenIndex, depth = position216, tokenIndex216, depth216 return false }, /* 54 String <- <('"' (('\\' '"') / (!'"' .))* '"')> */ func() bool { - position233, tokenIndex233, depth233 := position, tokenIndex, depth + position237, tokenIndex237, depth237 := position, tokenIndex, depth { - position234 := position + position238 := position depth++ if buffer[position] != rune('"') { - goto l233 + goto l237 } position++ - l235: + l239: { - position236, tokenIndex236, depth236 := position, tokenIndex, depth + position240, tokenIndex240, depth240 := position, tokenIndex, depth { - position237, tokenIndex237, depth237 := position, tokenIndex, depth + position241, tokenIndex241, depth241 := position, tokenIndex, depth if buffer[position] != rune('\\') { - goto l238 + goto l242 } position++ if buffer[position] != rune('"') { - goto l238 + goto l242 } position++ - goto l237 - l238: - position, tokenIndex, depth = position237, tokenIndex237, depth237 + goto l241 + l242: + position, tokenIndex, depth = position241, tokenIndex241, depth241 { - position239, tokenIndex239, depth239 := position, tokenIndex, depth + position243, tokenIndex243, depth243 := position, tokenIndex, depth if buffer[position] != rune('"') { - goto l239 + goto l243 } position++ - goto l236 - l239: - position, tokenIndex, depth = position239, tokenIndex239, depth239 + goto l240 + l243: + position, tokenIndex, depth = position243, tokenIndex243, depth243 } if !matchDot() { - goto l236 + goto l240 } } - l237: - goto l235 - l236: - position, tokenIndex, depth = position236, tokenIndex236, depth236 + l241: + goto l239 + l240: + position, tokenIndex, depth = position240, tokenIndex240, depth240 } if buffer[position] != rune('"') { - goto l233 + goto l237 } position++ depth-- - add(ruleString, position234) + add(ruleString, position238) } return true - l233: - position, tokenIndex, depth = position233, tokenIndex233, depth233 + l237: + position, tokenIndex, depth = position237, tokenIndex237, depth237 return false }, /* 55 Boolean <- <(('t' 'r' 'u' 'e') / ('f' 'a' 'l' 's' 'e'))> */ func() bool { - position240, tokenIndex240, depth240 := position, tokenIndex, depth + position244, tokenIndex244, depth244 := position, tokenIndex, depth { - position241 := position + position245 := position depth++ { - position242, tokenIndex242, depth242 := position, tokenIndex, depth + position246, tokenIndex246, depth246 := position, tokenIndex, depth if buffer[position] != rune('t') { - goto l243 + goto l247 } position++ if buffer[position] != rune('r') { - goto l243 + goto l247 } position++ if buffer[position] != rune('u') { - goto l243 + goto l247 } position++ if buffer[position] != rune('e') { - goto l243 + goto l247 } position++ - goto l242 - l243: - position, tokenIndex, depth = position242, tokenIndex242, depth242 + goto l246 + l247: + position, tokenIndex, depth = position246, tokenIndex246, depth246 if buffer[position] != rune('f') { - goto l240 + goto l244 } position++ if buffer[position] != rune('a') { - goto l240 + goto l244 } position++ if buffer[position] != rune('l') { - goto l240 + goto l244 } position++ if buffer[position] != rune('s') { - goto l240 + goto l244 } position++ if buffer[position] != rune('e') { - goto l240 + goto l244 } position++ } - l242: + l246: depth-- - add(ruleBoolean, position241) + add(ruleBoolean, position245) } return true - l240: - position, tokenIndex, depth = position240, tokenIndex240, depth240 + l244: + position, tokenIndex, depth = position244, tokenIndex244, depth244 return false }, /* 56 Nil <- <(('n' 'i' 'l') / '~')> */ func() bool { - position244, tokenIndex244, depth244 := position, tokenIndex, depth + position248, tokenIndex248, depth248 := position, tokenIndex, depth { - position245 := position + position249 := position depth++ { - position246, tokenIndex246, depth246 := position, tokenIndex, depth + position250, tokenIndex250, depth250 := position, tokenIndex, depth if buffer[position] != rune('n') { - goto l247 + goto l251 } position++ if buffer[position] != rune('i') { - goto l247 + goto l251 } position++ if buffer[position] != rune('l') { - goto l247 + goto l251 } position++ - goto l246 - l247: - position, tokenIndex, depth = position246, tokenIndex246, depth246 + goto l250 + l251: + position, tokenIndex, depth = position250, tokenIndex250, depth250 if buffer[position] != rune('~') { - goto l244 + goto l248 } position++ } - l246: + l250: depth-- - add(ruleNil, position245) + add(ruleNil, position249) } return true - l244: - position, tokenIndex, depth = position244, tokenIndex244, depth244 + l248: + position, tokenIndex, depth = position248, tokenIndex248, depth248 return false }, /* 57 Undefined <- <('~' '~')> */ func() bool { - position248, tokenIndex248, depth248 := position, tokenIndex, depth + position252, tokenIndex252, depth252 := position, tokenIndex, depth { - position249 := position + position253 := position depth++ if buffer[position] != rune('~') { - goto l248 + goto l252 } position++ if buffer[position] != rune('~') { - goto l248 + goto l252 } position++ depth-- - add(ruleUndefined, position249) + add(ruleUndefined, position253) } return true - l248: - position, tokenIndex, depth = position248, tokenIndex248, depth248 + l252: + position, tokenIndex, depth = position252, tokenIndex252, depth252 return false }, /* 58 Symbol <- <('$' Name)> */ func() bool { - position250, tokenIndex250, depth250 := position, tokenIndex, depth + position254, tokenIndex254, depth254 := position, tokenIndex, depth { - position251 := position + position255 := position depth++ if buffer[position] != rune('$') { - goto l250 + goto l254 } position++ if !_rules[ruleName]() { - goto l250 + goto l254 } depth-- - add(ruleSymbol, position251) + add(ruleSymbol, position255) } return true - l250: - position, tokenIndex, depth = position250, tokenIndex250, depth250 + l254: + position, tokenIndex, depth = position254, tokenIndex254, depth254 return false }, /* 59 List <- <(StartList ExpressionList? ']')> */ func() bool { - position252, tokenIndex252, depth252 := position, tokenIndex, depth + position256, tokenIndex256, depth256 := position, tokenIndex, depth { - position253 := position + position257 := position depth++ if !_rules[ruleStartList]() { - goto l252 + goto l256 } { - position254, tokenIndex254, depth254 := position, tokenIndex, depth + position258, tokenIndex258, depth258 := position, tokenIndex, depth if !_rules[ruleExpressionList]() { - goto l254 + goto l258 } - goto l255 - l254: - position, tokenIndex, depth = position254, tokenIndex254, depth254 + goto l259 + l258: + position, tokenIndex, depth = position258, tokenIndex258, depth258 } - l255: + l259: if buffer[position] != rune(']') { - goto l252 + goto l256 } position++ depth-- - add(ruleList, position253) + add(ruleList, position257) } return true - l252: - position, tokenIndex, depth = position252, tokenIndex252, depth252 + l256: + position, tokenIndex, depth = position256, tokenIndex256, depth256 return false }, /* 60 StartList <- <('[' ws)> */ func() bool { - position256, tokenIndex256, depth256 := position, tokenIndex, depth + position260, tokenIndex260, depth260 := position, tokenIndex, depth { - position257 := position + position261 := position depth++ if buffer[position] != rune('[') { - goto l256 + goto l260 } position++ if !_rules[rulews]() { - goto l256 + goto l260 } depth-- - add(ruleStartList, position257) + add(ruleStartList, position261) } return true - l256: - position, tokenIndex, depth = position256, tokenIndex256, depth256 + l260: + position, tokenIndex, depth = position260, tokenIndex260, depth260 return false }, /* 61 Map <- <(CreateMap ws Assignments? '}')> */ func() bool { - position258, tokenIndex258, depth258 := position, tokenIndex, depth + position262, tokenIndex262, depth262 := position, tokenIndex, depth { - position259 := position + position263 := position depth++ if !_rules[ruleCreateMap]() { - goto l258 + goto l262 } if !_rules[rulews]() { - goto l258 + goto l262 } { - position260, tokenIndex260, depth260 := position, tokenIndex, depth + position264, tokenIndex264, depth264 := position, tokenIndex, depth if !_rules[ruleAssignments]() { - goto l260 + goto l264 } - goto l261 - l260: - position, tokenIndex, depth = position260, tokenIndex260, depth260 + goto l265 + l264: + position, tokenIndex, depth = position264, tokenIndex264, depth264 } - l261: + l265: if buffer[position] != rune('}') { - goto l258 + goto l262 } position++ depth-- - add(ruleMap, position259) + add(ruleMap, position263) } return true - l258: - position, tokenIndex, depth = position258, tokenIndex258, depth258 + l262: + position, tokenIndex, depth = position262, tokenIndex262, depth262 return false }, /* 62 CreateMap <- <'{'> */ func() bool { - position262, tokenIndex262, depth262 := position, tokenIndex, depth + position266, tokenIndex266, depth266 := position, tokenIndex, depth { - position263 := position + position267 := position depth++ if buffer[position] != rune('{') { - goto l262 + goto l266 } position++ depth-- - add(ruleCreateMap, position263) + add(ruleCreateMap, position267) } return true - l262: - position, tokenIndex, depth = position262, tokenIndex262, depth262 + l266: + position, tokenIndex, depth = position266, tokenIndex266, depth266 return false }, /* 63 Assignments <- <(Assignment (',' Assignment)*)> */ func() bool { - position264, tokenIndex264, depth264 := position, tokenIndex, depth + position268, tokenIndex268, depth268 := position, tokenIndex, depth { - position265 := position + position269 := position depth++ if !_rules[ruleAssignment]() { - goto l264 + goto l268 } - l266: + l270: { - position267, tokenIndex267, depth267 := position, tokenIndex, depth + position271, tokenIndex271, depth271 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l267 + goto l271 } position++ if !_rules[ruleAssignment]() { - goto l267 + goto l271 } - goto l266 - l267: - position, tokenIndex, depth = position267, tokenIndex267, depth267 + goto l270 + l271: + position, tokenIndex, depth = position271, tokenIndex271, depth271 } depth-- - add(ruleAssignments, position265) + add(ruleAssignments, position269) } return true - l264: - position, tokenIndex, depth = position264, tokenIndex264, depth264 + l268: + position, tokenIndex, depth = position268, tokenIndex268, depth268 return false }, /* 64 Assignment <- <(Expression '=' Expression)> */ func() bool { - position268, tokenIndex268, depth268 := position, tokenIndex, depth + position272, tokenIndex272, depth272 := position, tokenIndex, depth { - position269 := position + position273 := position depth++ if !_rules[ruleExpression]() { - goto l268 + goto l272 } if buffer[position] != rune('=') { - goto l268 + goto l272 } position++ if !_rules[ruleExpression]() { - goto l268 + goto l272 } depth-- - add(ruleAssignment, position269) + add(ruleAssignment, position273) } return true - l268: - position, tokenIndex, depth = position268, tokenIndex268, depth268 + l272: + position, tokenIndex, depth = position272, tokenIndex272, depth272 return false }, /* 65 Merge <- <(RefMerge / SimpleMerge)> */ func() bool { - position270, tokenIndex270, depth270 := position, tokenIndex, depth + position274, tokenIndex274, depth274 := position, tokenIndex, depth { - position271 := position + position275 := position depth++ { - position272, tokenIndex272, depth272 := position, tokenIndex, depth + position276, tokenIndex276, depth276 := position, tokenIndex, depth if !_rules[ruleRefMerge]() { - goto l273 + goto l277 } - goto l272 - l273: - position, tokenIndex, depth = position272, tokenIndex272, depth272 + goto l276 + l277: + position, tokenIndex, depth = position276, tokenIndex276, depth276 if !_rules[ruleSimpleMerge]() { - goto l270 + goto l274 } } - l272: + l276: depth-- - add(ruleMerge, position271) + add(ruleMerge, position275) } return true - l270: - position, tokenIndex, depth = position270, tokenIndex270, depth270 + l274: + position, tokenIndex, depth = position274, tokenIndex274, depth274 return false }, /* 66 RefMerge <- <('m' 'e' 'r' 'g' 'e' !(req_ws Required) (req_ws (Replace / On))? req_ws Reference)> */ func() bool { - position274, tokenIndex274, depth274 := position, tokenIndex, depth + position278, tokenIndex278, depth278 := position, tokenIndex, depth { - position275 := position + position279 := position depth++ if buffer[position] != rune('m') { - goto l274 + goto l278 } position++ if buffer[position] != rune('e') { - goto l274 + goto l278 } position++ if buffer[position] != rune('r') { - goto l274 + goto l278 } position++ if buffer[position] != rune('g') { - goto l274 + goto l278 } position++ if buffer[position] != rune('e') { - goto l274 + goto l278 } position++ { - position276, tokenIndex276, depth276 := position, tokenIndex, depth + position280, tokenIndex280, depth280 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l276 + goto l280 } if !_rules[ruleRequired]() { - goto l276 + goto l280 } - goto l274 - l276: - position, tokenIndex, depth = position276, tokenIndex276, depth276 + goto l278 + l280: + position, tokenIndex, depth = position280, tokenIndex280, depth280 } { - position277, tokenIndex277, depth277 := position, tokenIndex, depth + position281, tokenIndex281, depth281 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l277 + goto l281 } { - position279, tokenIndex279, depth279 := position, tokenIndex, depth + position283, tokenIndex283, depth283 := position, tokenIndex, depth if !_rules[ruleReplace]() { - goto l280 + goto l284 } - goto l279 - l280: - position, tokenIndex, depth = position279, tokenIndex279, depth279 + goto l283 + l284: + position, tokenIndex, depth = position283, tokenIndex283, depth283 if !_rules[ruleOn]() { - goto l277 + goto l281 } } - l279: - goto l278 - l277: - position, tokenIndex, depth = position277, tokenIndex277, depth277 + l283: + goto l282 + l281: + position, tokenIndex, depth = position281, tokenIndex281, depth281 } - l278: + l282: if !_rules[rulereq_ws]() { - goto l274 + goto l278 } if !_rules[ruleReference]() { - goto l274 + goto l278 } depth-- - add(ruleRefMerge, position275) + add(ruleRefMerge, position279) } return true - l274: - position, tokenIndex, depth = position274, tokenIndex274, depth274 + l278: + position, tokenIndex, depth = position278, tokenIndex278, depth278 return false }, /* 67 SimpleMerge <- <('m' 'e' 'r' 'g' 'e' !'(' (req_ws (Replace / Required / On))?)> */ func() bool { - position281, tokenIndex281, depth281 := position, tokenIndex, depth + position285, tokenIndex285, depth285 := position, tokenIndex, depth { - position282 := position + position286 := position depth++ if buffer[position] != rune('m') { - goto l281 + goto l285 } position++ if buffer[position] != rune('e') { - goto l281 + goto l285 } position++ if buffer[position] != rune('r') { - goto l281 + goto l285 } position++ if buffer[position] != rune('g') { - goto l281 + goto l285 } position++ if buffer[position] != rune('e') { - goto l281 + goto l285 } position++ { - position283, tokenIndex283, depth283 := position, tokenIndex, depth + position287, tokenIndex287, depth287 := position, tokenIndex, depth if buffer[position] != rune('(') { - goto l283 + goto l287 } position++ - goto l281 - l283: - position, tokenIndex, depth = position283, tokenIndex283, depth283 + goto l285 + l287: + position, tokenIndex, depth = position287, tokenIndex287, depth287 } { - position284, tokenIndex284, depth284 := position, tokenIndex, depth + position288, tokenIndex288, depth288 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l284 + goto l288 } { - position286, tokenIndex286, depth286 := position, tokenIndex, depth + position290, tokenIndex290, depth290 := position, tokenIndex, depth if !_rules[ruleReplace]() { - goto l287 + goto l291 } - goto l286 - l287: - position, tokenIndex, depth = position286, tokenIndex286, depth286 + goto l290 + l291: + position, tokenIndex, depth = position290, tokenIndex290, depth290 if !_rules[ruleRequired]() { - goto l288 + goto l292 } - goto l286 - l288: - position, tokenIndex, depth = position286, tokenIndex286, depth286 + goto l290 + l292: + position, tokenIndex, depth = position290, tokenIndex290, depth290 if !_rules[ruleOn]() { - goto l284 + goto l288 } } - l286: - goto l285 - l284: - position, tokenIndex, depth = position284, tokenIndex284, depth284 + l290: + goto l289 + l288: + position, tokenIndex, depth = position288, tokenIndex288, depth288 } - l285: + l289: depth-- - add(ruleSimpleMerge, position282) + add(ruleSimpleMerge, position286) } return true - l281: - position, tokenIndex, depth = position281, tokenIndex281, depth281 + l285: + position, tokenIndex, depth = position285, tokenIndex285, depth285 return false }, /* 68 Replace <- <('r' 'e' 'p' 'l' 'a' 'c' 'e')> */ func() bool { - position289, tokenIndex289, depth289 := position, tokenIndex, depth + position293, tokenIndex293, depth293 := position, tokenIndex, depth { - position290 := position + position294 := position depth++ if buffer[position] != rune('r') { - goto l289 + goto l293 } position++ if buffer[position] != rune('e') { - goto l289 + goto l293 } position++ if buffer[position] != rune('p') { - goto l289 + goto l293 } position++ if buffer[position] != rune('l') { - goto l289 + goto l293 } position++ if buffer[position] != rune('a') { - goto l289 + goto l293 } position++ if buffer[position] != rune('c') { - goto l289 + goto l293 } position++ if buffer[position] != rune('e') { - goto l289 + goto l293 } position++ depth-- - add(ruleReplace, position290) + add(ruleReplace, position294) } return true - l289: - position, tokenIndex, depth = position289, tokenIndex289, depth289 + l293: + position, tokenIndex, depth = position293, tokenIndex293, depth293 return false }, /* 69 Required <- <('r' 'e' 'q' 'u' 'i' 'r' 'e' 'd')> */ func() bool { - position291, tokenIndex291, depth291 := position, tokenIndex, depth + position295, tokenIndex295, depth295 := position, tokenIndex, depth { - position292 := position + position296 := position depth++ if buffer[position] != rune('r') { - goto l291 + goto l295 } position++ if buffer[position] != rune('e') { - goto l291 + goto l295 } position++ if buffer[position] != rune('q') { - goto l291 + goto l295 } position++ if buffer[position] != rune('u') { - goto l291 + goto l295 } position++ if buffer[position] != rune('i') { - goto l291 + goto l295 } position++ if buffer[position] != rune('r') { - goto l291 + goto l295 } position++ if buffer[position] != rune('e') { - goto l291 + goto l295 } position++ if buffer[position] != rune('d') { - goto l291 + goto l295 } position++ depth-- - add(ruleRequired, position292) + add(ruleRequired, position296) } return true - l291: - position, tokenIndex, depth = position291, tokenIndex291, depth291 + l295: + position, tokenIndex, depth = position295, tokenIndex295, depth295 return false }, /* 70 On <- <('o' 'n' req_ws Name)> */ func() bool { - position293, tokenIndex293, depth293 := position, tokenIndex, depth + position297, tokenIndex297, depth297 := position, tokenIndex, depth { - position294 := position + position298 := position depth++ if buffer[position] != rune('o') { - goto l293 + goto l297 } position++ if buffer[position] != rune('n') { - goto l293 + goto l297 } position++ if !_rules[rulereq_ws]() { - goto l293 + goto l297 } if !_rules[ruleName]() { - goto l293 + goto l297 } depth-- - add(ruleOn, position294) + add(ruleOn, position298) } return true - l293: - position, tokenIndex, depth = position293, tokenIndex293, depth293 + l297: + position, tokenIndex, depth = position297, tokenIndex297, depth297 return false }, /* 71 Auto <- <('a' 'u' 't' 'o')> */ func() bool { - position295, tokenIndex295, depth295 := position, tokenIndex, depth + position299, tokenIndex299, depth299 := position, tokenIndex, depth { - position296 := position + position300 := position depth++ if buffer[position] != rune('a') { - goto l295 + goto l299 } position++ if buffer[position] != rune('u') { - goto l295 + goto l299 } position++ if buffer[position] != rune('t') { - goto l295 + goto l299 } position++ if buffer[position] != rune('o') { - goto l295 + goto l299 } position++ depth-- - add(ruleAuto, position296) + add(ruleAuto, position300) } return true - l295: - position, tokenIndex, depth = position295, tokenIndex295, depth295 + l299: + position, tokenIndex, depth = position299, tokenIndex299, depth299 return false }, /* 72 Default <- */ func() bool { - position297, tokenIndex297, depth297 := position, tokenIndex, depth + position301, tokenIndex301, depth301 := position, tokenIndex, depth { - position298 := position + position302 := position depth++ if !_rules[ruleAction1]() { - goto l297 + goto l301 } depth-- - add(ruleDefault, position298) + add(ruleDefault, position302) } return true - l297: - position, tokenIndex, depth = position297, tokenIndex297, depth297 + l301: + position, tokenIndex, depth = position301, tokenIndex301, depth301 return false }, /* 73 Sync <- <('s' 'y' 'n' 'c' '[' Level7 ((((LambdaExpr LambdaExt) / (LambdaOrExpr LambdaOrExpr)) (('|' Expression) / Default)) / (LambdaOrExpr Default Default)) ']')> */ func() bool { - position299, tokenIndex299, depth299 := position, tokenIndex, depth + position303, tokenIndex303, depth303 := position, tokenIndex, depth { - position300 := position + position304 := position depth++ if buffer[position] != rune('s') { - goto l299 + goto l303 } position++ if buffer[position] != rune('y') { - goto l299 + goto l303 } position++ if buffer[position] != rune('n') { - goto l299 + goto l303 } position++ if buffer[position] != rune('c') { - goto l299 + goto l303 } position++ if buffer[position] != rune('[') { - goto l299 + goto l303 } position++ if !_rules[ruleLevel7]() { - goto l299 + goto l303 } { - position301, tokenIndex301, depth301 := position, tokenIndex, depth + position305, tokenIndex305, depth305 := position, tokenIndex, depth { - position303, tokenIndex303, depth303 := position, tokenIndex, depth + position307, tokenIndex307, depth307 := position, tokenIndex, depth if !_rules[ruleLambdaExpr]() { - goto l304 + goto l308 } if !_rules[ruleLambdaExt]() { - goto l304 + goto l308 } - goto l303 - l304: - position, tokenIndex, depth = position303, tokenIndex303, depth303 + goto l307 + l308: + position, tokenIndex, depth = position307, tokenIndex307, depth307 if !_rules[ruleLambdaOrExpr]() { - goto l302 + goto l306 } if !_rules[ruleLambdaOrExpr]() { - goto l302 + goto l306 } } - l303: + l307: { - position305, tokenIndex305, depth305 := position, tokenIndex, depth + position309, tokenIndex309, depth309 := position, tokenIndex, depth if buffer[position] != rune('|') { - goto l306 + goto l310 } position++ if !_rules[ruleExpression]() { - goto l306 + goto l310 } - goto l305 - l306: - position, tokenIndex, depth = position305, tokenIndex305, depth305 + goto l309 + l310: + position, tokenIndex, depth = position309, tokenIndex309, depth309 if !_rules[ruleDefault]() { - goto l302 + goto l306 } } - l305: - goto l301 - l302: - position, tokenIndex, depth = position301, tokenIndex301, depth301 + l309: + goto l305 + l306: + position, tokenIndex, depth = position305, tokenIndex305, depth305 if !_rules[ruleLambdaOrExpr]() { - goto l299 + goto l303 } if !_rules[ruleDefault]() { - goto l299 + goto l303 } if !_rules[ruleDefault]() { - goto l299 + goto l303 } } - l301: + l305: if buffer[position] != rune(']') { - goto l299 + goto l303 } position++ depth-- - add(ruleSync, position300) + add(ruleSync, position304) } return true - l299: - position, tokenIndex, depth = position299, tokenIndex299, depth299 + l303: + position, tokenIndex, depth = position303, tokenIndex303, depth303 return false }, /* 74 LambdaExt <- <(',' Expression)> */ func() bool { - position307, tokenIndex307, depth307 := position, tokenIndex, depth + position311, tokenIndex311, depth311 := position, tokenIndex, depth { - position308 := position + position312 := position depth++ if buffer[position] != rune(',') { - goto l307 + goto l311 } position++ if !_rules[ruleExpression]() { - goto l307 + goto l311 } depth-- - add(ruleLambdaExt, position308) + add(ruleLambdaExt, position312) } return true - l307: - position, tokenIndex, depth = position307, tokenIndex307, depth307 + l311: + position, tokenIndex, depth = position311, tokenIndex311, depth311 return false }, /* 75 LambdaOrExpr <- <(LambdaExpr / ('|' Expression))> */ func() bool { - position309, tokenIndex309, depth309 := position, tokenIndex, depth + position313, tokenIndex313, depth313 := position, tokenIndex, depth { - position310 := position + position314 := position depth++ { - position311, tokenIndex311, depth311 := position, tokenIndex, depth + position315, tokenIndex315, depth315 := position, tokenIndex, depth if !_rules[ruleLambdaExpr]() { - goto l312 + goto l316 } - goto l311 - l312: - position, tokenIndex, depth = position311, tokenIndex311, depth311 + goto l315 + l316: + position, tokenIndex, depth = position315, tokenIndex315, depth315 if buffer[position] != rune('|') { - goto l309 + goto l313 } position++ if !_rules[ruleExpression]() { - goto l309 + goto l313 } } - l311: + l315: depth-- - add(ruleLambdaOrExpr, position310) + add(ruleLambdaOrExpr, position314) } return true - l309: - position, tokenIndex, depth = position309, tokenIndex309, depth309 + l313: + position, tokenIndex, depth = position313, tokenIndex313, depth313 return false }, /* 76 Catch <- <('c' 'a' 't' 'c' 'h' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position313, tokenIndex313, depth313 := position, tokenIndex, depth + position317, tokenIndex317, depth317 := position, tokenIndex, depth { - position314 := position + position318 := position depth++ if buffer[position] != rune('c') { - goto l313 + goto l317 } position++ if buffer[position] != rune('a') { - goto l313 + goto l317 } position++ if buffer[position] != rune('t') { - goto l313 + goto l317 } position++ if buffer[position] != rune('c') { - goto l313 + goto l317 } position++ if buffer[position] != rune('h') { - goto l313 + goto l317 } position++ if buffer[position] != rune('[') { - goto l313 + goto l317 } position++ if !_rules[ruleLevel7]() { - goto l313 + goto l317 } if !_rules[ruleLambdaOrExpr]() { - goto l313 + goto l317 } if buffer[position] != rune(']') { - goto l313 + goto l317 } position++ depth-- - add(ruleCatch, position314) + add(ruleCatch, position318) } return true - l313: - position, tokenIndex, depth = position313, tokenIndex313, depth313 + l317: + position, tokenIndex, depth = position317, tokenIndex317, depth317 return false }, /* 77 MapMapping <- <('m' 'a' 'p' '{' Level7 LambdaOrExpr '}')> */ func() bool { - position315, tokenIndex315, depth315 := position, tokenIndex, depth + position319, tokenIndex319, depth319 := position, tokenIndex, depth { - position316 := position + position320 := position depth++ if buffer[position] != rune('m') { - goto l315 + goto l319 } position++ if buffer[position] != rune('a') { - goto l315 + goto l319 } position++ if buffer[position] != rune('p') { - goto l315 + goto l319 } position++ if buffer[position] != rune('{') { - goto l315 + goto l319 } position++ if !_rules[ruleLevel7]() { - goto l315 + goto l319 } if !_rules[ruleLambdaOrExpr]() { - goto l315 + goto l319 } if buffer[position] != rune('}') { - goto l315 + goto l319 } position++ depth-- - add(ruleMapMapping, position316) + add(ruleMapMapping, position320) } return true - l315: - position, tokenIndex, depth = position315, tokenIndex315, depth315 + l319: + position, tokenIndex, depth = position319, tokenIndex319, depth319 return false }, /* 78 Mapping <- <('m' 'a' 'p' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position317, tokenIndex317, depth317 := position, tokenIndex, depth + position321, tokenIndex321, depth321 := position, tokenIndex, depth { - position318 := position + position322 := position depth++ if buffer[position] != rune('m') { - goto l317 + goto l321 } position++ if buffer[position] != rune('a') { - goto l317 + goto l321 } position++ if buffer[position] != rune('p') { - goto l317 + goto l321 } position++ if buffer[position] != rune('[') { - goto l317 + goto l321 } position++ if !_rules[ruleLevel7]() { - goto l317 + goto l321 } if !_rules[ruleLambdaOrExpr]() { - goto l317 + goto l321 } if buffer[position] != rune(']') { - goto l317 + goto l321 } position++ depth-- - add(ruleMapping, position318) + add(ruleMapping, position322) } return true - l317: - position, tokenIndex, depth = position317, tokenIndex317, depth317 + l321: + position, tokenIndex, depth = position321, tokenIndex321, depth321 return false }, /* 79 MapSelection <- <('s' 'e' 'l' 'e' 'c' 't' '{' Level7 LambdaOrExpr '}')> */ func() bool { - position319, tokenIndex319, depth319 := position, tokenIndex, depth + position323, tokenIndex323, depth323 := position, tokenIndex, depth { - position320 := position + position324 := position depth++ if buffer[position] != rune('s') { - goto l319 + goto l323 } position++ if buffer[position] != rune('e') { - goto l319 + goto l323 } position++ if buffer[position] != rune('l') { - goto l319 + goto l323 } position++ if buffer[position] != rune('e') { - goto l319 + goto l323 } position++ if buffer[position] != rune('c') { - goto l319 + goto l323 } position++ if buffer[position] != rune('t') { - goto l319 + goto l323 } position++ if buffer[position] != rune('{') { - goto l319 + goto l323 } position++ if !_rules[ruleLevel7]() { - goto l319 + goto l323 } if !_rules[ruleLambdaOrExpr]() { - goto l319 + goto l323 } if buffer[position] != rune('}') { - goto l319 + goto l323 } position++ depth-- - add(ruleMapSelection, position320) + add(ruleMapSelection, position324) } return true - l319: - position, tokenIndex, depth = position319, tokenIndex319, depth319 + l323: + position, tokenIndex, depth = position323, tokenIndex323, depth323 return false }, /* 80 Selection <- <('s' 'e' 'l' 'e' 'c' 't' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position321, tokenIndex321, depth321 := position, tokenIndex, depth + position325, tokenIndex325, depth325 := position, tokenIndex, depth { - position322 := position + position326 := position depth++ if buffer[position] != rune('s') { - goto l321 + goto l325 } position++ if buffer[position] != rune('e') { - goto l321 + goto l325 } position++ if buffer[position] != rune('l') { - goto l321 + goto l325 } position++ if buffer[position] != rune('e') { - goto l321 + goto l325 } position++ if buffer[position] != rune('c') { - goto l321 + goto l325 } position++ if buffer[position] != rune('t') { - goto l321 + goto l325 } position++ if buffer[position] != rune('[') { - goto l321 + goto l325 } position++ if !_rules[ruleLevel7]() { - goto l321 + goto l325 } if !_rules[ruleLambdaOrExpr]() { - goto l321 + goto l325 } if buffer[position] != rune(']') { - goto l321 + goto l325 } position++ depth-- - add(ruleSelection, position322) + add(ruleSelection, position326) } return true - l321: - position, tokenIndex, depth = position321, tokenIndex321, depth321 + l325: + position, tokenIndex, depth = position325, tokenIndex325, depth325 return false }, /* 81 Sum <- <('s' 'u' 'm' '[' Level7 '|' Level7 LambdaOrExpr ']')> */ func() bool { - position323, tokenIndex323, depth323 := position, tokenIndex, depth + position327, tokenIndex327, depth327 := position, tokenIndex, depth { - position324 := position + position328 := position depth++ if buffer[position] != rune('s') { - goto l323 + goto l327 } position++ if buffer[position] != rune('u') { - goto l323 + goto l327 } position++ if buffer[position] != rune('m') { - goto l323 + goto l327 } position++ if buffer[position] != rune('[') { - goto l323 + goto l327 } position++ if !_rules[ruleLevel7]() { - goto l323 + goto l327 } if buffer[position] != rune('|') { - goto l323 + goto l327 } position++ if !_rules[ruleLevel7]() { - goto l323 + goto l327 } if !_rules[ruleLambdaOrExpr]() { - goto l323 + goto l327 } if buffer[position] != rune(']') { - goto l323 + goto l327 } position++ depth-- - add(ruleSum, position324) + add(ruleSum, position328) } return true - l323: - position, tokenIndex, depth = position323, tokenIndex323, depth323 + l327: + position, tokenIndex, depth = position327, tokenIndex327, depth327 return false }, /* 82 Lambda <- <('l' 'a' 'm' 'b' 'd' 'a' (LambdaRef / LambdaExpr))> */ func() bool { - position325, tokenIndex325, depth325 := position, tokenIndex, depth + position329, tokenIndex329, depth329 := position, tokenIndex, depth { - position326 := position + position330 := position depth++ if buffer[position] != rune('l') { - goto l325 + goto l329 } position++ if buffer[position] != rune('a') { - goto l325 + goto l329 } position++ if buffer[position] != rune('m') { - goto l325 + goto l329 } position++ if buffer[position] != rune('b') { - goto l325 + goto l329 } position++ if buffer[position] != rune('d') { - goto l325 + goto l329 } position++ if buffer[position] != rune('a') { - goto l325 + goto l329 } position++ { - position327, tokenIndex327, depth327 := position, tokenIndex, depth + position331, tokenIndex331, depth331 := position, tokenIndex, depth if !_rules[ruleLambdaRef]() { - goto l328 + goto l332 } - goto l327 - l328: - position, tokenIndex, depth = position327, tokenIndex327, depth327 + goto l331 + l332: + position, tokenIndex, depth = position331, tokenIndex331, depth331 if !_rules[ruleLambdaExpr]() { - goto l325 + goto l329 } } - l327: + l331: depth-- - add(ruleLambda, position326) + add(ruleLambda, position330) } return true - l325: - position, tokenIndex, depth = position325, tokenIndex325, depth325 + l329: + position, tokenIndex, depth = position329, tokenIndex329, depth329 return false }, /* 83 LambdaRef <- <(req_ws Expression)> */ func() bool { - position329, tokenIndex329, depth329 := position, tokenIndex, depth + position333, tokenIndex333, depth333 := position, tokenIndex, depth { - position330 := position + position334 := position depth++ if !_rules[rulereq_ws]() { - goto l329 + goto l333 } if !_rules[ruleExpression]() { - goto l329 + goto l333 } depth-- - add(ruleLambdaRef, position330) + add(ruleLambdaRef, position334) } return true - l329: - position, tokenIndex, depth = position329, tokenIndex329, depth329 + l333: + position, tokenIndex, depth = position333, tokenIndex333, depth333 return false }, /* 84 LambdaExpr <- <(ws Params ws ('-' '>') Expression)> */ func() bool { - position331, tokenIndex331, depth331 := position, tokenIndex, depth + position335, tokenIndex335, depth335 := position, tokenIndex, depth { - position332 := position + position336 := position depth++ if !_rules[rulews]() { - goto l331 + goto l335 } if !_rules[ruleParams]() { - goto l331 + goto l335 } if !_rules[rulews]() { - goto l331 + goto l335 } if buffer[position] != rune('-') { - goto l331 + goto l335 } position++ if buffer[position] != rune('>') { - goto l331 + goto l335 } position++ if !_rules[ruleExpression]() { - goto l331 + goto l335 } depth-- - add(ruleLambdaExpr, position332) + add(ruleLambdaExpr, position336) } return true - l331: - position, tokenIndex, depth = position331, tokenIndex331, depth331 + l335: + position, tokenIndex, depth = position335, tokenIndex335, depth335 return false }, /* 85 Params <- <('|' StartParams ws Names? '|')> */ func() bool { - position333, tokenIndex333, depth333 := position, tokenIndex, depth + position337, tokenIndex337, depth337 := position, tokenIndex, depth { - position334 := position + position338 := position depth++ if buffer[position] != rune('|') { - goto l333 + goto l337 } position++ if !_rules[ruleStartParams]() { - goto l333 + goto l337 } if !_rules[rulews]() { - goto l333 + goto l337 } { - position335, tokenIndex335, depth335 := position, tokenIndex, depth + position339, tokenIndex339, depth339 := position, tokenIndex, depth if !_rules[ruleNames]() { - goto l335 + goto l339 } - goto l336 - l335: - position, tokenIndex, depth = position335, tokenIndex335, depth335 + goto l340 + l339: + position, tokenIndex, depth = position339, tokenIndex339, depth339 } - l336: + l340: if buffer[position] != rune('|') { - goto l333 + goto l337 } position++ depth-- - add(ruleParams, position334) + add(ruleParams, position338) } return true - l333: - position, tokenIndex, depth = position333, tokenIndex333, depth333 + l337: + position, tokenIndex, depth = position337, tokenIndex337, depth337 return false }, /* 86 StartParams <- */ func() bool { - position337, tokenIndex337, depth337 := position, tokenIndex, depth + position341, tokenIndex341, depth341 := position, tokenIndex, depth { - position338 := position + position342 := position depth++ if !_rules[ruleAction2]() { - goto l337 + goto l341 } depth-- - add(ruleStartParams, position338) + add(ruleStartParams, position342) } return true - l337: - position, tokenIndex, depth = position337, tokenIndex337, depth337 + l341: + position, tokenIndex, depth = position341, tokenIndex341, depth341 return false }, /* 87 Names <- <(NextName (',' NextName)* DefaultValue? (',' NextName DefaultValue)* VarParams?)> */ func() bool { - position339, tokenIndex339, depth339 := position, tokenIndex, depth + position343, tokenIndex343, depth343 := position, tokenIndex, depth { - position340 := position + position344 := position depth++ if !_rules[ruleNextName]() { - goto l339 + goto l343 } - l341: + l345: { - position342, tokenIndex342, depth342 := position, tokenIndex, depth + position346, tokenIndex346, depth346 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l342 + goto l346 } position++ if !_rules[ruleNextName]() { - goto l342 + goto l346 } - goto l341 - l342: - position, tokenIndex, depth = position342, tokenIndex342, depth342 + goto l345 + l346: + position, tokenIndex, depth = position346, tokenIndex346, depth346 } { - position343, tokenIndex343, depth343 := position, tokenIndex, depth + position347, tokenIndex347, depth347 := position, tokenIndex, depth if !_rules[ruleDefaultValue]() { - goto l343 + goto l347 } - goto l344 - l343: - position, tokenIndex, depth = position343, tokenIndex343, depth343 + goto l348 + l347: + position, tokenIndex, depth = position347, tokenIndex347, depth347 } - l344: - l345: + l348: + l349: { - position346, tokenIndex346, depth346 := position, tokenIndex, depth + position350, tokenIndex350, depth350 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l346 + goto l350 } position++ if !_rules[ruleNextName]() { - goto l346 + goto l350 } if !_rules[ruleDefaultValue]() { - goto l346 + goto l350 } - goto l345 - l346: - position, tokenIndex, depth = position346, tokenIndex346, depth346 + goto l349 + l350: + position, tokenIndex, depth = position350, tokenIndex350, depth350 } { - position347, tokenIndex347, depth347 := position, tokenIndex, depth + position351, tokenIndex351, depth351 := position, tokenIndex, depth if !_rules[ruleVarParams]() { - goto l347 + goto l351 } - goto l348 - l347: - position, tokenIndex, depth = position347, tokenIndex347, depth347 + goto l352 + l351: + position, tokenIndex, depth = position351, tokenIndex351, depth351 } - l348: + l352: depth-- - add(ruleNames, position340) + add(ruleNames, position344) } return true - l339: - position, tokenIndex, depth = position339, tokenIndex339, depth339 + l343: + position, tokenIndex, depth = position343, tokenIndex343, depth343 return false }, /* 88 NextName <- <(ws Name ws)> */ func() bool { - position349, tokenIndex349, depth349 := position, tokenIndex, depth + position353, tokenIndex353, depth353 := position, tokenIndex, depth { - position350 := position + position354 := position depth++ if !_rules[rulews]() { - goto l349 + goto l353 } if !_rules[ruleName]() { - goto l349 + goto l353 } if !_rules[rulews]() { - goto l349 + goto l353 } depth-- - add(ruleNextName, position350) + add(ruleNextName, position354) } return true - l349: - position, tokenIndex, depth = position349, tokenIndex349, depth349 + l353: + position, tokenIndex, depth = position353, tokenIndex353, depth353 return false }, /* 89 Name <- <([a-z] / [A-Z] / [0-9] / '_')+> */ func() bool { - position351, tokenIndex351, depth351 := position, tokenIndex, depth + position355, tokenIndex355, depth355 := position, tokenIndex, depth { - position352 := position + position356 := position depth++ { - position355, tokenIndex355, depth355 := position, tokenIndex, depth + position359, tokenIndex359, depth359 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l356 + goto l360 } position++ - goto l355 - l356: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l359 + l360: + position, tokenIndex, depth = position359, tokenIndex359, depth359 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l357 + goto l361 } position++ - goto l355 - l357: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l359 + l361: + position, tokenIndex, depth = position359, tokenIndex359, depth359 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l358 + goto l362 } position++ - goto l355 - l358: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l359 + l362: + position, tokenIndex, depth = position359, tokenIndex359, depth359 if buffer[position] != rune('_') { - goto l351 + goto l355 } position++ } - l355: - l353: + l359: + l357: { - position354, tokenIndex354, depth354 := position, tokenIndex, depth + position358, tokenIndex358, depth358 := position, tokenIndex, depth { - position359, tokenIndex359, depth359 := position, tokenIndex, depth + position363, tokenIndex363, depth363 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l360 + goto l364 } position++ - goto l359 - l360: - position, tokenIndex, depth = position359, tokenIndex359, depth359 + goto l363 + l364: + position, tokenIndex, depth = position363, tokenIndex363, depth363 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l361 + goto l365 } position++ - goto l359 - l361: - position, tokenIndex, depth = position359, tokenIndex359, depth359 + goto l363 + l365: + position, tokenIndex, depth = position363, tokenIndex363, depth363 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l362 + goto l366 } position++ - goto l359 - l362: - position, tokenIndex, depth = position359, tokenIndex359, depth359 + goto l363 + l366: + position, tokenIndex, depth = position363, tokenIndex363, depth363 if buffer[position] != rune('_') { - goto l354 + goto l358 } position++ } - l359: - goto l353 - l354: - position, tokenIndex, depth = position354, tokenIndex354, depth354 + l363: + goto l357 + l358: + position, tokenIndex, depth = position358, tokenIndex358, depth358 } depth-- - add(ruleName, position352) + add(ruleName, position356) } return true - l351: - position, tokenIndex, depth = position351, tokenIndex351, depth351 + l355: + position, tokenIndex, depth = position355, tokenIndex355, depth355 return false }, /* 90 DefaultValue <- <('=' Expression)> */ func() bool { - position363, tokenIndex363, depth363 := position, tokenIndex, depth + position367, tokenIndex367, depth367 := position, tokenIndex, depth { - position364 := position + position368 := position depth++ if buffer[position] != rune('=') { - goto l363 + goto l367 } position++ if !_rules[ruleExpression]() { - goto l363 + goto l367 } depth-- - add(ruleDefaultValue, position364) + add(ruleDefaultValue, position368) } return true - l363: - position, tokenIndex, depth = position363, tokenIndex363, depth363 + l367: + position, tokenIndex, depth = position367, tokenIndex367, depth367 return false }, /* 91 VarParams <- <('.' '.' '.' ws)> */ func() bool { - position365, tokenIndex365, depth365 := position, tokenIndex, depth + position369, tokenIndex369, depth369 := position, tokenIndex, depth { - position366 := position + position370 := position depth++ if buffer[position] != rune('.') { - goto l365 + goto l369 } position++ if buffer[position] != rune('.') { - goto l365 + goto l369 } position++ if buffer[position] != rune('.') { - goto l365 + goto l369 } position++ if !_rules[rulews]() { - goto l365 + goto l369 } depth-- - add(ruleVarParams, position366) + add(ruleVarParams, position370) } return true - l365: - position, tokenIndex, depth = position365, tokenIndex365, depth365 + l369: + position, tokenIndex, depth = position369, tokenIndex369, depth369 return false }, /* 92 Reference <- <(((Tag ('.' / Key)) / ('.'? Key)) FollowUpRef)> */ func() bool { - position367, tokenIndex367, depth367 := position, tokenIndex, depth + position371, tokenIndex371, depth371 := position, tokenIndex, depth { - position368 := position + position372 := position depth++ { - position369, tokenIndex369, depth369 := position, tokenIndex, depth + position373, tokenIndex373, depth373 := position, tokenIndex, depth if !_rules[ruleTag]() { - goto l370 + goto l374 } { - position371, tokenIndex371, depth371 := position, tokenIndex, depth + position375, tokenIndex375, depth375 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l372 + goto l376 } position++ - goto l371 - l372: - position, tokenIndex, depth = position371, tokenIndex371, depth371 + goto l375 + l376: + position, tokenIndex, depth = position375, tokenIndex375, depth375 if !_rules[ruleKey]() { - goto l370 + goto l374 } } - l371: - goto l369 - l370: - position, tokenIndex, depth = position369, tokenIndex369, depth369 + l375: + goto l373 + l374: + position, tokenIndex, depth = position373, tokenIndex373, depth373 { - position373, tokenIndex373, depth373 := position, tokenIndex, depth + position377, tokenIndex377, depth377 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l373 + goto l377 } position++ - goto l374 - l373: - position, tokenIndex, depth = position373, tokenIndex373, depth373 + goto l378 + l377: + position, tokenIndex, depth = position377, tokenIndex377, depth377 } - l374: + l378: if !_rules[ruleKey]() { - goto l367 + goto l371 } } - l369: + l373: if !_rules[ruleFollowUpRef]() { - goto l367 + goto l371 } depth-- - add(ruleReference, position368) + add(ruleReference, position372) } return true - l367: - position, tokenIndex, depth = position367, tokenIndex367, depth367 + l371: + position, tokenIndex, depth = position371, tokenIndex371, depth371 return false }, - /* 93 Tag <- <((TagName / ('-'? [0-9]+)) (':' ':'))> */ + /* 93 Tag <- <((('d' 'o' 'c' ':' '-'? [0-9]+) / (TagName (':' TagName)*)) (':' ':'))> */ func() bool { - position375, tokenIndex375, depth375 := position, tokenIndex, depth + position379, tokenIndex379, depth379 := position, tokenIndex, depth { - position376 := position + position380 := position depth++ { - position377, tokenIndex377, depth377 := position, tokenIndex, depth - if !_rules[ruleTagName]() { - goto l378 + position381, tokenIndex381, depth381 := position, tokenIndex, depth + if buffer[position] != rune('d') { + goto l382 } - goto l377 - l378: - position, tokenIndex, depth = position377, tokenIndex377, depth377 + position++ + if buffer[position] != rune('o') { + goto l382 + } + position++ + if buffer[position] != rune('c') { + goto l382 + } + position++ + if buffer[position] != rune(':') { + goto l382 + } + position++ { - position379, tokenIndex379, depth379 := position, tokenIndex, depth + position383, tokenIndex383, depth383 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l379 + goto l383 } position++ - goto l380 - l379: - position, tokenIndex, depth = position379, tokenIndex379, depth379 + goto l384 + l383: + position, tokenIndex, depth = position383, tokenIndex383, depth383 } - l380: + l384: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l375 + goto l382 } position++ - l381: + l385: { - position382, tokenIndex382, depth382 := position, tokenIndex, depth + position386, tokenIndex386, depth386 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l382 + goto l386 } position++ - goto l381 - l382: - position, tokenIndex, depth = position382, tokenIndex382, depth382 + goto l385 + l386: + position, tokenIndex, depth = position386, tokenIndex386, depth386 + } + goto l381 + l382: + position, tokenIndex, depth = position381, tokenIndex381, depth381 + if !_rules[ruleTagName]() { + goto l379 + } + l387: + { + position388, tokenIndex388, depth388 := position, tokenIndex, depth + if buffer[position] != rune(':') { + goto l388 + } + position++ + if !_rules[ruleTagName]() { + goto l388 + } + goto l387 + l388: + position, tokenIndex, depth = position388, tokenIndex388, depth388 } } - l377: + l381: if buffer[position] != rune(':') { - goto l375 + goto l379 } position++ if buffer[position] != rune(':') { - goto l375 + goto l379 } position++ depth-- - add(ruleTag, position376) + add(ruleTag, position380) } return true - l375: - position, tokenIndex, depth = position375, tokenIndex375, depth375 + l379: + position, tokenIndex, depth = position379, tokenIndex379, depth379 return false }, /* 94 TagName <- <(([a-z] / [A-Z] / '_') ([a-z] / [A-Z] / [0-9] / '_')*)> */ func() bool { - position383, tokenIndex383, depth383 := position, tokenIndex, depth + position389, tokenIndex389, depth389 := position, tokenIndex, depth { - position384 := position + position390 := position depth++ { - position385, tokenIndex385, depth385 := position, tokenIndex, depth + position391, tokenIndex391, depth391 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l386 + goto l392 } position++ - goto l385 - l386: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l391 + l392: + position, tokenIndex, depth = position391, tokenIndex391, depth391 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l387 + goto l393 } position++ - goto l385 - l387: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l391 + l393: + position, tokenIndex, depth = position391, tokenIndex391, depth391 if buffer[position] != rune('_') { - goto l383 + goto l389 } position++ } - l385: - l388: + l391: + l394: { - position389, tokenIndex389, depth389 := position, tokenIndex, depth + position395, tokenIndex395, depth395 := position, tokenIndex, depth { - position390, tokenIndex390, depth390 := position, tokenIndex, depth + position396, tokenIndex396, depth396 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l391 + goto l397 } position++ - goto l390 - l391: - position, tokenIndex, depth = position390, tokenIndex390, depth390 + goto l396 + l397: + position, tokenIndex, depth = position396, tokenIndex396, depth396 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l392 + goto l398 } position++ - goto l390 - l392: - position, tokenIndex, depth = position390, tokenIndex390, depth390 + goto l396 + l398: + position, tokenIndex, depth = position396, tokenIndex396, depth396 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l393 + goto l399 } position++ - goto l390 - l393: - position, tokenIndex, depth = position390, tokenIndex390, depth390 + goto l396 + l399: + position, tokenIndex, depth = position396, tokenIndex396, depth396 if buffer[position] != rune('_') { - goto l389 + goto l395 } position++ } - l390: - goto l388 - l389: - position, tokenIndex, depth = position389, tokenIndex389, depth389 + l396: + goto l394 + l395: + position, tokenIndex, depth = position395, tokenIndex395, depth395 } depth-- - add(ruleTagName, position384) + add(ruleTagName, position390) } return true - l383: - position, tokenIndex, depth = position383, tokenIndex383, depth383 + l389: + position, tokenIndex, depth = position389, tokenIndex389, depth389 return false }, /* 95 FollowUpRef <- */ func() bool { { - position395 := position + position401 := position depth++ - l396: + l402: { - position397, tokenIndex397, depth397 := position, tokenIndex, depth + position403, tokenIndex403, depth403 := position, tokenIndex, depth if !_rules[rulePathComponent]() { - goto l397 + goto l403 } - goto l396 - l397: - position, tokenIndex, depth = position397, tokenIndex397, depth397 + goto l402 + l403: + position, tokenIndex, depth = position403, tokenIndex403, depth403 } depth-- - add(ruleFollowUpRef, position395) + add(ruleFollowUpRef, position401) } return true }, /* 96 PathComponent <- <(('.' Key) / ('.'? Index))> */ func() bool { - position398, tokenIndex398, depth398 := position, tokenIndex, depth + position404, tokenIndex404, depth404 := position, tokenIndex, depth { - position399 := position + position405 := position depth++ { - position400, tokenIndex400, depth400 := position, tokenIndex, depth + position406, tokenIndex406, depth406 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l401 + goto l407 } position++ if !_rules[ruleKey]() { - goto l401 + goto l407 } - goto l400 - l401: - position, tokenIndex, depth = position400, tokenIndex400, depth400 + goto l406 + l407: + position, tokenIndex, depth = position406, tokenIndex406, depth406 { - position402, tokenIndex402, depth402 := position, tokenIndex, depth + position408, tokenIndex408, depth408 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l402 + goto l408 } position++ - goto l403 - l402: - position, tokenIndex, depth = position402, tokenIndex402, depth402 + goto l409 + l408: + position, tokenIndex, depth = position408, tokenIndex408, depth408 } - l403: + l409: if !_rules[ruleIndex]() { - goto l398 + goto l404 } } - l400: + l406: depth-- - add(rulePathComponent, position399) + add(rulePathComponent, position405) } return true - l398: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + l404: + position, tokenIndex, depth = position404, tokenIndex404, depth404 return false }, /* 97 Key <- <(([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')* (':' ([a-z] / [A-Z] / [0-9] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')*)?)> */ func() bool { - position404, tokenIndex404, depth404 := position, tokenIndex, depth + position410, tokenIndex410, depth410 := position, tokenIndex, depth { - position405 := position + position411 := position depth++ { - position406, tokenIndex406, depth406 := position, tokenIndex, depth + position412, tokenIndex412, depth412 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l407 + goto l413 } position++ - goto l406 - l407: - position, tokenIndex, depth = position406, tokenIndex406, depth406 + goto l412 + l413: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l408 + goto l414 } position++ - goto l406 - l408: - position, tokenIndex, depth = position406, tokenIndex406, depth406 + goto l412 + l414: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l415 } position++ - goto l406 - l409: - position, tokenIndex, depth = position406, tokenIndex406, depth406 + goto l412 + l415: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if buffer[position] != rune('_') { - goto l404 + goto l410 } position++ } - l406: - l410: + l412: + l416: { - position411, tokenIndex411, depth411 := position, tokenIndex, depth + position417, tokenIndex417, depth417 := position, tokenIndex, depth { - position412, tokenIndex412, depth412 := position, tokenIndex, depth + position418, tokenIndex418, depth418 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l413 + goto l419 } position++ - goto l412 - l413: - position, tokenIndex, depth = position412, tokenIndex412, depth412 + goto l418 + l419: + position, tokenIndex, depth = position418, tokenIndex418, depth418 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l414 + goto l420 } position++ - goto l412 - l414: - position, tokenIndex, depth = position412, tokenIndex412, depth412 + goto l418 + l420: + position, tokenIndex, depth = position418, tokenIndex418, depth418 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l415 + goto l421 } position++ - goto l412 - l415: - position, tokenIndex, depth = position412, tokenIndex412, depth412 + goto l418 + l421: + position, tokenIndex, depth = position418, tokenIndex418, depth418 if buffer[position] != rune('_') { - goto l416 + goto l422 } position++ - goto l412 - l416: - position, tokenIndex, depth = position412, tokenIndex412, depth412 + goto l418 + l422: + position, tokenIndex, depth = position418, tokenIndex418, depth418 if buffer[position] != rune('-') { - goto l411 + goto l417 } position++ } - l412: - goto l410 - l411: - position, tokenIndex, depth = position411, tokenIndex411, depth411 + l418: + goto l416 + l417: + position, tokenIndex, depth = position417, tokenIndex417, depth417 } { - position417, tokenIndex417, depth417 := position, tokenIndex, depth + position423, tokenIndex423, depth423 := position, tokenIndex, depth if buffer[position] != rune(':') { - goto l417 + goto l423 } position++ { - position419, tokenIndex419, depth419 := position, tokenIndex, depth + position425, tokenIndex425, depth425 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l420 + goto l426 } position++ - goto l419 - l420: - position, tokenIndex, depth = position419, tokenIndex419, depth419 + goto l425 + l426: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l421 + goto l427 } position++ - goto l419 - l421: - position, tokenIndex, depth = position419, tokenIndex419, depth419 + goto l425 + l427: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l422 + goto l428 } position++ - goto l419 - l422: - position, tokenIndex, depth = position419, tokenIndex419, depth419 + goto l425 + l428: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if buffer[position] != rune('_') { - goto l417 + goto l423 } position++ } - l419: - l423: + l425: + l429: { - position424, tokenIndex424, depth424 := position, tokenIndex, depth + position430, tokenIndex430, depth430 := position, tokenIndex, depth { - position425, tokenIndex425, depth425 := position, tokenIndex, depth + position431, tokenIndex431, depth431 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l426 + goto l432 } position++ - goto l425 - l426: - position, tokenIndex, depth = position425, tokenIndex425, depth425 + goto l431 + l432: + position, tokenIndex, depth = position431, tokenIndex431, depth431 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l427 + goto l433 } position++ - goto l425 - l427: - position, tokenIndex, depth = position425, tokenIndex425, depth425 + goto l431 + l433: + position, tokenIndex, depth = position431, tokenIndex431, depth431 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l428 + goto l434 } position++ - goto l425 - l428: - position, tokenIndex, depth = position425, tokenIndex425, depth425 + goto l431 + l434: + position, tokenIndex, depth = position431, tokenIndex431, depth431 if buffer[position] != rune('_') { - goto l429 + goto l435 } position++ - goto l425 - l429: - position, tokenIndex, depth = position425, tokenIndex425, depth425 + goto l431 + l435: + position, tokenIndex, depth = position431, tokenIndex431, depth431 if buffer[position] != rune('-') { - goto l424 + goto l430 } position++ } - l425: - goto l423 - l424: - position, tokenIndex, depth = position424, tokenIndex424, depth424 + l431: + goto l429 + l430: + position, tokenIndex, depth = position430, tokenIndex430, depth430 } - goto l418 - l417: - position, tokenIndex, depth = position417, tokenIndex417, depth417 + goto l424 + l423: + position, tokenIndex, depth = position423, tokenIndex423, depth423 } - l418: + l424: depth-- - add(ruleKey, position405) + add(ruleKey, position411) } return true - l404: - position, tokenIndex, depth = position404, tokenIndex404, depth404 + l410: + position, tokenIndex, depth = position410, tokenIndex410, depth410 return false }, /* 98 Index <- <('[' '-'? [0-9]+ ']')> */ func() bool { - position430, tokenIndex430, depth430 := position, tokenIndex, depth + position436, tokenIndex436, depth436 := position, tokenIndex, depth { - position431 := position + position437 := position depth++ if buffer[position] != rune('[') { - goto l430 + goto l436 } position++ { - position432, tokenIndex432, depth432 := position, tokenIndex, depth + position438, tokenIndex438, depth438 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l432 + goto l438 } position++ - goto l433 - l432: - position, tokenIndex, depth = position432, tokenIndex432, depth432 + goto l439 + l438: + position, tokenIndex, depth = position438, tokenIndex438, depth438 } - l433: + l439: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l430 + goto l436 } position++ - l434: + l440: { - position435, tokenIndex435, depth435 := position, tokenIndex, depth + position441, tokenIndex441, depth441 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l435 + goto l441 } position++ - goto l434 - l435: - position, tokenIndex, depth = position435, tokenIndex435, depth435 + goto l440 + l441: + position, tokenIndex, depth = position441, tokenIndex441, depth441 } if buffer[position] != rune(']') { - goto l430 + goto l436 } position++ depth-- - add(ruleIndex, position431) + add(ruleIndex, position437) } return true - l430: - position, tokenIndex, depth = position430, tokenIndex430, depth430 + l436: + position, tokenIndex, depth = position436, tokenIndex436, depth436 return false }, /* 99 IP <- <([0-9]+ '.' [0-9]+ '.' [0-9]+ '.' [0-9]+)> */ func() bool { - position436, tokenIndex436, depth436 := position, tokenIndex, depth + position442, tokenIndex442, depth442 := position, tokenIndex, depth { - position437 := position + position443 := position depth++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l436 + goto l442 } position++ - l438: + l444: { - position439, tokenIndex439, depth439 := position, tokenIndex, depth + position445, tokenIndex445, depth445 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l439 + goto l445 } position++ - goto l438 - l439: - position, tokenIndex, depth = position439, tokenIndex439, depth439 + goto l444 + l445: + position, tokenIndex, depth = position445, tokenIndex445, depth445 } if buffer[position] != rune('.') { - goto l436 + goto l442 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l436 + goto l442 } position++ - l440: + l446: { - position441, tokenIndex441, depth441 := position, tokenIndex, depth + position447, tokenIndex447, depth447 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l441 + goto l447 } position++ - goto l440 - l441: - position, tokenIndex, depth = position441, tokenIndex441, depth441 + goto l446 + l447: + position, tokenIndex, depth = position447, tokenIndex447, depth447 } if buffer[position] != rune('.') { - goto l436 + goto l442 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l436 + goto l442 } position++ - l442: + l448: { - position443, tokenIndex443, depth443 := position, tokenIndex, depth + position449, tokenIndex449, depth449 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l443 + goto l449 } position++ - goto l442 - l443: - position, tokenIndex, depth = position443, tokenIndex443, depth443 + goto l448 + l449: + position, tokenIndex, depth = position449, tokenIndex449, depth449 } if buffer[position] != rune('.') { - goto l436 + goto l442 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l436 + goto l442 } position++ - l444: + l450: { - position445, tokenIndex445, depth445 := position, tokenIndex, depth + position451, tokenIndex451, depth451 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l445 + goto l451 } position++ - goto l444 - l445: - position, tokenIndex, depth = position445, tokenIndex445, depth445 + goto l450 + l451: + position, tokenIndex, depth = position451, tokenIndex451, depth451 } depth-- - add(ruleIP, position437) + add(ruleIP, position443) } return true - l436: - position, tokenIndex, depth = position436, tokenIndex436, depth436 + l442: + position, tokenIndex, depth = position442, tokenIndex442, depth442 return false }, /* 100 ws <- <(' ' / '\t' / '\n' / '\r')*> */ func() bool { { - position447 := position + position453 := position depth++ - l448: + l454: { - position449, tokenIndex449, depth449 := position, tokenIndex, depth + position455, tokenIndex455, depth455 := position, tokenIndex, depth { - position450, tokenIndex450, depth450 := position, tokenIndex, depth + position456, tokenIndex456, depth456 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l451 + goto l457 } position++ - goto l450 - l451: - position, tokenIndex, depth = position450, tokenIndex450, depth450 + goto l456 + l457: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\t') { - goto l452 + goto l458 } position++ - goto l450 - l452: - position, tokenIndex, depth = position450, tokenIndex450, depth450 + goto l456 + l458: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\n') { - goto l453 + goto l459 } position++ - goto l450 - l453: - position, tokenIndex, depth = position450, tokenIndex450, depth450 + goto l456 + l459: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\r') { - goto l449 + goto l455 } position++ } - l450: - goto l448 - l449: - position, tokenIndex, depth = position449, tokenIndex449, depth449 + l456: + goto l454 + l455: + position, tokenIndex, depth = position455, tokenIndex455, depth455 } depth-- - add(rulews, position447) + add(rulews, position453) } return true }, /* 101 req_ws <- <(' ' / '\t' / '\n' / '\r')+> */ func() bool { - position454, tokenIndex454, depth454 := position, tokenIndex, depth + position460, tokenIndex460, depth460 := position, tokenIndex, depth { - position455 := position + position461 := position depth++ { - position458, tokenIndex458, depth458 := position, tokenIndex, depth + position464, tokenIndex464, depth464 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l459 + goto l465 } position++ - goto l458 - l459: - position, tokenIndex, depth = position458, tokenIndex458, depth458 + goto l464 + l465: + position, tokenIndex, depth = position464, tokenIndex464, depth464 if buffer[position] != rune('\t') { - goto l460 + goto l466 } position++ - goto l458 - l460: - position, tokenIndex, depth = position458, tokenIndex458, depth458 + goto l464 + l466: + position, tokenIndex, depth = position464, tokenIndex464, depth464 if buffer[position] != rune('\n') { - goto l461 + goto l467 } position++ - goto l458 - l461: - position, tokenIndex, depth = position458, tokenIndex458, depth458 + goto l464 + l467: + position, tokenIndex, depth = position464, tokenIndex464, depth464 if buffer[position] != rune('\r') { - goto l454 + goto l460 } position++ } - l458: - l456: + l464: + l462: { - position457, tokenIndex457, depth457 := position, tokenIndex, depth + position463, tokenIndex463, depth463 := position, tokenIndex, depth { - position462, tokenIndex462, depth462 := position, tokenIndex, depth + position468, tokenIndex468, depth468 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l463 + goto l469 } position++ - goto l462 - l463: - position, tokenIndex, depth = position462, tokenIndex462, depth462 + goto l468 + l469: + position, tokenIndex, depth = position468, tokenIndex468, depth468 if buffer[position] != rune('\t') { - goto l464 + goto l470 } position++ - goto l462 - l464: - position, tokenIndex, depth = position462, tokenIndex462, depth462 + goto l468 + l470: + position, tokenIndex, depth = position468, tokenIndex468, depth468 if buffer[position] != rune('\n') { - goto l465 + goto l471 } position++ - goto l462 - l465: - position, tokenIndex, depth = position462, tokenIndex462, depth462 + goto l468 + l471: + position, tokenIndex, depth = position468, tokenIndex468, depth468 if buffer[position] != rune('\r') { - goto l457 + goto l463 } position++ } - l462: - goto l456 - l457: - position, tokenIndex, depth = position457, tokenIndex457, depth457 + l468: + goto l462 + l463: + position, tokenIndex, depth = position463, tokenIndex463, depth463 } depth-- - add(rulereq_ws, position455) + add(rulereq_ws, position461) } return true - l454: - position, tokenIndex, depth = position454, tokenIndex454, depth454 + l460: + position, tokenIndex, depth = position460, tokenIndex460, depth460 return false }, /* 103 Action0 <- <{}> */ diff --git a/dynaml/expression.go b/dynaml/expression.go index 1ceec76..9d73214 100644 --- a/dynaml/expression.go +++ b/dynaml/expression.go @@ -1,6 +1,8 @@ package dynaml import ( + "fmt" + "github.com/mandelsoft/vfs/pkg/vfs" "github.com/mandelsoft/spiff/yaml" @@ -16,9 +18,39 @@ type SourceProvider interface { SourceName() string } -const TAG_GLOBAL = TagScope(1) -const TAG_STREAM = TagScope(2) -const TAG_LOCAL = TagScope(3) +func CheckTagName(name string) error { + l := 0 + for _, c := range name { + switch c { + case ':': + if l == 0 { + return fmt.Errorf("empty tag component not allowed") + } + l = 0 + default: + l++ + if c >= '0' && c <= '9' { + if l == 1 { + return fmt.Errorf("tag component must start with alnum rune") + } + continue + } + if c >= 'a' && c <= 'z' { + continue + } + if c >= 'A' && c <= 'Z' { + continue + } + return fmt.Errorf("invalid character %q in tag component", string(c)) + } + } + return nil +} + +const TAG_LOCAL = TagScope(0x01) +const TAG_SCOPE = TagScope(0x06) +const TAG_SCOPE_GLOBAL = TagScope(0x00) +const TAG_SCOPE_STREAM = TagScope(0x02) type TagScope int @@ -29,11 +61,7 @@ type Tag struct { scope TagScope } -func NewTag(name string, node yaml.Node, path []string, global bool) *Tag { - scope := TAG_LOCAL - if global { - scope = TAG_GLOBAL - } +func NewTag(name string, node yaml.Node, path []string, scope TagScope) *Tag { return &Tag{name, node, path, scope} } @@ -53,9 +81,21 @@ func (t *Tag) Scope() TagScope { return t.scope } +func (t *Tag) IsLocal() bool { + return t.scope&TAG_LOCAL != 0 +} + +func (t *Tag) IsStream() bool { + return t.scope&TAG_SCOPE == TAG_SCOPE_STREAM +} + +func (t *Tag) IsGlobal() bool { + return t.scope&TAG_SCOPE == TAG_SCOPE_GLOBAL +} + func (t *Tag) ResetLocal() { - if t.scope == TAG_LOCAL { - t.scope = TAG_STREAM + if t.IsLocal() { + t.scope &= ^TAG_LOCAL } } @@ -68,7 +108,7 @@ type State interface { FileSystem() vfs.VFS GetFunctions() Registry InterpolationEnabled() bool - SetTag(name string, node yaml.Node, path []string) error + SetTag(name string, node yaml.Node, path []string, scope TagScope) error GetTag(name string) *Tag EnableInterpolation() diff --git a/dynaml/parser.go b/dynaml/parser.go index e2eefcf..5bf2c02 100644 --- a/dynaml/parser.go +++ b/dynaml/parser.go @@ -202,7 +202,7 @@ func buildExpression(grammar *DynamlGrammar, path []string, stubPath []string) ( case ruleFollowUpRef: case ruleReference: tag := "" - if i := strings.Index(contents, "::"); i > 0 { + if i := strings.LastIndex(contents, "::"); i > 0 { tag = contents[:i] contents = contents[i+2:] if contents != "." && strings.HasPrefix(contents, ".") { diff --git a/dynaml/reference.go b/dynaml/reference.go index eaae1ee..9f9ac5a 100644 --- a/dynaml/reference.go +++ b/dynaml/reference.go @@ -27,7 +27,7 @@ func (e ReferenceExpr) Evaluate(binding Binding, locally bool) (interface{}, Eva debug.Debug("reference: (%s)%v\n", e.Tag, e.Path) if e.Tag != "" { info := DefaultInfo() - if e.Tag != "0" { + if e.Tag != "doc:0" { tag = binding.GetState().GetTag(e.Tag) if tag == nil { return info.Error("tag '%s' not found", e.Tag) diff --git a/dynaml/tagdef.go b/dynaml/tagdef.go new file mode 100644 index 0000000..2640bc6 --- /dev/null +++ b/dynaml/tagdef.go @@ -0,0 +1,57 @@ +package dynaml + +import ( + "fmt" + "strings" + + "github.com/mandelsoft/spiff/yaml" +) + +const F_TagDef = "tagdef" + +func init() { + RegisterFunction(F_TagDef, func_tagdef) +} + +func func_tagdef(arguments []interface{}, binding Binding) (interface{}, EvaluationInfo, bool) { + info := DefaultInfo() + ttype := "local" + + if len(arguments) < 2 || len(arguments) > 3 { + return info.Error("two or three arguments expected for %s", F_TagDef) + } + name, ok := arguments[0].(string) + if !ok { + return info.Error("name argument for %s must be a string", F_TagDef) + } + if strings.HasPrefix(name, "*") && len(arguments) == 2 { + name = name[1:] + ttype = "global" + } + if err := CheckTagName(name); err != nil { + return info.Error("invalid tag name %q for %s: %s", name, F_TagDef, err) + } + value := yaml.NewNode(arguments[1], fmt.Sprintf("tagdef(%s)", binding.Path())) + if len(arguments) == 3 { + str, ok := arguments[2].(string) + if !ok { + return info.Error("type argument for %s must be a string (local or global)", F_TagDef) + } + ttype = str + } + var scope TagScope + switch ttype { + case "local": + scope = TAG_SCOPE_STREAM + case "global": + scope = TAG_SCOPE_GLOBAL + default: + return info.Error("invalid scope argument %q for %s (must be local or global)", ttype, F_TagDef) + } + scope |= TAG_LOCAL + err := binding.GetState().SetTag(name, value, binding.Path(), scope) + if err != nil { + return info.Error("%s", err) + } + return arguments[1], info, true +} diff --git a/dynaml/wireguard/genkey.go b/dynaml/wireguard/genkey.go index 2356f54..371ffb8 100644 --- a/dynaml/wireguard/genkey.go +++ b/dynaml/wireguard/genkey.go @@ -32,7 +32,7 @@ func func_genkey(arguments []interface{}, binding Binding) (interface{}, Evaluat case "preshared": key, err = GenerateKey() default: - return info.Error("ainvalid key type %q, use private or preshared", ktype) + return info.Error("invalid key type %q, use private or preshared", ktype) } if err != nil { return info.Error("error generating key: %s", err) diff --git a/flow/flow.go b/flow/flow.go index 84d0710..2463751 100644 --- a/flow/flow.go +++ b/flow/flow.go @@ -39,7 +39,14 @@ func flow(root yaml.Node, env dynaml.Binding, shouldOverride bool) yaml.Node { debug.Debug("found tag %q at %v\n", tag, env.Path()) } if dynaml.IsResolvedNode(node) && tag != "" { - err := env.GetState().SetTag(tag, node, env.Path()) + scope := dynaml.TAG_LOCAL + if strings.HasPrefix(tag, "*") { + tag = tag[1:] + scope |= dynaml.TAG_SCOPE_GLOBAL + } else { + scope |= dynaml.TAG_SCOPE_STREAM + } + err := env.GetState().SetTag(tag, node, env.Path(), scope) if err != nil { if node.Value() == nil { node = yaml.ReplaceValue(root.Value(), node) diff --git a/flow/flow_tag_test.go b/flow/flow_tag_test.go index 58e2f68..18702e6 100644 --- a/flow/flow_tag_test.go +++ b/flow/flow_tag_test.go @@ -6,6 +6,73 @@ import ( ) var _ = Describe("Tags", func() { + Context("dynamic", func() { + It("handles two arg form", func() { + source := parseYAML(` +--- +data: (( tagdef("tag:alice", 25) )) +alice: (( tag:alice::. )) +`) + resolved := parseYAML(` +--- +data: 25 +alice: 25 +`) + Expect(source).To(FlowAs(resolved)) + }) + It("handles two arg global form", func() { + source := parseYAML(` +--- +data: (( tagdef("*tag:alice", 25) )) +alice: (( tag:alice::. )) +`) + resolved := parseYAML(` +--- +data: 25 +alice: 25 +`) + Expect(source).To(FlowAs(resolved)) + }) + It("handles local three arg form", func() { + source := parseYAML(` +--- +data: (( tagdef("tag:alice", 25, "local") )) +alice: (( tag:alice::. )) +`) + resolved := parseYAML(` +--- +data: 25 +alice: 25 +`) + Expect(source).To(FlowAs(resolved)) + }) + It("handles global three arg form", func() { + source := parseYAML(` +--- +data: (( tagdef("tag:alice", 25, "global") )) +alice: (( tag:alice::. )) +`) + resolved := parseYAML(` +--- +data: 25 +alice: 25 +`) + Expect(source).To(FlowAs(resolved)) + }) + It("fails stared three arg form", func() { + source := parseYAML(` +--- +data: (( catch(tagdef("*tag:alice", 25, "global")) )) +`) + resolved := parseYAML(` +--- +data: + error: "invalid tag name \"*tag:alice\" for tagdef: invalid character \"*\" in tag component" + valid: false +`) + Expect(source).To(FlowAs(resolved)) + }) + }) Context("Regular", func() { It("handles tag field", func() { diff --git a/flow/state.go b/flow/state.go index aa44304..4a92d9d 100644 --- a/flow/state.go +++ b/flow/state.go @@ -127,30 +127,33 @@ func (s *State) GetTempName(data []byte) (string, error) { return name, nil } -func (s *State) SetTag(name string, node yaml.Node, path []string) error { +func (s *State) SetTag(name string, node yaml.Node, path []string, scope dynaml.TagScope) error { debug.Debug("setting tag: %v\n", path) old := s.tags[name] if old != nil { - if old.Scope() != dynaml.TAG_LOCAL { + if !old.IsLocal() { return fmt.Errorf("duplicate tag %q: %s in foreign document", name, strings.Join(path, ".")) } if !reflect.DeepEqual(path, old.Path()) { return fmt.Errorf("duplicate tag %q: %s <-> %s", name, strings.Join(path, "."), strings.Join(old.Path(), ".")) } } - s.tags[name] = dynaml.NewTag(name, Cleanup(node, discardTags), path, false) + s.tags[name] = dynaml.NewTag(name, Cleanup(node, discardTags), path, scope) return nil } func (s *State) GetTag(name string) *dynaml.Tag { - i, err := strconv.Atoi(name) - if err == nil { + if strings.HasPrefix(name, "doc:") { + i, err := strconv.Atoi(name[4:]) + if err != nil { + return nil + } if i <= 0 { i += s.docno if i <= 0 { return nil } - name = fmt.Sprintf("%d", i) + name = fmt.Sprintf("doc:%d", i) } } return s.tags[name] @@ -164,7 +167,7 @@ func (s *State) ResetTags() { func (s *State) ResetStream() { n := map[string]*dynaml.Tag{} for _, v := range s.tags { - if v.Scope() == dynaml.TAG_GLOBAL { + if !v.IsStream() { n[v.Name()] = v } } @@ -173,12 +176,12 @@ func (s *State) ResetStream() { } func (s *State) PushDocument(node yaml.Node) { + if node != nil { + s.SetTag(fmt.Sprintf("doc:%d", s.docno), node, nil, dynaml.TAG_SCOPE_GLOBAL) + } for _, t := range s.tags { t.ResetLocal() } - if node != nil { - s.SetTag(fmt.Sprintf("%d", s.docno), node, nil) - } s.docno++ } diff --git a/spiffing/spiff.go b/spiffing/spiff.go index 3519787..639e3fb 100644 --- a/spiffing/spiff.go +++ b/spiffing/spiff.go @@ -207,14 +207,18 @@ func (s *spiff) CleanupTags() Spiff { // Cascade processes a template with a list of given subs and state // documents func (s *spiff) Cascade(template Node, stubs []Node, states ...Node) (Node, error) { + s.Reset() s.assureBinding() - defer s.ResetStream() + defer s.Reset() return flow.Cascade(s.binding, template, s.opts, append(stubs, states...)...) } // PrepareStubs processes a list a stubs and returns a prepared -// represenation usable to process a template +// representation usable to process a template +// Global tags provided by the stubs are kept until the next +// Prepare or Cascade processing. func (s *spiff) PrepareStubs(stubs ...Node) ([]Node, error) { + s.Reset() s.assureBinding() return flow.PrepareStubs(s.binding, s.opts.Partial, stubs...) } From 96863abd8c86382afdf32d4a9ac33b857c12c18d Mon Sep 17 00:00:00 2001 From: Uwe Krueger Date: Sat, 29 May 2021 00:14:45 +0200 Subject: [PATCH 5/5] resolve path long nested qualified tags --- README.md | 54 ++++++++++++++ cmd/merge.go | 11 ++- dynaml/call.go | 5 +- dynaml/expression.go | 84 +--------------------- dynaml/parser_test.go | 12 ++++ dynaml/reference.go | 74 +++++++++++++++----- dynaml/tag.go | 159 ++++++++++++++++++++++++++++++++++++++++++ flow/flow_tag_test.go | 62 ++++++++++++++++ flow/state.go | 57 ++++++++++++--- spiffing/spiff.go | 2 +- 10 files changed, 406 insertions(+), 114 deletions(-) create mode 100644 dynaml/tag.go diff --git a/README.md b/README.md index f93ec9d..35ba24c 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,7 @@ Contents: - [(( &tag:name(value) ))](#-tagnamevalue-) - [(( name::path ))](#-namepath-) - [(( name::. ))](#-name-) + - [Path Resolution for Tags](#path-resolution-for-tags) - [Tags in Multi-Document Streams](#tags-in-multi-document-streams) - [Templates](#templates) - [<<: (( &template ))](#--template-) @@ -4822,6 +4823,59 @@ tagref: (( alice::. )) resolves `tagref` to `25` +### Path Resolution for Tags + +A tag reference always contains a tag name and a path separated by a double +colon (`::`). +The standard usecase is to describe a dedicated sub node for a tagged +node value. + +for example, if the tag `X` describes the value + +```yaml +data: + alice: 25 + bob: 24 +``` + +the tagged reference `tag::data.alice` describes the value `25`. + +For tagged reference with a path other the `.` (the whole tag value), +structured tags feature a more sophisticated resolution mechanism. A structured +tag consist of multiple tag components separated by a colon (`:`), for +example `lib:mylib`. +Evaluation of a path reference for a tag tries to resolve the path in the +first unique nested tag, if it cannot be resolved directly by the given tag. + +For example: + +```yaml +tags: + - <<: (( &tag:lib:alice )) + data: alice.alice + - <<: (( &tag:lib:alice:v1)) + data: alice.v1 + - <<: (( &tag:lib:bob)) + other: bob +usage: + data: (( lib::data )) +``` + +effectively resolves `usage.data` to `lib:alice::data` and therefore to the value +`alice.alice`. + +To achieve this all matching sub tags are orderd by their number of +tag components. The first sub-level tag containing such a +given path is selected. For this level, the matching tag must be non-ambigious. +There must only be one tag with this level containing a matching path. +If there are multiple ones the evaluation fails. In the above example this would +be the case if tag `lib:bob` would contain a field `data` instead of or +additional to `other`. + +This feature can be used in library stubs to provide qualified names for their +elements that can be used with merging the containing document nodes into +the template. + ### Tags in Multi-Document Streams If the template file is a multi-document stream the tags are preserved during diff --git a/cmd/merge.go b/cmd/merge.go index 24f7641..57c66b7 100644 --- a/cmd/merge.go +++ b/cmd/merge.go @@ -173,18 +173,23 @@ func merge(stdin bool, templateFilePath string, opts flow.Options, json, split b if i <= 0 { log.Fatalln(fmt.Sprintf("tag file must be preceeded by a tag (:)")) } + tagName := tagDef[:i] + err := dynaml.CheckTagName(tagName) + if err != nil { + log.Fatalln(fmt.Sprintf("invalid tag name [%s]:", path.Clean(tagName)), err) + } tagFilePath := tagDef[i+1:] tagFile, err := ReadFile(tagFilePath) if err != nil { - log.Fatalln(fmt.Sprintf("error reading tag gile [%s]:", path.Clean(tagFilePath)), err) + log.Fatalln(fmt.Sprintf("error reading tag file [%s]:", path.Clean(tagFilePath)), err) } tagYAML, err := yaml.Parse(tagFilePath, tagFile) if err != nil { - log.Fatalln(fmt.Sprintf("error parsing tag gile [%s]:", path.Clean(tagFilePath)), err) + log.Fatalln(fmt.Sprintf("error parsing tag file [%s]:", path.Clean(tagFilePath)), err) } - tags = append(tags, dynaml.NewTag(tagDef[:i], tagYAML, nil, dynaml.TAG_SCOPE_GLOBAL)) + tags = append(tags, dynaml.NewTag(tagName, tagYAML, nil, dynaml.TAG_SCOPE_GLOBAL)) } if stubs == nil { diff --git a/dynaml/call.go b/dynaml/call.go index a71c800..7f2ecea 100644 --- a/dynaml/call.go +++ b/dynaml/call.go @@ -2,9 +2,10 @@ package dynaml import ( "fmt" - "github.com/mandelsoft/spiff/yaml" "strings" + "github.com/mandelsoft/spiff/yaml" + "github.com/mandelsoft/spiff/debug" ) @@ -58,7 +59,7 @@ func (e CallExpr) Evaluate(binding Binding, locally bool) (interface{}, Evaluati var info EvaluationInfo ref, okf := e.Function.(ReferenceExpr) - if okf && len(ref.Path) == 1 && ref.Path[0] != "" && ref.Path[0] != "_" { + if okf && ref.Tag == "" && len(ref.Path) == 1 && ref.Path[0] != "" && ref.Path[0] != "_" { funcName = ref.Path[0] } else { value, info, okf = ResolveExpressionOrPushEvaluation(&e.Function, &resolved, &info, binding, false) diff --git a/dynaml/expression.go b/dynaml/expression.go index 9d73214..2a85108 100644 --- a/dynaml/expression.go +++ b/dynaml/expression.go @@ -1,8 +1,6 @@ package dynaml import ( - "fmt" - "github.com/mandelsoft/vfs/pkg/vfs" "github.com/mandelsoft/spiff/yaml" @@ -18,87 +16,6 @@ type SourceProvider interface { SourceName() string } -func CheckTagName(name string) error { - l := 0 - for _, c := range name { - switch c { - case ':': - if l == 0 { - return fmt.Errorf("empty tag component not allowed") - } - l = 0 - default: - l++ - if c >= '0' && c <= '9' { - if l == 1 { - return fmt.Errorf("tag component must start with alnum rune") - } - continue - } - if c >= 'a' && c <= 'z' { - continue - } - if c >= 'A' && c <= 'Z' { - continue - } - return fmt.Errorf("invalid character %q in tag component", string(c)) - } - } - return nil -} - -const TAG_LOCAL = TagScope(0x01) -const TAG_SCOPE = TagScope(0x06) -const TAG_SCOPE_GLOBAL = TagScope(0x00) -const TAG_SCOPE_STREAM = TagScope(0x02) - -type TagScope int - -type Tag struct { - name string - node yaml.Node - path []string - scope TagScope -} - -func NewTag(name string, node yaml.Node, path []string, scope TagScope) *Tag { - return &Tag{name, node, path, scope} -} - -func (t *Tag) Name() string { - return t.name -} - -func (t *Tag) Node() yaml.Node { - return t.node -} - -func (t *Tag) Path() []string { - return t.path -} - -func (t *Tag) Scope() TagScope { - return t.scope -} - -func (t *Tag) IsLocal() bool { - return t.scope&TAG_LOCAL != 0 -} - -func (t *Tag) IsStream() bool { - return t.scope&TAG_SCOPE == TAG_SCOPE_STREAM -} - -func (t *Tag) IsGlobal() bool { - return t.scope&TAG_SCOPE == TAG_SCOPE_GLOBAL -} - -func (t *Tag) ResetLocal() { - if t.IsLocal() { - t.scope &= ^TAG_LOCAL - } -} - type State interface { GetTempName(data []byte) (string, error) GetFileContent(file string, cached bool) ([]byte, error) @@ -110,6 +27,7 @@ type State interface { InterpolationEnabled() bool SetTag(name string, node yaml.Node, path []string, scope TagScope) error GetTag(name string) *Tag + GetTags(name string) []*TagInfo EnableInterpolation() } diff --git a/dynaml/parser_test.go b/dynaml/parser_test.go index 35f215a..2bd27c5 100644 --- a/dynaml/parser_test.go +++ b/dynaml/parser_test.go @@ -116,6 +116,18 @@ var _ = Describe("parsing", func() { }) }) + Describe("tagged expressions", func() { + It("parses tagged function", func() { + parsesAs( + `lib::func(1)`, + CallExpr{ + Function: ReferenceExpr{Tag: "lib", Path: []string{"func"}}, + Arguments: []Expression{IntegerExpr{Value: 1}}, + }, + ) + }) + }) + Describe("concatenation", func() { It("parses adjacent nodes as concatenation", func() { parsesAs( diff --git a/dynaml/reference.go b/dynaml/reference.go index 9f9ac5a..a7595a0 100644 --- a/dynaml/reference.go +++ b/dynaml/reference.go @@ -25,16 +25,59 @@ func (e ReferenceExpr) Evaluate(binding Binding, locally bool) (interface{}, Eva fromRoot := e.Path[0] == "" debug.Debug("reference: (%s)%v\n", e.Tag, e.Path) + sel := func(end int, path []string) (yaml.Node, bool) { + if fromRoot { + start := 0 + if e.Path[0] == "" { + start = 1 + } + return binding.FindFromRoot(path[start : end+1]) + } else { + if tag != nil { + return yaml.Find(tag.Node(), path...) + } + return binding.FindReference(path[:end+1]) + } + } + if e.Tag != "" { info := DefaultInfo() if e.Tag != "doc:0" { - tag = binding.GetState().GetTag(e.Tag) - if tag == nil { + tags := binding.GetState().GetTags(e.Tag) + if len(tags) == 0 { return info.Error("tag '%s' not found", e.Tag) } if len(e.Path) == 1 && e.Path[0] == "" { - return tag.Node().Value(), info, true + if len(tags) == 1 || tags[0].Name() == e.Tag { + return tags[0].Node().Value(), info, true + } + return info.Error("found multiple tags for '%s': %s", e.Tag, tagList(tags)) + } + var val interface{} + var info EvaluationInfo + var found *TagInfo + for _, t := range tags { + tag = t.Tag() + if found != nil && found.Level() < t.Level() { + break + } + val1, info1, ok1 := e.find(sel, binding, locally) + if ok1 { + if tag.Name() == e.Tag { + return val1, info1, ok1 + } + if found != nil { + if found.Level() == t.Level() { + return info.Error("ambigious tag resolution for %s: %s <-> %s", e.String(), + found.Name(), t.Name()) + } + } + found = t + val = val1 + info = info1 + } } + return val, info, found != nil } else { if len(e.Path) == 1 && e.Path[0] == "" { return info.Error("no reference to actual document possible") @@ -42,20 +85,7 @@ func (e ReferenceExpr) Evaluate(binding Binding, locally bool) (interface{}, Eva fromRoot = true } } - return e.find(func(end int, path []string) (yaml.Node, bool) { - if fromRoot { - start := 0 - if e.Path[0] == "" { - start = 1 - } - return binding.FindFromRoot(path[start : end+1]) - } else { - if tag != nil { - return yaml.Find(tag.Node(), path...) - } - return binding.FindReference(path[:end+1]) - } - }, binding, locally) + return e.find(sel, binding, locally) } func (e ReferenceExpr) String() string { @@ -103,3 +133,13 @@ func (e ReferenceExpr) find(f func(int, []string) (node yaml.Node, x bool), bind info.KeyName = step.KeyName() return value(yaml.ReferencedNode(step)), info, true } + +func tagList(list []*TagInfo) string { + s := "" + sep := "" + for _, l := range list { + s = s + sep + l.Name() + sep = ", " + } + return s +} diff --git a/dynaml/tag.go b/dynaml/tag.go new file mode 100644 index 0000000..7cb720b --- /dev/null +++ b/dynaml/tag.go @@ -0,0 +1,159 @@ +package dynaml + +import ( + "fmt" + + "github.com/mandelsoft/spiff/yaml" +) + +const TAG_LOCAL = TagScope(0x01) +const TAG_SCOPE = TagScope(0x06) +const TAG_SCOPE_GLOBAL = TagScope(0x00) +const TAG_SCOPE_STREAM = TagScope(0x02) + +type TagScope int + +type Tag struct { + name string + node yaml.Node + path []string + scope TagScope +} + +func NewTag(name string, node yaml.Node, path []string, scope TagScope) *Tag { + return &Tag{name, node, path, scope} +} + +func (t *Tag) Name() string { + return t.name +} + +func (t *Tag) Node() yaml.Node { + return t.node +} + +func (t *Tag) Path() []string { + return t.path +} + +func (t *Tag) Scope() TagScope { + return t.scope +} + +func (t *Tag) IsLocal() bool { + return t.scope&TAG_LOCAL != 0 +} + +func (t *Tag) IsStream() bool { + return t.scope&TAG_SCOPE == TAG_SCOPE_STREAM +} + +func (t *Tag) IsGlobal() bool { + return t.scope&TAG_SCOPE == TAG_SCOPE_GLOBAL +} + +func (t *Tag) ResetLocal() { + if t.IsLocal() { + t.scope &= ^TAG_LOCAL + } +} + +type TagInfo struct { + tag *Tag + level int + comps []string +} + +func (t *TagInfo) Tag() *Tag { + return t.tag +} + +func (t *TagInfo) Level() int { + return t.level +} + +func (t *TagInfo) Comps() []string { + return t.comps +} + +func (t *TagInfo) Name() string { + return t.tag.name +} + +func (t *TagInfo) Node() yaml.Node { + return t.tag.node +} + +func (t *TagInfo) Path() []string { + return t.tag.path +} + +func (t *TagInfo) Scope() TagScope { + return t.tag.scope +} + +func (t *TagInfo) IsLocal() bool { + return t.tag.IsLocal() +} + +func (t *TagInfo) IsStream() bool { + return t.tag.IsStream() +} + +func (t *TagInfo) IsGlobal() bool { + return t.tag.IsGlobal() +} + +func (t *TagInfo) ResetLocal() { + t.tag.ResetLocal() +} + +func NewTagInfo(tag *Tag) *TagInfo { + l := 0 + comp := "" + comps := []string{} + for _, c := range tag.name { + if c == ':' { + comps = append(comps, comp) + comp = "" + l++ + } else { + comp += string(c) + } + } + comps = append(comps, comp) + return &TagInfo{ + tag: tag, + level: l, + comps: comps, + } +} + +func CheckTagName(name string) error { + l := 0 + for _, c := range name { + switch c { + case ':': + if l == 0 { + return fmt.Errorf("empty tag component not allowed") + } + l = 0 + default: + l++ + if c >= '0' && c <= '9' { + if l == 1 { + return fmt.Errorf("tag component must start with alnum rune") + } + continue + } + if c >= 'a' && c <= 'z' { + continue + } + if c >= 'A' && c <= 'Z' { + continue + } + return fmt.Errorf("invalid character %q in tag component", string(c)) + } + } + return nil +} diff --git a/flow/flow_tag_test.go b/flow/flow_tag_test.go index 18702e6..f5b7533 100644 --- a/flow/flow_tag_test.go +++ b/flow/flow_tag_test.go @@ -182,4 +182,66 @@ data: )) }) }) + + Context("Tag Scopes", func() { + It("propagates tag content", func() { + source := parseYAML(` +--- +tags: + - <<: (( &temporary )) + - <<: (( &tag:lib:alice )) + data: alice.alice + - <<: (( &tag:lib:alice:v1 )) + data: alice.v1 +usage: + data: (( lib::data )) +`) + resolved := parseYAML(` +--- +usage: + data: alice.alice +`) + Expect(source).To(FlowAs(resolved)) + }) + It("detects nonuniqe path resolution", func() { + source := parseYAML(` +--- +tags: + - <<: (( &temporary )) + - <<: (( &tag:lib:alice )) + data: alice.alice + - <<: (( &tag:lib:bob)) + data: bob +usage: + data: (( catch(lib::data) )) +`) + resolved := parseYAML(` +--- +usage: + data: + error: 'ambigious tag resolution for lib::data: lib:alice <-> lib:bob' + valid: false +`) + Expect(source).To(FlowAs(resolved)) + }) + + It("handles context", func() { + source := parseYAML(` +--- +tags: + - <<: (( &temporary )) + - <<: (( &tag:lib:alice )) + func: (( |x|->x * _.multiplier )) + multiplier: 2 +usage: + data: (( lib::func(2) )) +`) + resolved := parseYAML(` +--- +usage: + data: 4 +`) + Expect(source).To(FlowAs(resolved)) + }) + }) }) diff --git a/flow/state.go b/flow/state.go index 4a92d9d..7beda9e 100644 --- a/flow/state.go +++ b/flow/state.go @@ -8,6 +8,7 @@ import ( "net/http" "path" "reflect" + "sort" "strconv" "strings" @@ -31,7 +32,7 @@ type State struct { fileSystem vfs.VFS // virtual filesystem to use for filesystem based operations functions dynaml.Registry interpolation bool - tags map[string]*dynaml.Tag + tags map[string]*dynaml.TagInfo docno int // document number } @@ -48,7 +49,7 @@ func NewState(key string, mode int, optfs ...vfs.FileSystem) *State { mode = mode & ^MODE_OS_ACCESS } return &State{ - tags: map[string]*dynaml.Tag{}, + tags: map[string]*dynaml.TagInfo{}, files: map[string]string{}, fileCache: map[string][]byte{}, key: key, @@ -68,9 +69,9 @@ func (s *State) SetFunctions(f dynaml.Registry) *State { } func (s *State) SetTags(tags ...*dynaml.Tag) *State { - s.tags = map[string]*dynaml.Tag{} + s.tags = map[string]*dynaml.TagInfo{} for _, v := range tags { - s.tags[v.Name()] = v + s.tags[v.Name()] = dynaml.NewTagInfo(v) } return s } @@ -138,7 +139,7 @@ func (s *State) SetTag(name string, node yaml.Node, path []string, scope dynaml. return fmt.Errorf("duplicate tag %q: %s <-> %s", name, strings.Join(path, "."), strings.Join(old.Path(), ".")) } } - s.tags[name] = dynaml.NewTag(name, Cleanup(node, discardTags), path, scope) + s.tags[name] = dynaml.NewTagInfo(dynaml.NewTag(name, Cleanup(node, discardTags), path, scope)) return nil } @@ -156,16 +157,56 @@ func (s *State) GetTag(name string) *dynaml.Tag { name = fmt.Sprintf("doc:%d", i) } } - return s.tags[name] + tag := s.tags[name] + if tag == nil { + return nil + } + return tag.Tag() +} + +func (s *State) GetTags(name string) []*dynaml.TagInfo { + if strings.HasPrefix(name, "doc:") { + i, err := strconv.Atoi(name[4:]) + if err != nil { + return nil + } + if i <= 0 { + i += s.docno + if i <= 0 { + return nil + } + name = fmt.Sprintf("doc:%d", i) + } + tag := s.tags[name] + if tag == nil { + return nil + } + return []*dynaml.TagInfo{tag} + } + + var list []*dynaml.TagInfo + prefix := name + ":" + for _, t := range s.tags { + if t.Name() == name || strings.HasPrefix(t.Name(), prefix) { + list = append(list, t) + } + } + sort.Slice(list, func(i, j int) bool { + if list[i].Level() != list[j].Level() { + return list[i].Level() < list[j].Level() + } + return strings.Compare(list[i].Name(), list[j].Name()) < 0 + }) + return list } func (s *State) ResetTags() { - s.tags = map[string]*dynaml.Tag{} + s.tags = map[string]*dynaml.TagInfo{} s.docno = 1 } func (s *State) ResetStream() { - n := map[string]*dynaml.Tag{} + n := map[string]*dynaml.TagInfo{} for _, v := range s.tags { if !v.IsStream() { n[v.Name()] = v diff --git a/spiffing/spiff.go b/spiffing/spiff.go index 639e3fb..a57e7f1 100644 --- a/spiffing/spiff.go +++ b/spiffing/spiff.go @@ -183,7 +183,7 @@ func (s spiff) WithValues(values map[string]interface{}) (Spiff, error) { // SetTag sets/resets a global tag for subsequent processings. func (s spiff) SetTag(tag string, node yaml.Node) Spiff { - s.tags[tag] = dynaml.NewTag(tag, node, nil, true) + s.tags[tag] = dynaml.NewTag(tag, node, nil, dynaml.TAG_SCOPE_GLOBAL) return s.Reset() }