diff --git a/README.md b/README.md index a711694..604adcf 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-) @@ -168,6 +169,13 @@ Contents: - [(( &inject ))](#-inject-) - [(( &default ))](#-default-) - [(( &state ))](#-state-) + - [(( &tag:name ))](#-tagname-) + - [Tags](#tags) + - [(( &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-) - [(( *foo.bar ))](#-foobar-) @@ -212,10 +220,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`. @@ -256,6 +266,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. @@ -2182,6 +2198,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. @@ -2986,7 +3035,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 +3083,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 +4750,214 @@ 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) +``` + +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. + +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` + +### 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 +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. +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. The implicit document tags are qualified with the +prefix `doc:`. This prefix should not be used to own tags in the documents + +e.g.: + +**template.yaml** +```yaml +<<: (( &temporary )) +data: + <<: (( &tag:persons )) + alice: 25 + bob: 24 +--- +alice: (( persons::alice )) +prev: (( doc:1::. )) +--- +bob: (( persons::bob )) +prev: (( doc:2::. )) +``` + +resolves to + +```yaml +--- +alice: 25 +prev: + data: + alice: 25 + bob: 24 +--- +bob: 24 +prev: + alice: 25 + prev: + data: + alice: 25 + bob: 24 +``` + +If the given document index is negative it denotes the document relative to the +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 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..57c66b7 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 @@ -63,13 +64,14 @@ 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") 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,32 @@ 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 (:)")) + } + 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 file [%s]:", path.Clean(tagFilePath)), err) + } + + tagYAML, err := yaml.Parse(tagFilePath, tagFile) + if err != nil { + log.Fatalln(fmt.Sprintf("error parsing tag file [%s]:", path.Clean(tagFilePath)), err) + } + + tags = append(tags, dynaml.NewTag(tagName, tagYAML, nil, dynaml.TAG_SCOPE_GLOBAL)) + } + if stubs == nil { stubs = []yaml.Node{} } @@ -203,8 +231,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 { @@ -238,6 +267,9 @@ func merge(stdin bool, templateFilePath string, opts flow.Options, json, split b if err != nil { flowed = dynaml.ResetUnresolvedNodes(flowed) } + if !opts.PreserveTemporary && flowed.Temporary() { + continue + } if subpath != "" { comps := dynaml.PathComponents(subpath, false) node, ok := yaml.FindR(true, flowed, comps...) diff --git a/cmd/root.go b/cmd/root.go index 0927263..b909315 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,7 +17,7 @@ var cfgFile string var rootCmd = &cobra.Command{ Use: "spiff", Short: "YAML in-domain templating processor", - Version: "v1.7.0-beta-1", + Version: "v1.7.0-beta-2", } // Execute adds all child commands to the root command and sets flags appropriately. 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..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) @@ -139,9 +140,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..9b2e007 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 ( ':' TagName )* MarkerExpression <- Grouped Expression <- ( Scoped / LambdaExpr / Level7 ) ws @@ -44,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 @@ -71,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' / '~' @@ -118,7 +119,9 @@ Name <- [a-zA-Z0-9_]+ DefaultValue <- '=' Expression VarParams <- '...' ws -Reference <- '.'? Key FollowUpRef +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 609a9be..cf6b3e4 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,3987 @@ func (p *DynamlGrammar) Init() { position, tokenIndex, depth = position16, tokenIndex16, depth16 return false }, - /* 5 MarkerExpression <- */ + /* 5 TagMarker <- <('t' 'a' 'g' ':' '*'? TagName (':' TagName)*)> */ + func() bool { + position25, tokenIndex25, depth25 := position, tokenIndex, depth + { + 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++ + { + 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) + } + return true + l25: + position, tokenIndex, depth = position25, tokenIndex25, depth25 + return false + }, + /* 6 MarkerExpression <- */ func() bool { - position24, tokenIndex24, depth24 := position, tokenIndex, depth + position31, tokenIndex31, depth31 := position, tokenIndex, depth { - position25 := position + position32 := position depth++ if !_rules[ruleGrouped]() { - goto l24 + goto l31 } depth-- - add(ruleMarkerExpression, position25) + add(ruleMarkerExpression, position32) } return true - l24: - position, tokenIndex, depth = position24, tokenIndex24, depth24 + l31: + position, tokenIndex, depth = position31, tokenIndex31, depth31 return false }, - /* 6 Expression <- <((Scoped / LambdaExpr / Level7) ws)> */ + /* 7 Expression <- <((Scoped / LambdaExpr / Level7) ws)> */ func() bool { - position26, tokenIndex26, depth26 := position, tokenIndex, depth + position33, tokenIndex33, depth33 := position, tokenIndex, depth { - position27 := position + position34 := position depth++ { - position28, tokenIndex28, depth28 := position, tokenIndex, depth + position35, tokenIndex35, depth35 := position, tokenIndex, depth if !_rules[ruleScoped]() { - goto l29 + goto l36 } - goto l28 - l29: - position, tokenIndex, depth = position28, tokenIndex28, depth28 + goto l35 + l36: + position, tokenIndex, depth = position35, tokenIndex35, depth35 if !_rules[ruleLambdaExpr]() { - goto l30 + goto l37 } - goto l28 - l30: - position, tokenIndex, depth = position28, tokenIndex28, depth28 + goto l35 + l37: + position, tokenIndex, depth = position35, tokenIndex35, depth35 if !_rules[ruleLevel7]() { - goto l26 + goto l33 } } - l28: + l35: if !_rules[rulews]() { - goto l26 + goto l33 } depth-- - add(ruleExpression, position27) + add(ruleExpression, position34) } return true - l26: - position, tokenIndex, depth = position26, tokenIndex26, depth26 + l33: + position, tokenIndex, depth = position33, tokenIndex33, depth33 return false }, - /* 7 Scoped <- <(ws Scope ws Expression)> */ + /* 8 Scoped <- <(ws Scope ws Expression)> */ func() bool { - position31, tokenIndex31, depth31 := position, tokenIndex, depth + position38, tokenIndex38, depth38 := position, tokenIndex, depth { - position32 := position + position39 := position depth++ if !_rules[rulews]() { - goto l31 + goto l38 } if !_rules[ruleScope]() { - goto l31 + goto l38 } if !_rules[rulews]() { - goto l31 + goto l38 } if !_rules[ruleExpression]() { - goto l31 + goto l38 } depth-- - add(ruleScoped, position32) + add(ruleScoped, position39) } return true - l31: - position, tokenIndex, depth = position31, tokenIndex31, depth31 + l38: + position, tokenIndex, depth = position38, tokenIndex38, depth38 return false }, - /* 8 Scope <- <(CreateScope ws Assignments? ')')> */ + /* 9 Scope <- <(CreateScope ws Assignments? ')')> */ func() bool { - position33, tokenIndex33, depth33 := position, tokenIndex, depth + position40, tokenIndex40, depth40 := position, tokenIndex, depth { - position34 := position + position41 := position depth++ if !_rules[ruleCreateScope]() { - goto l33 + goto l40 } if !_rules[rulews]() { - goto l33 + goto l40 } { - position35, tokenIndex35, depth35 := position, tokenIndex, depth + position42, tokenIndex42, depth42 := position, tokenIndex, depth if !_rules[ruleAssignments]() { - goto l35 + goto l42 } - goto l36 - l35: - position, tokenIndex, depth = position35, tokenIndex35, depth35 + goto l43 + l42: + position, tokenIndex, depth = position42, tokenIndex42, depth42 } - l36: + l43: if buffer[position] != rune(')') { - goto l33 + goto l40 } position++ depth-- - add(ruleScope, position34) + add(ruleScope, position41) } return true - l33: - position, tokenIndex, depth = position33, tokenIndex33, depth33 + l40: + position, tokenIndex, depth = position40, tokenIndex40, depth40 return false }, - /* 9 CreateScope <- <'('> */ + /* 10 CreateScope <- <'('> */ func() bool { - position37, tokenIndex37, depth37 := position, tokenIndex, depth + position44, tokenIndex44, depth44 := position, tokenIndex, depth { - position38 := position + position45 := position depth++ if buffer[position] != rune('(') { - goto l37 + goto l44 } position++ depth-- - add(ruleCreateScope, position38) + add(ruleCreateScope, position45) } return true - l37: - position, tokenIndex, depth = position37, tokenIndex37, depth37 + l44: + position, tokenIndex, depth = position44, tokenIndex44, depth44 return false }, - /* 10 Level7 <- <(ws Level6 (req_ws Or)*)> */ + /* 11 Level7 <- <(ws Level6 (req_ws Or)*)> */ func() bool { - position39, tokenIndex39, depth39 := position, tokenIndex, depth + position46, tokenIndex46, depth46 := position, tokenIndex, depth { - position40 := position + position47 := position depth++ if !_rules[rulews]() { - goto l39 + goto l46 } if !_rules[ruleLevel6]() { - goto l39 + goto l46 } - l41: + l48: { - position42, tokenIndex42, depth42 := position, tokenIndex, depth + position49, tokenIndex49, depth49 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l42 + goto l49 } if !_rules[ruleOr]() { - goto l42 + goto l49 } - goto l41 - l42: - position, tokenIndex, depth = position42, tokenIndex42, depth42 + goto l48 + l49: + position, tokenIndex, depth = position49, tokenIndex49, depth49 } depth-- - add(ruleLevel7, position40) + add(ruleLevel7, position47) } return true - l39: - position, tokenIndex, depth = position39, tokenIndex39, depth39 + l46: + position, tokenIndex, depth = position46, tokenIndex46, depth46 return false }, - /* 11 Or <- <(OrOp req_ws Level6)> */ + /* 12 Or <- <(OrOp req_ws Level6)> */ func() bool { - position43, tokenIndex43, depth43 := position, tokenIndex, depth + position50, tokenIndex50, depth50 := position, tokenIndex, depth { - position44 := position + position51 := position depth++ if !_rules[ruleOrOp]() { - goto l43 + goto l50 } if !_rules[rulereq_ws]() { - goto l43 + goto l50 } if !_rules[ruleLevel6]() { - goto l43 + goto l50 } depth-- - add(ruleOr, position44) + add(ruleOr, position51) } return true - l43: - position, tokenIndex, depth = position43, tokenIndex43, depth43 + l50: + position, tokenIndex, depth = position50, tokenIndex50, depth50 return false }, - /* 12 OrOp <- <(('|' '|') / ('/' '/'))> */ + /* 13 OrOp <- <(('|' '|') / ('/' '/'))> */ func() bool { - position45, tokenIndex45, depth45 := position, tokenIndex, depth + position52, tokenIndex52, depth52 := position, tokenIndex, depth { - position46 := position + position53 := position depth++ { - position47, tokenIndex47, depth47 := position, tokenIndex, depth + position54, tokenIndex54, depth54 := position, tokenIndex, depth if buffer[position] != rune('|') { - goto l48 + goto l55 } position++ if buffer[position] != rune('|') { - goto l48 + goto l55 } position++ - goto l47 - l48: - position, tokenIndex, depth = position47, tokenIndex47, depth47 + goto l54 + l55: + position, tokenIndex, depth = position54, tokenIndex54, depth54 if buffer[position] != rune('/') { - goto l45 + goto l52 } position++ if buffer[position] != rune('/') { - goto l45 + goto l52 } position++ } - l47: + l54: depth-- - add(ruleOrOp, position46) + add(ruleOrOp, position53) } return true - l45: - position, tokenIndex, depth = position45, tokenIndex45, depth45 + l52: + position, tokenIndex, depth = position52, tokenIndex52, depth52 return false }, - /* 13 Level6 <- <(Conditional / Level5)> */ + /* 14 Level6 <- <(Conditional / Level5)> */ func() bool { - position49, tokenIndex49, depth49 := position, tokenIndex, depth + position56, tokenIndex56, depth56 := position, tokenIndex, depth { - position50 := position + position57 := position depth++ { - position51, tokenIndex51, depth51 := position, tokenIndex, depth + position58, tokenIndex58, depth58 := position, tokenIndex, depth if !_rules[ruleConditional]() { - goto l52 + goto l59 } - goto l51 - l52: - position, tokenIndex, depth = position51, tokenIndex51, depth51 + goto l58 + l59: + position, tokenIndex, depth = position58, tokenIndex58, depth58 if !_rules[ruleLevel5]() { - goto l49 + goto l56 } } - l51: + l58: depth-- - add(ruleLevel6, position50) + add(ruleLevel6, position57) } return true - l49: - position, tokenIndex, depth = position49, tokenIndex49, depth49 + l56: + position, tokenIndex, depth = position56, tokenIndex56, depth56 return false }, - /* 14 Conditional <- <(Level5 ws '?' Expression ':' Expression)> */ + /* 15 Conditional <- <(Level5 ws '?' Expression ':' Expression)> */ func() bool { - position53, tokenIndex53, depth53 := position, tokenIndex, depth + position60, tokenIndex60, depth60 := position, tokenIndex, depth { - position54 := position + position61 := position depth++ if !_rules[ruleLevel5]() { - goto l53 + goto l60 } if !_rules[rulews]() { - goto l53 + goto l60 } if buffer[position] != rune('?') { - goto l53 + goto l60 } position++ if !_rules[ruleExpression]() { - goto l53 + goto l60 } if buffer[position] != rune(':') { - goto l53 + goto l60 } position++ if !_rules[ruleExpression]() { - goto l53 + goto l60 } depth-- - add(ruleConditional, position54) + add(ruleConditional, position61) } return true - l53: - position, tokenIndex, depth = position53, tokenIndex53, depth53 + l60: + position, tokenIndex, depth = position60, tokenIndex60, depth60 return false }, - /* 15 Level5 <- <(Level4 Concatenation*)> */ + /* 16 Level5 <- <(Level4 Concatenation*)> */ func() bool { - position55, tokenIndex55, depth55 := position, tokenIndex, depth + position62, tokenIndex62, depth62 := position, tokenIndex, depth { - position56 := position + position63 := position depth++ if !_rules[ruleLevel4]() { - goto l55 + goto l62 } - l57: + l64: { - position58, tokenIndex58, depth58 := position, tokenIndex, depth + position65, tokenIndex65, depth65 := position, tokenIndex, depth if !_rules[ruleConcatenation]() { - goto l58 + goto l65 } - goto l57 - l58: - position, tokenIndex, depth = position58, tokenIndex58, depth58 + goto l64 + l65: + position, tokenIndex, depth = position65, tokenIndex65, depth65 } depth-- - add(ruleLevel5, position56) + add(ruleLevel5, position63) } return true - l55: - position, tokenIndex, depth = position55, tokenIndex55, depth55 + l62: + position, tokenIndex, depth = position62, tokenIndex62, depth62 return false }, - /* 16 Concatenation <- <(req_ws Level4)> */ + /* 17 Concatenation <- <(req_ws Level4)> */ func() bool { - position59, tokenIndex59, depth59 := position, tokenIndex, depth + position66, tokenIndex66, depth66 := position, tokenIndex, depth { - position60 := position + position67 := position depth++ if !_rules[rulereq_ws]() { - goto l59 + goto l66 } if !_rules[ruleLevel4]() { - goto l59 + goto l66 } depth-- - add(ruleConcatenation, position60) + add(ruleConcatenation, position67) } return true - l59: - position, tokenIndex, depth = position59, tokenIndex59, depth59 + l66: + position, tokenIndex, depth = position66, tokenIndex66, depth66 return false }, - /* 17 Level4 <- <(Level3 (req_ws (LogOr / LogAnd))*)> */ + /* 18 Level4 <- <(Level3 (req_ws (LogOr / LogAnd))*)> */ func() bool { - position61, tokenIndex61, depth61 := position, tokenIndex, depth + position68, tokenIndex68, depth68 := position, tokenIndex, depth { - position62 := position + position69 := position depth++ if !_rules[ruleLevel3]() { - goto l61 + goto l68 } - l63: + l70: { - position64, tokenIndex64, depth64 := position, tokenIndex, depth + position71, tokenIndex71, depth71 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l64 + goto l71 } { - position65, tokenIndex65, depth65 := position, tokenIndex, depth + position72, tokenIndex72, depth72 := position, tokenIndex, depth if !_rules[ruleLogOr]() { - goto l66 + goto l73 } - goto l65 - l66: - position, tokenIndex, depth = position65, tokenIndex65, depth65 + goto l72 + l73: + position, tokenIndex, depth = position72, tokenIndex72, depth72 if !_rules[ruleLogAnd]() { - goto l64 + goto l71 } } - l65: - goto l63 - l64: - position, tokenIndex, depth = position64, tokenIndex64, depth64 + l72: + goto l70 + l71: + position, tokenIndex, depth = position71, tokenIndex71, depth71 } depth-- - add(ruleLevel4, position62) + add(ruleLevel4, position69) } return true - l61: - position, tokenIndex, depth = position61, tokenIndex61, depth61 + l68: + position, tokenIndex, depth = position68, tokenIndex68, depth68 return false }, - /* 18 LogOr <- <('-' 'o' 'r' req_ws Level3)> */ + /* 19 LogOr <- <('-' 'o' 'r' req_ws Level3)> */ func() bool { - position67, tokenIndex67, depth67 := position, tokenIndex, depth + position74, tokenIndex74, depth74 := position, tokenIndex, depth { - position68 := position + position75 := position depth++ if buffer[position] != rune('-') { - goto l67 + goto l74 } position++ if buffer[position] != rune('o') { - goto l67 + goto l74 } position++ if buffer[position] != rune('r') { - goto l67 + goto l74 } position++ if !_rules[rulereq_ws]() { - goto l67 + goto l74 } if !_rules[ruleLevel3]() { - goto l67 + goto l74 } depth-- - add(ruleLogOr, position68) + add(ruleLogOr, position75) } return true - l67: - position, tokenIndex, depth = position67, tokenIndex67, depth67 + l74: + position, tokenIndex, depth = position74, tokenIndex74, depth74 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 + position76, tokenIndex76, depth76 := position, tokenIndex, depth { - position70 := position + position77 := position depth++ if buffer[position] != rune('-') { - goto l69 + goto l76 } position++ if buffer[position] != rune('a') { - goto l69 + goto l76 } position++ if buffer[position] != rune('n') { - goto l69 + goto l76 } position++ if buffer[position] != rune('d') { - goto l69 + goto l76 } position++ if !_rules[rulereq_ws]() { - goto l69 + goto l76 } if !_rules[ruleLevel3]() { - goto l69 + goto l76 } depth-- - add(ruleLogAnd, position70) + add(ruleLogAnd, position77) } return true - l69: - position, tokenIndex, depth = position69, tokenIndex69, depth69 + l76: + position, tokenIndex, depth = position76, tokenIndex76, depth76 return false }, - /* 20 Level3 <- <(Level2 (req_ws Comparison)*)> */ + /* 21 Level3 <- <(Level2 (req_ws Comparison)*)> */ func() bool { - position71, tokenIndex71, depth71 := position, tokenIndex, depth + position78, tokenIndex78, depth78 := position, tokenIndex, depth { - position72 := position + position79 := position depth++ if !_rules[ruleLevel2]() { - goto l71 + goto l78 } - l73: + l80: { - position74, tokenIndex74, depth74 := position, tokenIndex, depth + position81, tokenIndex81, depth81 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l74 + goto l81 } if !_rules[ruleComparison]() { - goto l74 + goto l81 } - goto l73 - l74: - position, tokenIndex, depth = position74, tokenIndex74, depth74 + goto l80 + l81: + position, tokenIndex, depth = position81, tokenIndex81, depth81 } depth-- - add(ruleLevel3, position72) + add(ruleLevel3, position79) } return true - l71: - position, tokenIndex, depth = position71, tokenIndex71, depth71 + l78: + position, tokenIndex, depth = position78, tokenIndex78, depth78 return false }, - /* 21 Comparison <- <(CompareOp req_ws Level2)> */ + /* 22 Comparison <- <(CompareOp req_ws Level2)> */ func() bool { - position75, tokenIndex75, depth75 := position, tokenIndex, depth + position82, tokenIndex82, depth82 := position, tokenIndex, depth { - position76 := position + position83 := position depth++ if !_rules[ruleCompareOp]() { - goto l75 + goto l82 } if !_rules[rulereq_ws]() { - goto l75 + goto l82 } if !_rules[ruleLevel2]() { - goto l75 + goto l82 } depth-- - add(ruleComparison, position76) + add(ruleComparison, position83) } return true - l75: - position, tokenIndex, depth = position75, tokenIndex75, depth75 + l82: + position, tokenIndex, depth = position82, tokenIndex82, depth82 return false }, - /* 22 CompareOp <- <(('=' '=') / ('!' '=') / ('<' '=') / ('>' '=') / '>' / '<' / '>')> */ + /* 23 CompareOp <- <(('=' '=') / ('!' '=') / ('<' '=') / ('>' '=') / '>' / '<' / '>')> */ func() bool { - position77, tokenIndex77, depth77 := position, tokenIndex, depth + position84, tokenIndex84, depth84 := position, tokenIndex, depth { - position78 := position + position85 := position depth++ { - position79, tokenIndex79, depth79 := position, tokenIndex, depth + position86, tokenIndex86, depth86 := position, tokenIndex, depth if buffer[position] != rune('=') { - goto l80 + goto l87 } position++ if buffer[position] != rune('=') { - goto l80 + goto l87 } position++ - goto l79 - l80: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l86 + l87: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('!') { - goto l81 + goto l88 } position++ if buffer[position] != rune('=') { - goto l81 + goto l88 } position++ - goto l79 - l81: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l86 + l88: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('<') { - goto l82 + goto l89 } position++ if buffer[position] != rune('=') { - goto l82 + goto l89 } position++ - goto l79 - l82: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l86 + l89: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('>') { - goto l83 + goto l90 } position++ if buffer[position] != rune('=') { - goto l83 + goto l90 } position++ - goto l79 - l83: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l86 + l90: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('>') { - goto l84 + goto l91 } position++ - goto l79 - l84: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l86 + l91: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('<') { - goto l85 + goto l92 } position++ - goto l79 - l85: - position, tokenIndex, depth = position79, tokenIndex79, depth79 + goto l86 + l92: + position, tokenIndex, depth = position86, tokenIndex86, depth86 if buffer[position] != rune('>') { - goto l77 + goto l84 } position++ } - l79: + l86: depth-- - add(ruleCompareOp, position78) + add(ruleCompareOp, position85) } return true - l77: - position, tokenIndex, depth = position77, tokenIndex77, depth77 + l84: + position, tokenIndex, depth = position84, tokenIndex84, depth84 return false }, - /* 23 Level2 <- <(Level1 (req_ws (Addition / Subtraction))*)> */ + /* 24 Level2 <- <(Level1 (req_ws (Addition / Subtraction))*)> */ func() bool { - position86, tokenIndex86, depth86 := position, tokenIndex, depth + position93, tokenIndex93, depth93 := position, tokenIndex, depth { - position87 := position + position94 := position depth++ if !_rules[ruleLevel1]() { - goto l86 + goto l93 } - l88: + l95: { - position89, tokenIndex89, depth89 := position, tokenIndex, depth + position96, tokenIndex96, depth96 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l89 + goto l96 } { - position90, tokenIndex90, depth90 := position, tokenIndex, depth + position97, tokenIndex97, depth97 := position, tokenIndex, depth if !_rules[ruleAddition]() { - goto l91 + goto l98 } - goto l90 - l91: - position, tokenIndex, depth = position90, tokenIndex90, depth90 + goto l97 + l98: + position, tokenIndex, depth = position97, tokenIndex97, depth97 if !_rules[ruleSubtraction]() { - goto l89 + goto l96 } } - l90: - goto l88 - l89: - position, tokenIndex, depth = position89, tokenIndex89, depth89 + l97: + goto l95 + l96: + position, tokenIndex, depth = position96, tokenIndex96, depth96 } depth-- - add(ruleLevel2, position87) + add(ruleLevel2, position94) } return true - l86: - position, tokenIndex, depth = position86, tokenIndex86, depth86 + l93: + position, tokenIndex, depth = position93, tokenIndex93, depth93 return false }, - /* 24 Addition <- <('+' req_ws Level1)> */ + /* 25 Addition <- <('+' req_ws Level1)> */ func() bool { - position92, tokenIndex92, depth92 := position, tokenIndex, depth + position99, tokenIndex99, depth99 := position, tokenIndex, depth { - position93 := position + position100 := position depth++ if buffer[position] != rune('+') { - goto l92 + goto l99 } position++ if !_rules[rulereq_ws]() { - goto l92 + goto l99 } if !_rules[ruleLevel1]() { - goto l92 + goto l99 } depth-- - add(ruleAddition, position93) + add(ruleAddition, position100) } return true - l92: - position, tokenIndex, depth = position92, tokenIndex92, depth92 + l99: + position, tokenIndex, depth = position99, tokenIndex99, depth99 return false }, - /* 25 Subtraction <- <('-' req_ws Level1)> */ + /* 26 Subtraction <- <('-' req_ws Level1)> */ func() bool { - position94, tokenIndex94, depth94 := position, tokenIndex, depth + position101, tokenIndex101, depth101 := position, tokenIndex, depth { - position95 := position + position102 := position depth++ if buffer[position] != rune('-') { - goto l94 + goto l101 } position++ if !_rules[rulereq_ws]() { - goto l94 + goto l101 } if !_rules[ruleLevel1]() { - goto l94 + goto l101 } depth-- - add(ruleSubtraction, position95) + add(ruleSubtraction, position102) } return true - l94: - position, tokenIndex, depth = position94, tokenIndex94, depth94 + l101: + position, tokenIndex, depth = position101, tokenIndex101, depth101 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 + position103, tokenIndex103, depth103 := position, tokenIndex, depth { - position97 := position + position104 := position depth++ if !_rules[ruleLevel0]() { - goto l96 + goto l103 } - l98: + l105: { - position99, tokenIndex99, depth99 := position, tokenIndex, depth + position106, tokenIndex106, depth106 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l99 + goto l106 } { - position100, tokenIndex100, depth100 := position, tokenIndex, depth + position107, tokenIndex107, depth107 := position, tokenIndex, depth if !_rules[ruleMultiplication]() { - goto l101 + goto l108 } - goto l100 - l101: - position, tokenIndex, depth = position100, tokenIndex100, depth100 + goto l107 + l108: + position, tokenIndex, depth = position107, tokenIndex107, depth107 if !_rules[ruleDivision]() { - goto l102 + goto l109 } - goto l100 - l102: - position, tokenIndex, depth = position100, tokenIndex100, depth100 + goto l107 + l109: + position, tokenIndex, depth = position107, tokenIndex107, depth107 if !_rules[ruleModulo]() { - goto l99 + goto l106 } } - l100: - goto l98 - l99: - position, tokenIndex, depth = position99, tokenIndex99, depth99 + l107: + goto l105 + l106: + position, tokenIndex, depth = position106, tokenIndex106, depth106 } depth-- - add(ruleLevel1, position97) + add(ruleLevel1, position104) } return true - l96: - position, tokenIndex, depth = position96, tokenIndex96, depth96 + l103: + position, tokenIndex, depth = position103, tokenIndex103, depth103 return false }, - /* 27 Multiplication <- <('*' req_ws Level0)> */ + /* 28 Multiplication <- <('*' req_ws Level0)> */ func() bool { - position103, tokenIndex103, depth103 := position, tokenIndex, depth + position110, tokenIndex110, depth110 := position, tokenIndex, depth { - position104 := position + position111 := position depth++ if buffer[position] != rune('*') { - goto l103 + goto l110 } position++ if !_rules[rulereq_ws]() { - goto l103 + goto l110 } if !_rules[ruleLevel0]() { - goto l103 + goto l110 } depth-- - add(ruleMultiplication, position104) + add(ruleMultiplication, position111) } return true - l103: - position, tokenIndex, depth = position103, tokenIndex103, depth103 + l110: + position, tokenIndex, depth = position110, tokenIndex110, depth110 return false }, - /* 28 Division <- <('/' req_ws Level0)> */ + /* 29 Division <- <('/' req_ws Level0)> */ func() bool { - position105, tokenIndex105, depth105 := position, tokenIndex, depth + position112, tokenIndex112, depth112 := position, tokenIndex, depth { - position106 := position + position113 := position depth++ if buffer[position] != rune('/') { - goto l105 + goto l112 } position++ if !_rules[rulereq_ws]() { - goto l105 + goto l112 } if !_rules[ruleLevel0]() { - goto l105 + goto l112 } depth-- - add(ruleDivision, position106) + add(ruleDivision, position113) } return true - l105: - position, tokenIndex, depth = position105, tokenIndex105, depth105 + l112: + position, tokenIndex, depth = position112, tokenIndex112, depth112 return false }, - /* 29 Modulo <- <('%' req_ws Level0)> */ + /* 30 Modulo <- <('%' req_ws Level0)> */ func() bool { - position107, tokenIndex107, depth107 := position, tokenIndex, depth + position114, tokenIndex114, depth114 := position, tokenIndex, depth { - position108 := position + position115 := position depth++ if buffer[position] != rune('%') { - goto l107 + goto l114 } position++ if !_rules[rulereq_ws]() { - goto l107 + goto l114 } if !_rules[ruleLevel0]() { - goto l107 + goto l114 } depth-- - add(ruleModulo, position108) + add(ruleModulo, position115) } return true - l107: - position, tokenIndex, depth = position107, tokenIndex107, depth107 + l114: + position, tokenIndex, depth = position114, tokenIndex114, depth114 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 + position116, tokenIndex116, depth116 := position, tokenIndex, depth { - position110 := position + position117 := position depth++ { - position111, tokenIndex111, depth111 := position, tokenIndex, depth + position118, tokenIndex118, depth118 := position, tokenIndex, depth if !_rules[ruleIP]() { - goto l112 + goto l119 } - goto l111 - l112: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l119: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleString]() { - goto l113 + goto l120 } - goto l111 - l113: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l120: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleNumber]() { - goto l114 + goto l121 } - goto l111 - l114: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l121: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleBoolean]() { - goto l115 + goto l122 } - goto l111 - l115: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l122: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleUndefined]() { - goto l116 + goto l123 } - goto l111 - l116: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l123: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleNil]() { - goto l117 + goto l124 } - goto l111 - l117: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l124: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleSymbol]() { - goto l118 + goto l125 } - goto l111 - l118: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l125: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleNot]() { - goto l119 + goto l126 } - goto l111 - l119: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l126: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleSubstitution]() { - goto l120 + goto l127 } - goto l111 - l120: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l127: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleMerge]() { - goto l121 + goto l128 } - goto l111 - l121: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l128: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleAuto]() { - goto l122 + goto l129 } - goto l111 - l122: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l129: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleLambda]() { - goto l123 + goto l130 } - goto l111 - l123: - position, tokenIndex, depth = position111, tokenIndex111, depth111 + goto l118 + l130: + position, tokenIndex, depth = position118, tokenIndex118, depth118 if !_rules[ruleChained]() { - goto l109 + goto l116 } } - l111: + l118: depth-- - add(ruleLevel0, position110) + add(ruleLevel0, position117) } return true - l109: - position, tokenIndex, depth = position109, tokenIndex109, depth109 + l116: + position, tokenIndex, depth = position116, tokenIndex116, depth116 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 + position131, tokenIndex131, depth131 := position, tokenIndex, depth { - position125 := position + position132 := position depth++ { - position126, tokenIndex126, depth126 := position, tokenIndex, depth + position133, tokenIndex133, depth133 := position, tokenIndex, depth if !_rules[ruleMapMapping]() { - goto l127 + goto l134 } - goto l126 - l127: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l134: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleSync]() { - goto l128 + goto l135 } - goto l126 - l128: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l135: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleCatch]() { - goto l129 + goto l136 } - goto l126 - l129: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l136: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleMapping]() { - goto l130 + goto l137 } - goto l126 - l130: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l137: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleMapSelection]() { - goto l131 + goto l138 } - goto l126 - l131: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l138: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleSelection]() { - goto l132 + goto l139 } - goto l126 - l132: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l139: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleSum]() { - goto l133 + goto l140 } - goto l126 - l133: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l140: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleList]() { - goto l134 + goto l141 } - goto l126 - l134: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l141: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleMap]() { - goto l135 + goto l142 } - goto l126 - l135: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l142: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleRange]() { - goto l136 + goto l143 } - goto l126 - l136: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l143: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleGrouped]() { - goto l137 + goto l144 } - goto l126 - l137: - position, tokenIndex, depth = position126, tokenIndex126, depth126 + goto l133 + l144: + position, tokenIndex, depth = position133, tokenIndex133, depth133 if !_rules[ruleReference]() { - goto l124 + goto l131 } } - l126: - l138: + l133: + l145: { - position139, tokenIndex139, depth139 := position, tokenIndex, depth + position146, tokenIndex146, depth146 := position, tokenIndex, depth if !_rules[ruleChainedQualifiedExpression]() { - goto l139 + goto l146 } - goto l138 - l139: - position, tokenIndex, depth = position139, tokenIndex139, depth139 + goto l145 + l146: + position, tokenIndex, depth = position146, tokenIndex146, depth146 } depth-- - add(ruleChained, position125) + add(ruleChained, position132) } return true - l124: - position, tokenIndex, depth = position124, tokenIndex124, depth124 + l131: + position, tokenIndex, depth = position131, tokenIndex131, depth131 return false }, - /* 32 ChainedQualifiedExpression <- <(ChainedCall / Currying / ChainedRef / ChainedDynRef / Projection)> */ + /* 33 ChainedQualifiedExpression <- <(ChainedCall / Currying / ChainedRef / ChainedDynRef / Projection)> */ func() bool { - position140, tokenIndex140, depth140 := position, tokenIndex, depth + position147, tokenIndex147, depth147 := position, tokenIndex, depth { - position141 := position + position148 := position depth++ { - position142, tokenIndex142, depth142 := position, tokenIndex, depth + position149, tokenIndex149, depth149 := position, tokenIndex, depth if !_rules[ruleChainedCall]() { - goto l143 + goto l150 } - goto l142 - l143: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l149 + l150: + position, tokenIndex, depth = position149, tokenIndex149, depth149 if !_rules[ruleCurrying]() { - goto l144 + goto l151 } - goto l142 - l144: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l149 + l151: + position, tokenIndex, depth = position149, tokenIndex149, depth149 if !_rules[ruleChainedRef]() { - goto l145 + goto l152 } - goto l142 - l145: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l149 + l152: + position, tokenIndex, depth = position149, tokenIndex149, depth149 if !_rules[ruleChainedDynRef]() { - goto l146 + goto l153 } - goto l142 - l146: - position, tokenIndex, depth = position142, tokenIndex142, depth142 + goto l149 + l153: + position, tokenIndex, depth = position149, tokenIndex149, depth149 if !_rules[ruleProjection]() { - goto l140 + goto l147 } } - l142: + l149: depth-- - add(ruleChainedQualifiedExpression, position141) + add(ruleChainedQualifiedExpression, position148) } return true - l140: - position, tokenIndex, depth = position140, tokenIndex140, depth140 + l147: + position, tokenIndex, depth = position147, tokenIndex147, depth147 return false }, - /* 33 ChainedRef <- <(PathComponent FollowUpRef)> */ + /* 34 ChainedRef <- <(PathComponent FollowUpRef)> */ func() bool { - position147, tokenIndex147, depth147 := position, tokenIndex, depth + position154, tokenIndex154, depth154 := position, tokenIndex, depth { - position148 := position + position155 := position depth++ if !_rules[rulePathComponent]() { - goto l147 + goto l154 } if !_rules[ruleFollowUpRef]() { - goto l147 + goto l154 } depth-- - add(ruleChainedRef, position148) + add(ruleChainedRef, position155) } return true - l147: - position, tokenIndex, depth = position147, tokenIndex147, depth147 + l154: + position, tokenIndex, depth = position154, tokenIndex154, depth154 return false }, - /* 34 ChainedDynRef <- <('.'? '[' Expression ']')> */ + /* 35 ChainedDynRef <- <('.'? '[' Expression ']')> */ func() bool { - position149, tokenIndex149, depth149 := position, tokenIndex, depth + position156, tokenIndex156, depth156 := position, tokenIndex, depth { - position150 := position + position157 := position depth++ { - position151, tokenIndex151, depth151 := position, tokenIndex, depth + position158, tokenIndex158, depth158 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l151 + goto l158 } position++ - goto l152 - l151: - position, tokenIndex, depth = position151, tokenIndex151, depth151 + goto l159 + l158: + position, tokenIndex, depth = position158, tokenIndex158, depth158 } - l152: + l159: if buffer[position] != rune('[') { - goto l149 + goto l156 } position++ if !_rules[ruleExpression]() { - goto l149 + goto l156 } if buffer[position] != rune(']') { - goto l149 + goto l156 } position++ depth-- - add(ruleChainedDynRef, position150) + add(ruleChainedDynRef, position157) } return true - l149: - position, tokenIndex, depth = position149, tokenIndex149, depth149 + l156: + position, tokenIndex, depth = position156, tokenIndex156, depth156 return false }, - /* 35 Slice <- */ + /* 36 Slice <- */ func() bool { - position153, tokenIndex153, depth153 := position, tokenIndex, depth + position160, tokenIndex160, depth160 := position, tokenIndex, depth { - position154 := position + position161 := position depth++ if !_rules[ruleRange]() { - goto l153 + goto l160 } depth-- - add(ruleSlice, position154) + add(ruleSlice, position161) } return true - l153: - position, tokenIndex, depth = position153, tokenIndex153, depth153 + l160: + position, tokenIndex, depth = position160, tokenIndex160, depth160 return false }, - /* 36 Currying <- <('*' ChainedCall)> */ + /* 37 Currying <- <('*' ChainedCall)> */ func() bool { - position155, tokenIndex155, depth155 := position, tokenIndex, depth + position162, tokenIndex162, depth162 := position, tokenIndex, depth { - position156 := position + position163 := position depth++ if buffer[position] != rune('*') { - goto l155 + goto l162 } position++ if !_rules[ruleChainedCall]() { - goto l155 + goto l162 } depth-- - add(ruleCurrying, position156) + add(ruleCurrying, position163) } return true - l155: - position, tokenIndex, depth = position155, tokenIndex155, depth155 + l162: + position, tokenIndex, depth = position162, tokenIndex162, depth162 return false }, - /* 37 ChainedCall <- <(StartArguments NameArgumentList? ')')> */ + /* 38 ChainedCall <- <(StartArguments NameArgumentList? ')')> */ func() bool { - position157, tokenIndex157, depth157 := position, tokenIndex, depth + position164, tokenIndex164, depth164 := position, tokenIndex, depth { - position158 := position + position165 := position depth++ if !_rules[ruleStartArguments]() { - goto l157 + goto l164 } { - position159, tokenIndex159, depth159 := position, tokenIndex, depth + position166, tokenIndex166, depth166 := position, tokenIndex, depth if !_rules[ruleNameArgumentList]() { - goto l159 + goto l166 } - goto l160 - l159: - position, tokenIndex, depth = position159, tokenIndex159, depth159 + goto l167 + l166: + position, tokenIndex, depth = position166, tokenIndex166, depth166 } - l160: + l167: if buffer[position] != rune(')') { - goto l157 + goto l164 } position++ depth-- - add(ruleChainedCall, position158) + add(ruleChainedCall, position165) } return true - l157: - position, tokenIndex, depth = position157, tokenIndex157, depth157 + l164: + position, tokenIndex, depth = position164, tokenIndex164, depth164 return false }, - /* 38 StartArguments <- <('(' ws)> */ + /* 39 StartArguments <- <('(' ws)> */ func() bool { - position161, tokenIndex161, depth161 := position, tokenIndex, depth + position168, tokenIndex168, depth168 := position, tokenIndex, depth { - position162 := position + position169 := position depth++ if buffer[position] != rune('(') { - goto l161 + goto l168 } position++ if !_rules[rulews]() { - goto l161 + goto l168 } depth-- - add(ruleStartArguments, position162) + add(ruleStartArguments, position169) } return true - l161: - position, tokenIndex, depth = position161, tokenIndex161, depth161 + l168: + position, tokenIndex, depth = position168, tokenIndex168, depth168 return false }, - /* 39 NameArgumentList <- <(((NextNameArgument (',' NextNameArgument)*) / NextExpression) (',' NextExpression)*)> */ + /* 40 NameArgumentList <- <(((NextNameArgument (',' NextNameArgument)*) / NextExpression) (',' NextExpression)*)> */ func() bool { - position163, tokenIndex163, depth163 := position, tokenIndex, depth + position170, tokenIndex170, depth170 := position, tokenIndex, depth { - position164 := position + position171 := position depth++ { - position165, tokenIndex165, depth165 := position, tokenIndex, depth + position172, tokenIndex172, depth172 := position, tokenIndex, depth if !_rules[ruleNextNameArgument]() { - goto l166 + goto l173 } - l167: + l174: { - position168, tokenIndex168, depth168 := position, tokenIndex, depth + position175, tokenIndex175, depth175 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l168 + goto l175 } position++ if !_rules[ruleNextNameArgument]() { - goto l168 + goto l175 } - goto l167 - l168: - position, tokenIndex, depth = position168, tokenIndex168, depth168 + goto l174 + l175: + position, tokenIndex, depth = position175, tokenIndex175, depth175 } - goto l165 - l166: - position, tokenIndex, depth = position165, tokenIndex165, depth165 + goto l172 + l173: + position, tokenIndex, depth = position172, tokenIndex172, depth172 if !_rules[ruleNextExpression]() { - goto l163 + goto l170 } } - l165: - l169: + l172: + l176: { - position170, tokenIndex170, depth170 := position, tokenIndex, depth + position177, tokenIndex177, depth177 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l170 + goto l177 } position++ if !_rules[ruleNextExpression]() { - goto l170 + goto l177 } - goto l169 - l170: - position, tokenIndex, depth = position170, tokenIndex170, depth170 + goto l176 + l177: + position, tokenIndex, depth = position177, tokenIndex177, depth177 } depth-- - add(ruleNameArgumentList, position164) + add(ruleNameArgumentList, position171) } return true - l163: - position, tokenIndex, depth = position163, tokenIndex163, depth163 + l170: + position, tokenIndex, depth = position170, tokenIndex170, depth170 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 + position178, tokenIndex178, depth178 := position, tokenIndex, depth { - position172 := position + position179 := position depth++ if !_rules[rulews]() { - goto l171 + goto l178 } if !_rules[ruleName]() { - goto l171 + goto l178 } if !_rules[rulews]() { - goto l171 + goto l178 } if buffer[position] != rune('=') { - goto l171 + goto l178 } position++ if !_rules[rulews]() { - goto l171 + goto l178 } if !_rules[ruleExpression]() { - goto l171 + goto l178 } if !_rules[rulews]() { - goto l171 + goto l178 } depth-- - add(ruleNextNameArgument, position172) + add(ruleNextNameArgument, position179) } return true - l171: - position, tokenIndex, depth = position171, tokenIndex171, depth171 + l178: + position, tokenIndex, depth = position178, tokenIndex178, depth178 return false }, - /* 41 ExpressionList <- <(NextExpression (',' NextExpression)*)> */ + /* 42 ExpressionList <- <(NextExpression (',' NextExpression)*)> */ func() bool { - position173, tokenIndex173, depth173 := position, tokenIndex, depth + position180, tokenIndex180, depth180 := position, tokenIndex, depth { - position174 := position + position181 := position depth++ if !_rules[ruleNextExpression]() { - goto l173 + goto l180 } - l175: + l182: { - position176, tokenIndex176, depth176 := position, tokenIndex, depth + position183, tokenIndex183, depth183 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l176 + goto l183 } position++ if !_rules[ruleNextExpression]() { - goto l176 + goto l183 } - goto l175 - l176: - position, tokenIndex, depth = position176, tokenIndex176, depth176 + goto l182 + l183: + position, tokenIndex, depth = position183, tokenIndex183, depth183 } depth-- - add(ruleExpressionList, position174) + add(ruleExpressionList, position181) } return true - l173: - position, tokenIndex, depth = position173, tokenIndex173, depth173 + l180: + position, tokenIndex, depth = position180, tokenIndex180, depth180 return false }, - /* 42 NextExpression <- <(Expression ListExpansion?)> */ + /* 43 NextExpression <- <(Expression ListExpansion?)> */ func() bool { - position177, tokenIndex177, depth177 := position, tokenIndex, depth + position184, tokenIndex184, depth184 := position, tokenIndex, depth { - position178 := position + position185 := position depth++ if !_rules[ruleExpression]() { - goto l177 + goto l184 } { - position179, tokenIndex179, depth179 := position, tokenIndex, depth + position186, tokenIndex186, depth186 := position, tokenIndex, depth if !_rules[ruleListExpansion]() { - goto l179 + goto l186 } - goto l180 - l179: - position, tokenIndex, depth = position179, tokenIndex179, depth179 + goto l187 + l186: + position, tokenIndex, depth = position186, tokenIndex186, depth186 } - l180: + l187: depth-- - add(ruleNextExpression, position178) + add(ruleNextExpression, position185) } return true - l177: - position, tokenIndex, depth = position177, tokenIndex177, depth177 + l184: + position, tokenIndex, depth = position184, tokenIndex184, depth184 return false }, - /* 43 ListExpansion <- <('.' '.' '.' ws)> */ + /* 44 ListExpansion <- <('.' '.' '.' ws)> */ func() bool { - position181, tokenIndex181, depth181 := position, tokenIndex, depth + position188, tokenIndex188, depth188 := position, tokenIndex, depth { - position182 := position + position189 := position depth++ if buffer[position] != rune('.') { - goto l181 + goto l188 } position++ if buffer[position] != rune('.') { - goto l181 + goto l188 } position++ if buffer[position] != rune('.') { - goto l181 + goto l188 } position++ if !_rules[rulews]() { - goto l181 + goto l188 } depth-- - add(ruleListExpansion, position182) + add(ruleListExpansion, position189) } return true - l181: - position, tokenIndex, depth = position181, tokenIndex181, depth181 + l188: + position, tokenIndex, depth = position188, tokenIndex188, depth188 return false }, - /* 44 Projection <- <('.'? (('[' '*' ']') / Slice) ProjectionValue ChainedQualifiedExpression*)> */ + /* 45 Projection <- <('.'? (('[' '*' ']') / Slice) ProjectionValue ChainedQualifiedExpression*)> */ func() bool { - position183, tokenIndex183, depth183 := position, tokenIndex, depth + position190, tokenIndex190, depth190 := position, tokenIndex, depth { - position184 := position + position191 := position depth++ { - position185, tokenIndex185, depth185 := position, tokenIndex, depth + position192, tokenIndex192, depth192 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l185 + goto l192 } position++ - goto l186 - l185: - position, tokenIndex, depth = position185, tokenIndex185, depth185 + goto l193 + l192: + position, tokenIndex, depth = position192, tokenIndex192, depth192 } - l186: + l193: { - position187, tokenIndex187, depth187 := position, tokenIndex, depth + position194, tokenIndex194, depth194 := position, tokenIndex, depth if buffer[position] != rune('[') { - goto l188 + goto l195 } position++ if buffer[position] != rune('*') { - goto l188 + goto l195 } position++ if buffer[position] != rune(']') { - goto l188 + goto l195 } position++ - goto l187 - l188: - position, tokenIndex, depth = position187, tokenIndex187, depth187 + goto l194 + l195: + position, tokenIndex, depth = position194, tokenIndex194, depth194 if !_rules[ruleSlice]() { - goto l183 + goto l190 } } - l187: + l194: if !_rules[ruleProjectionValue]() { - goto l183 + goto l190 } - l189: + l196: { - position190, tokenIndex190, depth190 := position, tokenIndex, depth + position197, tokenIndex197, depth197 := position, tokenIndex, depth if !_rules[ruleChainedQualifiedExpression]() { - goto l190 + goto l197 } - goto l189 - l190: - position, tokenIndex, depth = position190, tokenIndex190, depth190 + goto l196 + l197: + position, tokenIndex, depth = position197, tokenIndex197, depth197 } depth-- - add(ruleProjection, position184) + add(ruleProjection, position191) } return true - l183: - position, tokenIndex, depth = position183, tokenIndex183, depth183 + l190: + position, tokenIndex, depth = position190, tokenIndex190, depth190 return false }, - /* 45 ProjectionValue <- */ + /* 46 ProjectionValue <- */ func() bool { - position191, tokenIndex191, depth191 := position, tokenIndex, depth + position198, tokenIndex198, depth198 := position, tokenIndex, depth { - position192 := position + position199 := position depth++ if !_rules[ruleAction0]() { - goto l191 + goto l198 } depth-- - add(ruleProjectionValue, position192) + add(ruleProjectionValue, position199) } return true - l191: - position, tokenIndex, depth = position191, tokenIndex191, depth191 + l198: + position, tokenIndex, depth = position198, tokenIndex198, depth198 return false }, - /* 46 Substitution <- <('*' Level0)> */ + /* 47 Substitution <- <('*' Level0)> */ func() bool { - position193, tokenIndex193, depth193 := position, tokenIndex, depth + position200, tokenIndex200, depth200 := position, tokenIndex, depth { - position194 := position + position201 := position depth++ if buffer[position] != rune('*') { - goto l193 + goto l200 } position++ if !_rules[ruleLevel0]() { - goto l193 + goto l200 } depth-- - add(ruleSubstitution, position194) + add(ruleSubstitution, position201) } return true - l193: - position, tokenIndex, depth = position193, tokenIndex193, depth193 + l200: + position, tokenIndex, depth = position200, tokenIndex200, depth200 return false }, - /* 47 Not <- <('!' ws Level0)> */ + /* 48 Not <- <('!' ws Level0)> */ func() bool { - position195, tokenIndex195, depth195 := position, tokenIndex, depth + position202, tokenIndex202, depth202 := position, tokenIndex, depth { - position196 := position + position203 := position depth++ if buffer[position] != rune('!') { - goto l195 + goto l202 } position++ if !_rules[rulews]() { - goto l195 + goto l202 } if !_rules[ruleLevel0]() { - goto l195 + goto l202 } depth-- - add(ruleNot, position196) + add(ruleNot, position203) } return true - l195: - position, tokenIndex, depth = position195, tokenIndex195, depth195 + l202: + position, tokenIndex, depth = position202, tokenIndex202, depth202 return false }, - /* 48 Grouped <- <('(' Expression ')')> */ + /* 49 Grouped <- <('(' Expression ')')> */ func() bool { - position197, tokenIndex197, depth197 := position, tokenIndex, depth + position204, tokenIndex204, depth204 := position, tokenIndex, depth { - position198 := position + position205 := position depth++ if buffer[position] != rune('(') { - goto l197 + goto l204 } position++ if !_rules[ruleExpression]() { - goto l197 + goto l204 } if buffer[position] != rune(')') { - goto l197 + goto l204 } position++ depth-- - add(ruleGrouped, position198) + add(ruleGrouped, position205) } return true - l197: - position, tokenIndex, depth = position197, tokenIndex197, depth197 + l204: + position, tokenIndex, depth = position204, tokenIndex204, depth204 return false }, - /* 49 Range <- <(StartRange Expression? RangeOp Expression? ']')> */ + /* 50 Range <- <(StartRange Expression? RangeOp Expression? ']')> */ func() bool { - position199, tokenIndex199, depth199 := position, tokenIndex, depth + position206, tokenIndex206, depth206 := position, tokenIndex, depth { - position200 := position + position207 := position depth++ if !_rules[ruleStartRange]() { - goto l199 + goto l206 } { - position201, tokenIndex201, depth201 := position, tokenIndex, depth + position208, tokenIndex208, depth208 := position, tokenIndex, depth if !_rules[ruleExpression]() { - goto l201 + goto l208 } - goto l202 - l201: - position, tokenIndex, depth = position201, tokenIndex201, depth201 + goto l209 + l208: + position, tokenIndex, depth = position208, tokenIndex208, depth208 } - l202: + l209: if !_rules[ruleRangeOp]() { - goto l199 + goto l206 } { - position203, tokenIndex203, depth203 := position, tokenIndex, depth + position210, tokenIndex210, depth210 := position, tokenIndex, depth if !_rules[ruleExpression]() { - goto l203 + goto l210 } - goto l204 - l203: - position, tokenIndex, depth = position203, tokenIndex203, depth203 + goto l211 + l210: + position, tokenIndex, depth = position210, tokenIndex210, depth210 } - l204: + l211: if buffer[position] != rune(']') { - goto l199 + goto l206 } position++ depth-- - add(ruleRange, position200) + add(ruleRange, position207) } return true - l199: - position, tokenIndex, depth = position199, tokenIndex199, depth199 + l206: + position, tokenIndex, depth = position206, tokenIndex206, depth206 return false }, - /* 50 StartRange <- <'['> */ + /* 51 StartRange <- <'['> */ func() bool { - position205, tokenIndex205, depth205 := position, tokenIndex, depth + position212, tokenIndex212, depth212 := position, tokenIndex, depth { - position206 := position + position213 := position depth++ if buffer[position] != rune('[') { - goto l205 + goto l212 } position++ depth-- - add(ruleStartRange, position206) + add(ruleStartRange, position213) } return true - l205: - position, tokenIndex, depth = position205, tokenIndex205, depth205 + l212: + position, tokenIndex, depth = position212, tokenIndex212, depth212 return false }, - /* 51 RangeOp <- <('.' '.')> */ + /* 52 RangeOp <- <('.' '.')> */ func() bool { - position207, tokenIndex207, depth207 := position, tokenIndex, depth + position214, tokenIndex214, depth214 := position, tokenIndex, depth { - position208 := position + position215 := position depth++ if buffer[position] != rune('.') { - goto l207 + goto l214 } position++ if buffer[position] != rune('.') { - goto l207 + goto l214 } position++ depth-- - add(ruleRangeOp, position208) + add(ruleRangeOp, position215) } return true - l207: - position, tokenIndex, depth = position207, tokenIndex207, depth207 + l214: + position, tokenIndex, depth = position214, tokenIndex214, depth214 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 + position216, tokenIndex216, depth216 := position, tokenIndex, depth { - position210 := position + position217 := position depth++ { - position211, tokenIndex211, depth211 := position, tokenIndex, depth + position218, tokenIndex218, depth218 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l211 + goto l218 } position++ - goto l212 - l211: - position, tokenIndex, depth = position211, tokenIndex211, depth211 + goto l219 + l218: + position, tokenIndex, depth = position218, tokenIndex218, depth218 } - l212: + l219: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l209 + goto l216 } position++ - l213: + l220: { - position214, tokenIndex214, depth214 := position, tokenIndex, depth + position221, tokenIndex221, depth221 := position, tokenIndex, depth { - position215, tokenIndex215, depth215 := position, tokenIndex, depth + position222, tokenIndex222, depth222 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l216 + goto l223 } position++ - goto l215 - l216: - position, tokenIndex, depth = position215, tokenIndex215, depth215 + goto l222 + l223: + position, tokenIndex, depth = position222, tokenIndex222, depth222 if buffer[position] != rune('_') { - goto l214 + goto l221 } position++ } - l215: - goto l213 - l214: - position, tokenIndex, depth = position214, tokenIndex214, depth214 + l222: + goto l220 + l221: + position, tokenIndex, depth = position221, tokenIndex221, depth221 } { - position217, tokenIndex217, depth217 := position, tokenIndex, depth + position224, tokenIndex224, depth224 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l217 + goto l224 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l217 + goto l224 } position++ - l219: + l226: { - position220, tokenIndex220, depth220 := position, tokenIndex, depth + position227, tokenIndex227, depth227 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l220 + goto l227 } position++ - goto l219 - l220: - position, tokenIndex, depth = position220, tokenIndex220, depth220 + goto l226 + l227: + position, tokenIndex, depth = position227, tokenIndex227, depth227 } - goto l218 - l217: - position, tokenIndex, depth = position217, tokenIndex217, depth217 + goto l225 + l224: + position, tokenIndex, depth = position224, tokenIndex224, depth224 } - l218: + l225: { - position221, tokenIndex221, depth221 := position, tokenIndex, depth + position228, tokenIndex228, depth228 := position, tokenIndex, depth { - position223, tokenIndex223, depth223 := position, tokenIndex, depth + position230, tokenIndex230, depth230 := position, tokenIndex, depth if buffer[position] != rune('e') { - goto l224 + goto l231 } position++ - goto l223 - l224: - position, tokenIndex, depth = position223, tokenIndex223, depth223 + goto l230 + l231: + position, tokenIndex, depth = position230, tokenIndex230, depth230 if buffer[position] != rune('E') { - goto l221 + goto l228 } position++ } - l223: + l230: { - position225, tokenIndex225, depth225 := position, tokenIndex, depth + position232, tokenIndex232, depth232 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l225 + goto l232 } position++ - goto l226 - l225: - position, tokenIndex, depth = position225, tokenIndex225, depth225 + goto l233 + l232: + position, tokenIndex, depth = position232, tokenIndex232, depth232 } - l226: + l233: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l221 + goto l228 } position++ - l227: + l234: { - position228, tokenIndex228, depth228 := position, tokenIndex, depth + position235, tokenIndex235, depth235 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l228 + goto l235 } position++ - goto l227 - l228: - position, tokenIndex, depth = position228, tokenIndex228, depth228 + goto l234 + l235: + position, tokenIndex, depth = position235, tokenIndex235, depth235 } - goto l222 - l221: - position, tokenIndex, depth = position221, tokenIndex221, depth221 + goto l229 + l228: + position, tokenIndex, depth = position228, tokenIndex228, depth228 + } + l229: + { + position236, tokenIndex236, depth236 := position, tokenIndex, depth + if buffer[position] != rune(':') { + goto l236 + } + position++ + if buffer[position] != rune(':') { + goto l236 + } + position++ + goto l216 + l236: + position, tokenIndex, depth = position236, tokenIndex236, depth236 } - l222: depth-- - add(ruleNumber, position210) + add(ruleNumber, position217) } return true - l209: - position, tokenIndex, depth = position209, tokenIndex209, depth209 + l216: + position, tokenIndex, depth = position216, tokenIndex216, depth216 return false }, - /* 53 String <- <('"' (('\\' '"') / (!'"' .))* '"')> */ + /* 54 String <- <('"' (('\\' '"') / (!'"' .))* '"')> */ func() bool { - position229, tokenIndex229, depth229 := position, tokenIndex, depth + position237, tokenIndex237, depth237 := position, tokenIndex, depth { - position230 := position + position238 := position depth++ if buffer[position] != rune('"') { - goto l229 + goto l237 } position++ - l231: + l239: { - position232, tokenIndex232, depth232 := position, tokenIndex, depth + position240, tokenIndex240, depth240 := position, tokenIndex, depth { - position233, tokenIndex233, depth233 := position, tokenIndex, depth + position241, tokenIndex241, depth241 := position, tokenIndex, depth if buffer[position] != rune('\\') { - goto l234 + goto l242 } position++ if buffer[position] != rune('"') { - goto l234 + goto l242 } position++ - goto l233 - l234: - position, tokenIndex, depth = position233, tokenIndex233, depth233 + goto l241 + l242: + position, tokenIndex, depth = position241, tokenIndex241, depth241 { - position235, tokenIndex235, depth235 := position, tokenIndex, depth + position243, tokenIndex243, depth243 := position, tokenIndex, depth if buffer[position] != rune('"') { - goto l235 + goto l243 } position++ - goto l232 - l235: - position, tokenIndex, depth = position235, tokenIndex235, depth235 + goto l240 + l243: + position, tokenIndex, depth = position243, tokenIndex243, depth243 } if !matchDot() { - goto l232 + goto l240 } } - l233: - goto l231 - l232: - position, tokenIndex, depth = position232, tokenIndex232, depth232 + l241: + goto l239 + l240: + position, tokenIndex, depth = position240, tokenIndex240, depth240 } if buffer[position] != rune('"') { - goto l229 + goto l237 } position++ depth-- - add(ruleString, position230) + add(ruleString, position238) } return true - l229: - position, tokenIndex, depth = position229, tokenIndex229, depth229 + l237: + position, tokenIndex, depth = position237, tokenIndex237, depth237 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 + position244, tokenIndex244, depth244 := position, tokenIndex, depth { - position237 := position + position245 := position depth++ { - position238, tokenIndex238, depth238 := position, tokenIndex, depth + position246, tokenIndex246, depth246 := position, tokenIndex, depth if buffer[position] != rune('t') { - goto l239 + goto l247 } position++ if buffer[position] != rune('r') { - goto l239 + goto l247 } position++ if buffer[position] != rune('u') { - goto l239 + goto l247 } position++ if buffer[position] != rune('e') { - goto l239 + goto l247 } position++ - goto l238 - l239: - position, tokenIndex, depth = position238, tokenIndex238, depth238 + goto l246 + l247: + position, tokenIndex, depth = position246, tokenIndex246, depth246 if buffer[position] != rune('f') { - goto l236 + goto l244 } position++ if buffer[position] != rune('a') { - goto l236 + goto l244 } position++ if buffer[position] != rune('l') { - goto l236 + goto l244 } position++ if buffer[position] != rune('s') { - goto l236 + goto l244 } position++ if buffer[position] != rune('e') { - goto l236 + goto l244 } position++ } - l238: + l246: depth-- - add(ruleBoolean, position237) + add(ruleBoolean, position245) } return true - l236: - position, tokenIndex, depth = position236, tokenIndex236, depth236 + l244: + position, tokenIndex, depth = position244, tokenIndex244, depth244 return false }, - /* 55 Nil <- <(('n' 'i' 'l') / '~')> */ + /* 56 Nil <- <(('n' 'i' 'l') / '~')> */ func() bool { - position240, tokenIndex240, depth240 := position, tokenIndex, depth + position248, tokenIndex248, depth248 := position, tokenIndex, depth { - position241 := position + position249 := position depth++ { - position242, tokenIndex242, depth242 := position, tokenIndex, depth + position250, tokenIndex250, depth250 := position, tokenIndex, depth if buffer[position] != rune('n') { - goto l243 + goto l251 } position++ if buffer[position] != rune('i') { - goto l243 + goto l251 } position++ if buffer[position] != rune('l') { - goto l243 + goto l251 } position++ - goto l242 - l243: - position, tokenIndex, depth = position242, tokenIndex242, depth242 + goto l250 + l251: + position, tokenIndex, depth = position250, tokenIndex250, depth250 if buffer[position] != rune('~') { - goto l240 + goto l248 } position++ } - l242: + l250: depth-- - add(ruleNil, position241) + add(ruleNil, position249) } return true - l240: - position, tokenIndex, depth = position240, tokenIndex240, depth240 + l248: + position, tokenIndex, depth = position248, tokenIndex248, depth248 return false }, - /* 56 Undefined <- <('~' '~')> */ + /* 57 Undefined <- <('~' '~')> */ func() bool { - position244, tokenIndex244, depth244 := position, tokenIndex, depth + position252, tokenIndex252, depth252 := position, tokenIndex, depth { - position245 := position + position253 := position depth++ if buffer[position] != rune('~') { - goto l244 + goto l252 } position++ if buffer[position] != rune('~') { - goto l244 + goto l252 } position++ depth-- - add(ruleUndefined, position245) + add(ruleUndefined, position253) } return true - l244: - position, tokenIndex, depth = position244, tokenIndex244, depth244 + l252: + position, tokenIndex, depth = position252, tokenIndex252, depth252 return false }, - /* 57 Symbol <- <('$' Name)> */ + /* 58 Symbol <- <('$' Name)> */ func() bool { - position246, tokenIndex246, depth246 := position, tokenIndex, depth + position254, tokenIndex254, depth254 := position, tokenIndex, depth { - position247 := position + position255 := position depth++ if buffer[position] != rune('$') { - goto l246 + goto l254 } position++ if !_rules[ruleName]() { - goto l246 + goto l254 } depth-- - add(ruleSymbol, position247) + add(ruleSymbol, position255) } return true - l246: - position, tokenIndex, depth = position246, tokenIndex246, depth246 + l254: + position, tokenIndex, depth = position254, tokenIndex254, depth254 return false }, - /* 58 List <- <(StartList ExpressionList? ']')> */ + /* 59 List <- <(StartList ExpressionList? ']')> */ func() bool { - position248, tokenIndex248, depth248 := position, tokenIndex, depth + position256, tokenIndex256, depth256 := position, tokenIndex, depth { - position249 := position + position257 := position depth++ if !_rules[ruleStartList]() { - goto l248 + goto l256 } { - position250, tokenIndex250, depth250 := position, tokenIndex, depth + position258, tokenIndex258, depth258 := position, tokenIndex, depth if !_rules[ruleExpressionList]() { - goto l250 + goto l258 } - goto l251 - l250: - position, tokenIndex, depth = position250, tokenIndex250, depth250 + goto l259 + l258: + position, tokenIndex, depth = position258, tokenIndex258, depth258 } - l251: + l259: if buffer[position] != rune(']') { - goto l248 + goto l256 } position++ depth-- - add(ruleList, position249) + add(ruleList, position257) } return true - l248: - position, tokenIndex, depth = position248, tokenIndex248, depth248 + l256: + position, tokenIndex, depth = position256, tokenIndex256, depth256 return false }, - /* 59 StartList <- <('[' ws)> */ + /* 60 StartList <- <('[' ws)> */ func() bool { - position252, tokenIndex252, depth252 := position, tokenIndex, depth + position260, tokenIndex260, depth260 := position, tokenIndex, depth { - position253 := position + position261 := position depth++ if buffer[position] != rune('[') { - goto l252 + goto l260 } position++ if !_rules[rulews]() { - goto l252 + goto l260 } depth-- - add(ruleStartList, position253) + add(ruleStartList, position261) } return true - l252: - position, tokenIndex, depth = position252, tokenIndex252, depth252 + l260: + position, tokenIndex, depth = position260, tokenIndex260, depth260 return false }, - /* 60 Map <- <(CreateMap ws Assignments? '}')> */ + /* 61 Map <- <(CreateMap ws Assignments? '}')> */ func() bool { - position254, tokenIndex254, depth254 := position, tokenIndex, depth + position262, tokenIndex262, depth262 := position, tokenIndex, depth { - position255 := position + position263 := position depth++ if !_rules[ruleCreateMap]() { - goto l254 + goto l262 } if !_rules[rulews]() { - goto l254 + goto l262 } { - position256, tokenIndex256, depth256 := position, tokenIndex, depth + position264, tokenIndex264, depth264 := position, tokenIndex, depth if !_rules[ruleAssignments]() { - goto l256 + goto l264 } - goto l257 - l256: - position, tokenIndex, depth = position256, tokenIndex256, depth256 + goto l265 + l264: + position, tokenIndex, depth = position264, tokenIndex264, depth264 } - l257: + l265: if buffer[position] != rune('}') { - goto l254 + goto l262 } position++ depth-- - add(ruleMap, position255) + add(ruleMap, position263) } return true - l254: - position, tokenIndex, depth = position254, tokenIndex254, depth254 + l262: + position, tokenIndex, depth = position262, tokenIndex262, depth262 return false }, - /* 61 CreateMap <- <'{'> */ + /* 62 CreateMap <- <'{'> */ func() bool { - position258, tokenIndex258, depth258 := position, tokenIndex, depth + position266, tokenIndex266, depth266 := position, tokenIndex, depth { - position259 := position + position267 := position depth++ if buffer[position] != rune('{') { - goto l258 + goto l266 } position++ depth-- - add(ruleCreateMap, position259) + add(ruleCreateMap, position267) } return true - l258: - position, tokenIndex, depth = position258, tokenIndex258, depth258 + l266: + position, tokenIndex, depth = position266, tokenIndex266, depth266 return false }, - /* 62 Assignments <- <(Assignment (',' Assignment)*)> */ + /* 63 Assignments <- <(Assignment (',' Assignment)*)> */ func() bool { - position260, tokenIndex260, depth260 := position, tokenIndex, depth + position268, tokenIndex268, depth268 := position, tokenIndex, depth { - position261 := position + position269 := position depth++ if !_rules[ruleAssignment]() { - goto l260 + goto l268 } - l262: + l270: { - position263, tokenIndex263, depth263 := position, tokenIndex, depth + position271, tokenIndex271, depth271 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l263 + goto l271 } position++ if !_rules[ruleAssignment]() { - goto l263 + goto l271 } - goto l262 - l263: - position, tokenIndex, depth = position263, tokenIndex263, depth263 + goto l270 + l271: + position, tokenIndex, depth = position271, tokenIndex271, depth271 } depth-- - add(ruleAssignments, position261) + add(ruleAssignments, position269) } return true - l260: - position, tokenIndex, depth = position260, tokenIndex260, depth260 + l268: + position, tokenIndex, depth = position268, tokenIndex268, depth268 return false }, - /* 63 Assignment <- <(Expression '=' Expression)> */ + /* 64 Assignment <- <(Expression '=' Expression)> */ func() bool { - position264, tokenIndex264, depth264 := position, tokenIndex, depth + position272, tokenIndex272, depth272 := position, tokenIndex, depth { - position265 := position + position273 := position depth++ if !_rules[ruleExpression]() { - goto l264 + goto l272 } if buffer[position] != rune('=') { - goto l264 + goto l272 } position++ if !_rules[ruleExpression]() { - goto l264 + goto l272 } depth-- - add(ruleAssignment, position265) + add(ruleAssignment, position273) } return true - l264: - position, tokenIndex, depth = position264, tokenIndex264, depth264 + l272: + position, tokenIndex, depth = position272, tokenIndex272, depth272 return false }, - /* 64 Merge <- <(RefMerge / SimpleMerge)> */ + /* 65 Merge <- <(RefMerge / SimpleMerge)> */ func() bool { - position266, tokenIndex266, depth266 := position, tokenIndex, depth + position274, tokenIndex274, depth274 := position, tokenIndex, depth { - position267 := position + position275 := position depth++ { - position268, tokenIndex268, depth268 := position, tokenIndex, depth + position276, tokenIndex276, depth276 := position, tokenIndex, depth if !_rules[ruleRefMerge]() { - goto l269 + goto l277 } - goto l268 - l269: - position, tokenIndex, depth = position268, tokenIndex268, depth268 + goto l276 + l277: + position, tokenIndex, depth = position276, tokenIndex276, depth276 if !_rules[ruleSimpleMerge]() { - goto l266 + goto l274 } } - l268: + l276: depth-- - add(ruleMerge, position267) + add(ruleMerge, position275) } return true - l266: - position, tokenIndex, depth = position266, tokenIndex266, depth266 + l274: + position, tokenIndex, depth = position274, tokenIndex274, depth274 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 + position278, tokenIndex278, depth278 := position, tokenIndex, depth { - position271 := position + position279 := position depth++ if buffer[position] != rune('m') { - goto l270 + goto l278 } position++ if buffer[position] != rune('e') { - goto l270 + goto l278 } position++ if buffer[position] != rune('r') { - goto l270 + goto l278 } position++ if buffer[position] != rune('g') { - goto l270 + goto l278 } position++ if buffer[position] != rune('e') { - goto l270 + goto l278 } position++ { - position272, tokenIndex272, depth272 := position, tokenIndex, depth + position280, tokenIndex280, depth280 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l272 + goto l280 } if !_rules[ruleRequired]() { - goto l272 + goto l280 } - goto l270 - l272: - position, tokenIndex, depth = position272, tokenIndex272, depth272 + goto l278 + l280: + position, tokenIndex, depth = position280, tokenIndex280, depth280 } { - position273, tokenIndex273, depth273 := position, tokenIndex, depth + position281, tokenIndex281, depth281 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l273 + goto l281 } { - position275, tokenIndex275, depth275 := position, tokenIndex, depth + position283, tokenIndex283, depth283 := position, tokenIndex, depth if !_rules[ruleReplace]() { - goto l276 + goto l284 } - goto l275 - l276: - position, tokenIndex, depth = position275, tokenIndex275, depth275 + goto l283 + l284: + position, tokenIndex, depth = position283, tokenIndex283, depth283 if !_rules[ruleOn]() { - goto l273 + goto l281 } } - l275: - goto l274 - l273: - position, tokenIndex, depth = position273, tokenIndex273, depth273 + l283: + goto l282 + l281: + position, tokenIndex, depth = position281, tokenIndex281, depth281 } - l274: + l282: if !_rules[rulereq_ws]() { - goto l270 + goto l278 } if !_rules[ruleReference]() { - goto l270 + goto l278 } depth-- - add(ruleRefMerge, position271) + add(ruleRefMerge, position279) } return true - l270: - position, tokenIndex, depth = position270, tokenIndex270, depth270 + l278: + position, tokenIndex, depth = position278, tokenIndex278, depth278 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 + position285, tokenIndex285, depth285 := position, tokenIndex, depth { - position278 := position + position286 := position depth++ if buffer[position] != rune('m') { - goto l277 + goto l285 } position++ if buffer[position] != rune('e') { - goto l277 + goto l285 } position++ if buffer[position] != rune('r') { - goto l277 + goto l285 } position++ if buffer[position] != rune('g') { - goto l277 + goto l285 } position++ if buffer[position] != rune('e') { - goto l277 + goto l285 } position++ { - position279, tokenIndex279, depth279 := position, tokenIndex, depth + position287, tokenIndex287, depth287 := position, tokenIndex, depth if buffer[position] != rune('(') { - goto l279 + goto l287 } position++ - goto l277 - l279: - position, tokenIndex, depth = position279, tokenIndex279, depth279 + goto l285 + l287: + position, tokenIndex, depth = position287, tokenIndex287, depth287 } { - position280, tokenIndex280, depth280 := position, tokenIndex, depth + position288, tokenIndex288, depth288 := position, tokenIndex, depth if !_rules[rulereq_ws]() { - goto l280 + goto l288 } { - position282, tokenIndex282, depth282 := position, tokenIndex, depth + position290, tokenIndex290, depth290 := position, tokenIndex, depth if !_rules[ruleReplace]() { - goto l283 + goto l291 } - goto l282 - l283: - position, tokenIndex, depth = position282, tokenIndex282, depth282 + goto l290 + l291: + position, tokenIndex, depth = position290, tokenIndex290, depth290 if !_rules[ruleRequired]() { - goto l284 + goto l292 } - goto l282 - l284: - position, tokenIndex, depth = position282, tokenIndex282, depth282 + goto l290 + l292: + position, tokenIndex, depth = position290, tokenIndex290, depth290 if !_rules[ruleOn]() { - goto l280 + goto l288 } } - l282: - goto l281 - l280: - position, tokenIndex, depth = position280, tokenIndex280, depth280 + l290: + goto l289 + l288: + position, tokenIndex, depth = position288, tokenIndex288, depth288 } - l281: + l289: depth-- - add(ruleSimpleMerge, position278) + add(ruleSimpleMerge, position286) } return true - l277: - position, tokenIndex, depth = position277, tokenIndex277, depth277 + l285: + position, tokenIndex, depth = position285, tokenIndex285, depth285 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 + position293, tokenIndex293, depth293 := position, tokenIndex, depth { - position286 := position + position294 := position depth++ if buffer[position] != rune('r') { - goto l285 + goto l293 } position++ if buffer[position] != rune('e') { - goto l285 + goto l293 } position++ if buffer[position] != rune('p') { - goto l285 + goto l293 } position++ if buffer[position] != rune('l') { - goto l285 + goto l293 } position++ if buffer[position] != rune('a') { - goto l285 + goto l293 } position++ if buffer[position] != rune('c') { - goto l285 + goto l293 } position++ if buffer[position] != rune('e') { - goto l285 + goto l293 } position++ depth-- - add(ruleReplace, position286) + add(ruleReplace, position294) } return true - l285: - position, tokenIndex, depth = position285, tokenIndex285, depth285 + l293: + position, tokenIndex, depth = position293, tokenIndex293, depth293 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 + position295, tokenIndex295, depth295 := position, tokenIndex, depth { - position288 := position + position296 := position depth++ if buffer[position] != rune('r') { - goto l287 + goto l295 } position++ if buffer[position] != rune('e') { - goto l287 + goto l295 } position++ if buffer[position] != rune('q') { - goto l287 + goto l295 } position++ if buffer[position] != rune('u') { - goto l287 + goto l295 } position++ if buffer[position] != rune('i') { - goto l287 + goto l295 } position++ if buffer[position] != rune('r') { - goto l287 + goto l295 } position++ if buffer[position] != rune('e') { - goto l287 + goto l295 } position++ if buffer[position] != rune('d') { - goto l287 + goto l295 } position++ depth-- - add(ruleRequired, position288) + add(ruleRequired, position296) } return true - l287: - position, tokenIndex, depth = position287, tokenIndex287, depth287 + l295: + position, tokenIndex, depth = position295, tokenIndex295, depth295 return false }, - /* 69 On <- <('o' 'n' req_ws Name)> */ + /* 70 On <- <('o' 'n' req_ws Name)> */ func() bool { - position289, tokenIndex289, depth289 := position, tokenIndex, depth + position297, tokenIndex297, depth297 := position, tokenIndex, depth { - position290 := position + position298 := position depth++ if buffer[position] != rune('o') { - goto l289 + goto l297 } position++ if buffer[position] != rune('n') { - goto l289 + goto l297 } position++ if !_rules[rulereq_ws]() { - goto l289 + goto l297 } if !_rules[ruleName]() { - goto l289 + goto l297 } depth-- - add(ruleOn, position290) + add(ruleOn, position298) } return true - l289: - position, tokenIndex, depth = position289, tokenIndex289, depth289 + l297: + position, tokenIndex, depth = position297, tokenIndex297, depth297 return false }, - /* 70 Auto <- <('a' 'u' 't' 'o')> */ + /* 71 Auto <- <('a' 'u' 't' 'o')> */ func() bool { - position291, tokenIndex291, depth291 := position, tokenIndex, depth + position299, tokenIndex299, depth299 := position, tokenIndex, depth { - position292 := position + position300 := position depth++ if buffer[position] != rune('a') { - goto l291 + goto l299 } position++ if buffer[position] != rune('u') { - goto l291 + goto l299 } position++ if buffer[position] != rune('t') { - goto l291 + goto l299 } position++ if buffer[position] != rune('o') { - goto l291 + goto l299 } position++ depth-- - add(ruleAuto, position292) + add(ruleAuto, position300) } return true - l291: - position, tokenIndex, depth = position291, tokenIndex291, depth291 + l299: + position, tokenIndex, depth = position299, tokenIndex299, depth299 return false }, - /* 71 Default <- */ + /* 72 Default <- */ func() bool { - position293, tokenIndex293, depth293 := position, tokenIndex, depth + position301, tokenIndex301, depth301 := position, tokenIndex, depth { - position294 := position + position302 := position depth++ if !_rules[ruleAction1]() { - goto l293 + goto l301 } depth-- - add(ruleDefault, position294) + add(ruleDefault, position302) } return true - l293: - position, tokenIndex, depth = position293, tokenIndex293, depth293 + l301: + position, tokenIndex, depth = position301, tokenIndex301, depth301 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 + position303, tokenIndex303, depth303 := position, tokenIndex, depth { - position296 := position + position304 := position depth++ if buffer[position] != rune('s') { - goto l295 + goto l303 } position++ if buffer[position] != rune('y') { - goto l295 + goto l303 } position++ if buffer[position] != rune('n') { - goto l295 + goto l303 } position++ if buffer[position] != rune('c') { - goto l295 + goto l303 } position++ if buffer[position] != rune('[') { - goto l295 + goto l303 } position++ if !_rules[ruleLevel7]() { - goto l295 + goto l303 } { - position297, tokenIndex297, depth297 := position, tokenIndex, depth + position305, tokenIndex305, depth305 := position, tokenIndex, depth { - position299, tokenIndex299, depth299 := position, tokenIndex, depth + position307, tokenIndex307, depth307 := position, tokenIndex, depth if !_rules[ruleLambdaExpr]() { - goto l300 + goto l308 } if !_rules[ruleLambdaExt]() { - goto l300 + goto l308 } - goto l299 - l300: - position, tokenIndex, depth = position299, tokenIndex299, depth299 + goto l307 + l308: + position, tokenIndex, depth = position307, tokenIndex307, depth307 if !_rules[ruleLambdaOrExpr]() { - goto l298 + goto l306 } if !_rules[ruleLambdaOrExpr]() { - goto l298 + goto l306 } } - l299: + l307: { - position301, tokenIndex301, depth301 := position, tokenIndex, depth + position309, tokenIndex309, depth309 := position, tokenIndex, depth if buffer[position] != rune('|') { - goto l302 + goto l310 } position++ if !_rules[ruleExpression]() { - goto l302 + goto l310 } - goto l301 - l302: - position, tokenIndex, depth = position301, tokenIndex301, depth301 + goto l309 + l310: + position, tokenIndex, depth = position309, tokenIndex309, depth309 if !_rules[ruleDefault]() { - goto l298 + goto l306 } } - l301: - goto l297 - l298: - position, tokenIndex, depth = position297, tokenIndex297, depth297 + l309: + goto l305 + l306: + position, tokenIndex, depth = position305, tokenIndex305, depth305 if !_rules[ruleLambdaOrExpr]() { - goto l295 + goto l303 } if !_rules[ruleDefault]() { - goto l295 + goto l303 } if !_rules[ruleDefault]() { - goto l295 + goto l303 } } - l297: + l305: if buffer[position] != rune(']') { - goto l295 + goto l303 } position++ depth-- - add(ruleSync, position296) + add(ruleSync, position304) } return true - l295: - position, tokenIndex, depth = position295, tokenIndex295, depth295 + l303: + position, tokenIndex, depth = position303, tokenIndex303, depth303 return false }, - /* 73 LambdaExt <- <(',' Expression)> */ + /* 74 LambdaExt <- <(',' Expression)> */ func() bool { - position303, tokenIndex303, depth303 := position, tokenIndex, depth + position311, tokenIndex311, depth311 := position, tokenIndex, depth { - position304 := position + position312 := position depth++ if buffer[position] != rune(',') { - goto l303 + goto l311 } position++ if !_rules[ruleExpression]() { - goto l303 + goto l311 } depth-- - add(ruleLambdaExt, position304) + add(ruleLambdaExt, position312) } return true - l303: - position, tokenIndex, depth = position303, tokenIndex303, depth303 + l311: + position, tokenIndex, depth = position311, tokenIndex311, depth311 return false }, - /* 74 LambdaOrExpr <- <(LambdaExpr / ('|' Expression))> */ + /* 75 LambdaOrExpr <- <(LambdaExpr / ('|' Expression))> */ func() bool { - position305, tokenIndex305, depth305 := position, tokenIndex, depth + position313, tokenIndex313, depth313 := position, tokenIndex, depth { - position306 := position + position314 := position depth++ { - position307, tokenIndex307, depth307 := position, tokenIndex, depth + position315, tokenIndex315, depth315 := position, tokenIndex, depth if !_rules[ruleLambdaExpr]() { - goto l308 + goto l316 } - goto l307 - l308: - position, tokenIndex, depth = position307, tokenIndex307, depth307 + goto l315 + l316: + position, tokenIndex, depth = position315, tokenIndex315, depth315 if buffer[position] != rune('|') { - goto l305 + goto l313 } position++ if !_rules[ruleExpression]() { - goto l305 + goto l313 } } - l307: + l315: depth-- - add(ruleLambdaOrExpr, position306) + add(ruleLambdaOrExpr, position314) } return true - l305: - position, tokenIndex, depth = position305, tokenIndex305, depth305 - return false + l313: + position, tokenIndex, depth = position313, tokenIndex313, depth313 + 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 + position317, tokenIndex317, depth317 := position, tokenIndex, depth { - position310 := position + position318 := position depth++ if buffer[position] != rune('c') { - goto l309 + goto l317 } position++ if buffer[position] != rune('a') { - goto l309 + goto l317 } position++ if buffer[position] != rune('t') { - goto l309 + goto l317 } position++ if buffer[position] != rune('c') { - goto l309 + goto l317 } position++ if buffer[position] != rune('h') { - goto l309 + goto l317 } position++ if buffer[position] != rune('[') { - goto l309 + goto l317 } position++ if !_rules[ruleLevel7]() { - goto l309 + goto l317 } if !_rules[ruleLambdaOrExpr]() { - goto l309 + goto l317 } if buffer[position] != rune(']') { - goto l309 + goto l317 } position++ depth-- - add(ruleCatch, position310) + add(ruleCatch, position318) } return true - l309: - position, tokenIndex, depth = position309, tokenIndex309, depth309 + l317: + position, tokenIndex, depth = position317, tokenIndex317, depth317 return false }, - /* 76 MapMapping <- <('m' 'a' 'p' '{' Level7 LambdaOrExpr '}')> */ + /* 77 MapMapping <- <('m' 'a' 'p' '{' Level7 LambdaOrExpr '}')> */ func() bool { - position311, tokenIndex311, depth311 := position, tokenIndex, depth + position319, tokenIndex319, depth319 := position, tokenIndex, depth { - position312 := position + position320 := position depth++ if buffer[position] != rune('m') { - goto l311 + goto l319 } position++ if buffer[position] != rune('a') { - goto l311 + goto l319 } position++ if buffer[position] != rune('p') { - goto l311 + goto l319 } position++ if buffer[position] != rune('{') { - goto l311 + goto l319 } position++ if !_rules[ruleLevel7]() { - goto l311 + goto l319 } if !_rules[ruleLambdaOrExpr]() { - goto l311 + goto l319 } if buffer[position] != rune('}') { - goto l311 + goto l319 } position++ depth-- - add(ruleMapMapping, position312) + add(ruleMapMapping, position320) } return true - l311: - position, tokenIndex, depth = position311, tokenIndex311, depth311 + l319: + position, tokenIndex, depth = position319, tokenIndex319, depth319 return false }, - /* 77 Mapping <- <('m' 'a' 'p' '[' Level7 LambdaOrExpr ']')> */ + /* 78 Mapping <- <('m' 'a' 'p' '[' Level7 LambdaOrExpr ']')> */ func() bool { - position313, tokenIndex313, depth313 := position, tokenIndex, depth + position321, tokenIndex321, depth321 := position, tokenIndex, depth { - position314 := position + position322 := position depth++ if buffer[position] != rune('m') { - goto l313 + goto l321 } position++ if buffer[position] != rune('a') { - goto l313 + goto l321 } position++ if buffer[position] != rune('p') { - goto l313 + goto l321 } position++ if buffer[position] != rune('[') { - goto l313 + goto l321 } position++ if !_rules[ruleLevel7]() { - goto l313 + goto l321 } if !_rules[ruleLambdaOrExpr]() { - goto l313 + goto l321 } if buffer[position] != rune(']') { - goto l313 + goto l321 } position++ depth-- - add(ruleMapping, position314) + add(ruleMapping, position322) } return true - l313: - position, tokenIndex, depth = position313, tokenIndex313, depth313 + l321: + position, tokenIndex, depth = position321, tokenIndex321, depth321 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 + position323, tokenIndex323, depth323 := position, tokenIndex, depth { - position316 := position + position324 := position depth++ if buffer[position] != rune('s') { - goto l315 + goto l323 } position++ if buffer[position] != rune('e') { - goto l315 + goto l323 } position++ if buffer[position] != rune('l') { - goto l315 + goto l323 } position++ if buffer[position] != rune('e') { - goto l315 + goto l323 } position++ if buffer[position] != rune('c') { - goto l315 + goto l323 } position++ if buffer[position] != rune('t') { - goto l315 + goto l323 } position++ if buffer[position] != rune('{') { - goto l315 + goto l323 } position++ if !_rules[ruleLevel7]() { - goto l315 + goto l323 } if !_rules[ruleLambdaOrExpr]() { - goto l315 + goto l323 } if buffer[position] != rune('}') { - goto l315 + goto l323 } position++ depth-- - add(ruleMapSelection, position316) + add(ruleMapSelection, position324) } return true - l315: - position, tokenIndex, depth = position315, tokenIndex315, depth315 + l323: + position, tokenIndex, depth = position323, tokenIndex323, depth323 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 + position325, tokenIndex325, depth325 := position, tokenIndex, depth { - position318 := position + position326 := position depth++ if buffer[position] != rune('s') { - goto l317 + goto l325 } position++ if buffer[position] != rune('e') { - goto l317 + goto l325 } position++ if buffer[position] != rune('l') { - goto l317 + goto l325 } position++ if buffer[position] != rune('e') { - goto l317 + goto l325 } position++ if buffer[position] != rune('c') { - goto l317 + goto l325 } position++ if buffer[position] != rune('t') { - goto l317 + goto l325 } position++ if buffer[position] != rune('[') { - goto l317 + goto l325 } position++ if !_rules[ruleLevel7]() { - goto l317 + goto l325 } if !_rules[ruleLambdaOrExpr]() { - goto l317 + goto l325 } if buffer[position] != rune(']') { - goto l317 + goto l325 } position++ depth-- - add(ruleSelection, position318) + add(ruleSelection, position326) } return true - l317: - position, tokenIndex, depth = position317, tokenIndex317, depth317 + l325: + position, tokenIndex, depth = position325, tokenIndex325, depth325 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 + position327, tokenIndex327, depth327 := position, tokenIndex, depth { - position320 := position + position328 := position depth++ if buffer[position] != rune('s') { - goto l319 + goto l327 } position++ if buffer[position] != rune('u') { - goto l319 + goto l327 } position++ if buffer[position] != rune('m') { - goto l319 + goto l327 } position++ if buffer[position] != rune('[') { - goto l319 + goto l327 } position++ if !_rules[ruleLevel7]() { - goto l319 + goto l327 } if buffer[position] != rune('|') { - goto l319 + goto l327 } position++ if !_rules[ruleLevel7]() { - goto l319 + goto l327 } if !_rules[ruleLambdaOrExpr]() { - goto l319 + goto l327 } if buffer[position] != rune(']') { - goto l319 + goto l327 } position++ depth-- - add(ruleSum, position320) + add(ruleSum, position328) } return true - l319: - position, tokenIndex, depth = position319, tokenIndex319, depth319 + l327: + position, tokenIndex, depth = position327, tokenIndex327, depth327 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 + position329, tokenIndex329, depth329 := position, tokenIndex, depth { - position322 := position + position330 := position depth++ if buffer[position] != rune('l') { - goto l321 + goto l329 } position++ if buffer[position] != rune('a') { - goto l321 + goto l329 } position++ if buffer[position] != rune('m') { - goto l321 + goto l329 } position++ if buffer[position] != rune('b') { - goto l321 + goto l329 } position++ if buffer[position] != rune('d') { - goto l321 + goto l329 } position++ if buffer[position] != rune('a') { - goto l321 + goto l329 } position++ { - position323, tokenIndex323, depth323 := position, tokenIndex, depth + position331, tokenIndex331, depth331 := position, tokenIndex, depth if !_rules[ruleLambdaRef]() { - goto l324 + goto l332 } - goto l323 - l324: - position, tokenIndex, depth = position323, tokenIndex323, depth323 + goto l331 + l332: + position, tokenIndex, depth = position331, tokenIndex331, depth331 if !_rules[ruleLambdaExpr]() { - goto l321 + goto l329 } } - l323: + l331: depth-- - add(ruleLambda, position322) + add(ruleLambda, position330) } return true - l321: - position, tokenIndex, depth = position321, tokenIndex321, depth321 + l329: + position, tokenIndex, depth = position329, tokenIndex329, depth329 return false }, - /* 82 LambdaRef <- <(req_ws Expression)> */ + /* 83 LambdaRef <- <(req_ws Expression)> */ func() bool { - position325, tokenIndex325, depth325 := position, tokenIndex, depth + position333, tokenIndex333, depth333 := position, tokenIndex, depth { - position326 := position + position334 := position depth++ if !_rules[rulereq_ws]() { - goto l325 + goto l333 } if !_rules[ruleExpression]() { - goto l325 + goto l333 } depth-- - add(ruleLambdaRef, position326) + add(ruleLambdaRef, position334) } return true - l325: - position, tokenIndex, depth = position325, tokenIndex325, depth325 + l333: + position, tokenIndex, depth = position333, tokenIndex333, depth333 return false }, - /* 83 LambdaExpr <- <(ws Params ws ('-' '>') Expression)> */ + /* 84 LambdaExpr <- <(ws Params ws ('-' '>') Expression)> */ func() bool { - position327, tokenIndex327, depth327 := position, tokenIndex, depth + position335, tokenIndex335, depth335 := position, tokenIndex, depth { - position328 := position + position336 := position depth++ if !_rules[rulews]() { - goto l327 + goto l335 } if !_rules[ruleParams]() { - goto l327 + goto l335 } if !_rules[rulews]() { - goto l327 + goto l335 } if buffer[position] != rune('-') { - goto l327 + goto l335 } position++ if buffer[position] != rune('>') { - goto l327 + goto l335 } position++ if !_rules[ruleExpression]() { - goto l327 + goto l335 } depth-- - add(ruleLambdaExpr, position328) + add(ruleLambdaExpr, position336) } return true - l327: - position, tokenIndex, depth = position327, tokenIndex327, depth327 + l335: + position, tokenIndex, depth = position335, tokenIndex335, depth335 return false }, - /* 84 Params <- <('|' StartParams ws Names? '|')> */ + /* 85 Params <- <('|' StartParams ws Names? '|')> */ func() bool { - position329, tokenIndex329, depth329 := position, tokenIndex, depth + position337, tokenIndex337, depth337 := position, tokenIndex, depth { - position330 := position + position338 := position depth++ if buffer[position] != rune('|') { - goto l329 + goto l337 } position++ if !_rules[ruleStartParams]() { - goto l329 + goto l337 } if !_rules[rulews]() { - goto l329 + goto l337 } { - position331, tokenIndex331, depth331 := position, tokenIndex, depth + position339, tokenIndex339, depth339 := position, tokenIndex, depth if !_rules[ruleNames]() { - goto l331 + goto l339 } - goto l332 - l331: - position, tokenIndex, depth = position331, tokenIndex331, depth331 + goto l340 + l339: + position, tokenIndex, depth = position339, tokenIndex339, depth339 } - l332: + l340: if buffer[position] != rune('|') { - goto l329 + goto l337 } position++ depth-- - add(ruleParams, position330) + add(ruleParams, position338) } return true - l329: - position, tokenIndex, depth = position329, tokenIndex329, depth329 + l337: + position, tokenIndex, depth = position337, tokenIndex337, depth337 return false }, - /* 85 StartParams <- */ + /* 86 StartParams <- */ func() bool { - position333, tokenIndex333, depth333 := position, tokenIndex, depth + position341, tokenIndex341, depth341 := position, tokenIndex, depth { - position334 := position + position342 := position depth++ if !_rules[ruleAction2]() { - goto l333 + goto l341 } depth-- - add(ruleStartParams, position334) + add(ruleStartParams, position342) } return true - l333: - position, tokenIndex, depth = position333, tokenIndex333, depth333 + l341: + position, tokenIndex, depth = position341, tokenIndex341, depth341 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 + position343, tokenIndex343, depth343 := position, tokenIndex, depth { - position336 := position + position344 := position depth++ if !_rules[ruleNextName]() { - goto l335 + goto l343 } - l337: + l345: { - position338, tokenIndex338, depth338 := position, tokenIndex, depth + position346, tokenIndex346, depth346 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l338 + goto l346 } position++ if !_rules[ruleNextName]() { - goto l338 + goto l346 } - goto l337 - l338: - position, tokenIndex, depth = position338, tokenIndex338, depth338 + goto l345 + l346: + position, tokenIndex, depth = position346, tokenIndex346, depth346 } { - position339, tokenIndex339, depth339 := position, tokenIndex, depth + position347, tokenIndex347, depth347 := position, tokenIndex, depth if !_rules[ruleDefaultValue]() { - goto l339 + goto l347 } - goto l340 - l339: - position, tokenIndex, depth = position339, tokenIndex339, depth339 + goto l348 + l347: + position, tokenIndex, depth = position347, tokenIndex347, depth347 } - l340: - l341: + l348: + l349: { - position342, tokenIndex342, depth342 := position, tokenIndex, depth + position350, tokenIndex350, depth350 := position, tokenIndex, depth if buffer[position] != rune(',') { - goto l342 + goto l350 } position++ if !_rules[ruleNextName]() { - goto l342 + goto l350 } if !_rules[ruleDefaultValue]() { - goto l342 + goto l350 } - goto l341 - l342: - position, tokenIndex, depth = position342, tokenIndex342, depth342 + goto l349 + l350: + position, tokenIndex, depth = position350, tokenIndex350, depth350 } { - position343, tokenIndex343, depth343 := position, tokenIndex, depth + position351, tokenIndex351, depth351 := position, tokenIndex, depth if !_rules[ruleVarParams]() { - goto l343 + goto l351 } - goto l344 - l343: - position, tokenIndex, depth = position343, tokenIndex343, depth343 + goto l352 + l351: + position, tokenIndex, depth = position351, tokenIndex351, depth351 } - l344: + l352: depth-- - add(ruleNames, position336) + add(ruleNames, position344) } return true - l335: - position, tokenIndex, depth = position335, tokenIndex335, depth335 + l343: + position, tokenIndex, depth = position343, tokenIndex343, depth343 return false }, - /* 87 NextName <- <(ws Name ws)> */ + /* 88 NextName <- <(ws Name ws)> */ func() bool { - position345, tokenIndex345, depth345 := position, tokenIndex, depth + position353, tokenIndex353, depth353 := position, tokenIndex, depth { - position346 := position + position354 := position depth++ if !_rules[rulews]() { - goto l345 + goto l353 } if !_rules[ruleName]() { - goto l345 + goto l353 } if !_rules[rulews]() { - goto l345 + goto l353 } depth-- - add(ruleNextName, position346) + add(ruleNextName, position354) } return true - l345: - position, tokenIndex, depth = position345, tokenIndex345, depth345 + l353: + position, tokenIndex, depth = position353, tokenIndex353, depth353 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 + position355, tokenIndex355, depth355 := position, tokenIndex, depth { - position348 := position + position356 := position depth++ { - position351, tokenIndex351, depth351 := position, tokenIndex, depth + position359, tokenIndex359, depth359 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l352 + goto l360 } position++ - goto l351 - l352: - position, tokenIndex, depth = position351, tokenIndex351, depth351 + goto l359 + l360: + position, tokenIndex, depth = position359, tokenIndex359, depth359 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l353 + goto l361 } position++ - goto l351 - l353: - position, tokenIndex, depth = position351, tokenIndex351, depth351 + goto l359 + l361: + position, tokenIndex, depth = position359, tokenIndex359, depth359 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l354 + goto l362 } position++ - goto l351 - l354: - position, tokenIndex, depth = position351, tokenIndex351, depth351 + goto l359 + l362: + position, tokenIndex, depth = position359, tokenIndex359, depth359 if buffer[position] != rune('_') { - goto l347 + goto l355 } position++ } - l351: - l349: + l359: + l357: { - position350, tokenIndex350, depth350 := position, tokenIndex, depth + position358, tokenIndex358, depth358 := position, tokenIndex, depth { - position355, tokenIndex355, depth355 := position, tokenIndex, depth + position363, tokenIndex363, depth363 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l356 + goto l364 } position++ - goto l355 - l356: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l363 + l364: + position, tokenIndex, depth = position363, tokenIndex363, depth363 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l357 + goto l365 } position++ - goto l355 - l357: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l363 + l365: + position, tokenIndex, depth = position363, tokenIndex363, depth363 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l358 + goto l366 } position++ - goto l355 - l358: - position, tokenIndex, depth = position355, tokenIndex355, depth355 + goto l363 + l366: + position, tokenIndex, depth = position363, tokenIndex363, depth363 if buffer[position] != rune('_') { - goto l350 + goto l358 } position++ } - l355: - goto l349 - l350: - position, tokenIndex, depth = position350, tokenIndex350, depth350 + l363: + goto l357 + l358: + position, tokenIndex, depth = position358, tokenIndex358, depth358 } depth-- - add(ruleName, position348) + add(ruleName, position356) } return true - l347: - position, tokenIndex, depth = position347, tokenIndex347, depth347 + l355: + position, tokenIndex, depth = position355, tokenIndex355, depth355 return false }, - /* 89 DefaultValue <- <('=' Expression)> */ + /* 90 DefaultValue <- <('=' Expression)> */ func() bool { - position359, tokenIndex359, depth359 := position, tokenIndex, depth + position367, tokenIndex367, depth367 := position, tokenIndex, depth { - position360 := position + position368 := position depth++ if buffer[position] != rune('=') { - goto l359 + goto l367 } position++ if !_rules[ruleExpression]() { - goto l359 + goto l367 } depth-- - add(ruleDefaultValue, position360) + add(ruleDefaultValue, position368) } return true - l359: - position, tokenIndex, depth = position359, tokenIndex359, depth359 + l367: + position, tokenIndex, depth = position367, tokenIndex367, depth367 return false }, - /* 90 VarParams <- <('.' '.' '.' ws)> */ + /* 91 VarParams <- <('.' '.' '.' ws)> */ func() bool { - position361, tokenIndex361, depth361 := position, tokenIndex, depth + position369, tokenIndex369, depth369 := position, tokenIndex, depth { - position362 := position + position370 := position depth++ if buffer[position] != rune('.') { - goto l361 + goto l369 } position++ if buffer[position] != rune('.') { - goto l361 + goto l369 } position++ if buffer[position] != rune('.') { - goto l361 + goto l369 } position++ if !_rules[rulews]() { - goto l361 + goto l369 } depth-- - add(ruleVarParams, position362) + add(ruleVarParams, position370) } return true - l361: - position, tokenIndex, depth = position361, tokenIndex361, depth361 + l369: + position, tokenIndex, depth = position369, tokenIndex369, depth369 return false }, - /* 91 Reference <- <('.'? Key FollowUpRef)> */ + /* 92 Reference <- <(((Tag ('.' / Key)) / ('.'? Key)) FollowUpRef)> */ func() bool { - position363, tokenIndex363, depth363 := position, tokenIndex, depth + position371, tokenIndex371, depth371 := position, tokenIndex, depth { - position364 := position + position372 := position depth++ { - position365, tokenIndex365, depth365 := position, tokenIndex, depth - if buffer[position] != rune('.') { - goto l365 + position373, tokenIndex373, depth373 := position, tokenIndex, depth + if !_rules[ruleTag]() { + goto l374 + } + { + position375, tokenIndex375, depth375 := position, tokenIndex, depth + if buffer[position] != rune('.') { + goto l376 + } + position++ + goto l375 + l376: + position, tokenIndex, depth = position375, tokenIndex375, depth375 + if !_rules[ruleKey]() { + goto l374 + } + } + l375: + goto l373 + l374: + position, tokenIndex, depth = position373, tokenIndex373, depth373 + { + position377, tokenIndex377, depth377 := position, tokenIndex, depth + if buffer[position] != rune('.') { + goto l377 + } + position++ + goto l378 + l377: + position, tokenIndex, depth = position377, tokenIndex377, depth377 + } + l378: + if !_rules[ruleKey]() { + goto l371 + } + } + l373: + if !_rules[ruleFollowUpRef]() { + goto l371 + } + depth-- + add(ruleReference, position372) + } + return true + l371: + position, tokenIndex, depth = position371, tokenIndex371, depth371 + return false + }, + /* 93 Tag <- <((('d' 'o' 'c' ':' '-'? [0-9]+) / (TagName (':' TagName)*)) (':' ':'))> */ + func() bool { + position379, tokenIndex379, depth379 := position, tokenIndex, depth + { + position380 := position + depth++ + { + position381, tokenIndex381, depth381 := position, tokenIndex, depth + if buffer[position] != rune('d') { + goto l382 + } + position++ + if buffer[position] != rune('o') { + goto l382 + } + position++ + if buffer[position] != rune('c') { + goto l382 + } + position++ + if buffer[position] != rune(':') { + goto l382 } position++ - goto l366 - l365: - position, tokenIndex, depth = position365, tokenIndex365, depth365 + { + position383, tokenIndex383, depth383 := position, tokenIndex, depth + if buffer[position] != rune('-') { + goto l383 + } + position++ + goto l384 + l383: + position, tokenIndex, depth = position383, tokenIndex383, depth383 + } + l384: + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l382 + } + position++ + l385: + { + position386, tokenIndex386, depth386 := position, tokenIndex, depth + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l386 + } + position++ + 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 + } } - l366: - if !_rules[ruleKey]() { - goto l363 + l381: + if buffer[position] != rune(':') { + goto l379 } - if !_rules[ruleFollowUpRef]() { - goto l363 + position++ + if buffer[position] != rune(':') { + goto l379 } + position++ depth-- - add(ruleReference, position364) + add(ruleTag, position380) } return true - l363: - position, tokenIndex, depth = position363, tokenIndex363, depth363 + l379: + position, tokenIndex, depth = position379, tokenIndex379, depth379 return false }, - /* 92 FollowUpRef <- */ + /* 94 TagName <- <(([a-z] / [A-Z] / '_') ([a-z] / [A-Z] / [0-9] / '_')*)> */ func() bool { + position389, tokenIndex389, depth389 := position, tokenIndex, depth { - position368 := position + position390 := position + depth++ + { + position391, tokenIndex391, depth391 := position, tokenIndex, depth + if c := buffer[position]; c < rune('a') || c > rune('z') { + goto l392 + } + position++ + goto l391 + l392: + position, tokenIndex, depth = position391, tokenIndex391, depth391 + if c := buffer[position]; c < rune('A') || c > rune('Z') { + goto l393 + } + position++ + goto l391 + l393: + position, tokenIndex, depth = position391, tokenIndex391, depth391 + if buffer[position] != rune('_') { + goto l389 + } + position++ + } + l391: + l394: + { + position395, tokenIndex395, depth395 := position, tokenIndex, depth + { + position396, tokenIndex396, depth396 := position, tokenIndex, depth + if c := buffer[position]; c < rune('a') || c > rune('z') { + goto l397 + } + position++ + goto l396 + l397: + position, tokenIndex, depth = position396, tokenIndex396, depth396 + if c := buffer[position]; c < rune('A') || c > rune('Z') { + goto l398 + } + position++ + goto l396 + l398: + position, tokenIndex, depth = position396, tokenIndex396, depth396 + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l399 + } + position++ + goto l396 + l399: + position, tokenIndex, depth = position396, tokenIndex396, depth396 + if buffer[position] != rune('_') { + goto l395 + } + position++ + } + l396: + goto l394 + l395: + position, tokenIndex, depth = position395, tokenIndex395, depth395 + } + depth-- + add(ruleTagName, position390) + } + return true + l389: + position, tokenIndex, depth = position389, tokenIndex389, depth389 + return false + }, + /* 95 FollowUpRef <- */ + func() bool { + { + position401 := position depth++ - l369: + l402: { - position370, tokenIndex370, depth370 := position, tokenIndex, depth + position403, tokenIndex403, depth403 := position, tokenIndex, depth if !_rules[rulePathComponent]() { - goto l370 + goto l403 } - goto l369 - l370: - position, tokenIndex, depth = position370, tokenIndex370, depth370 + goto l402 + l403: + position, tokenIndex, depth = position403, tokenIndex403, depth403 } depth-- - add(ruleFollowUpRef, position368) + add(ruleFollowUpRef, position401) } return true }, - /* 93 PathComponent <- <(('.' Key) / ('.'? Index))> */ + /* 96 PathComponent <- <(('.' Key) / ('.'? Index))> */ func() bool { - position371, tokenIndex371, depth371 := position, tokenIndex, depth + position404, tokenIndex404, depth404 := position, tokenIndex, depth { - position372 := position + position405 := position depth++ { - position373, tokenIndex373, depth373 := position, tokenIndex, depth + position406, tokenIndex406, depth406 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l374 + goto l407 } position++ if !_rules[ruleKey]() { - goto l374 + goto l407 } - goto l373 - l374: - position, tokenIndex, depth = position373, tokenIndex373, depth373 + goto l406 + l407: + position, tokenIndex, depth = position406, tokenIndex406, depth406 { - position375, tokenIndex375, depth375 := position, tokenIndex, depth + position408, tokenIndex408, depth408 := position, tokenIndex, depth if buffer[position] != rune('.') { - goto l375 + goto l408 } position++ - goto l376 - l375: - position, tokenIndex, depth = position375, tokenIndex375, depth375 + goto l409 + l408: + position, tokenIndex, depth = position408, tokenIndex408, depth408 } - l376: + l409: if !_rules[ruleIndex]() { - goto l371 + goto l404 } } - l373: + l406: depth-- - add(rulePathComponent, position372) + add(rulePathComponent, position405) } return true - l371: - position, tokenIndex, depth = position371, tokenIndex371, depth371 + l404: + position, tokenIndex, depth = position404, tokenIndex404, depth404 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 + position410, tokenIndex410, depth410 := position, tokenIndex, depth { - position378 := position + position411 := position depth++ { - position379, tokenIndex379, depth379 := position, tokenIndex, depth + position412, tokenIndex412, depth412 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l380 + goto l413 } position++ - goto l379 - l380: - position, tokenIndex, depth = position379, tokenIndex379, depth379 + goto l412 + l413: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l381 + goto l414 } position++ - goto l379 - l381: - position, tokenIndex, depth = position379, tokenIndex379, depth379 + goto l412 + l414: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l382 + goto l415 } position++ - goto l379 - l382: - position, tokenIndex, depth = position379, tokenIndex379, depth379 + goto l412 + l415: + position, tokenIndex, depth = position412, tokenIndex412, depth412 if buffer[position] != rune('_') { - goto l377 + goto l410 } position++ } - l379: - l383: + l412: + l416: { - position384, tokenIndex384, depth384 := position, tokenIndex, depth + position417, tokenIndex417, depth417 := position, tokenIndex, depth { - position385, tokenIndex385, depth385 := position, tokenIndex, depth + position418, tokenIndex418, depth418 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l386 + goto l419 } position++ - goto l385 - l386: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l418 + l419: + position, tokenIndex, depth = position418, tokenIndex418, depth418 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l387 + goto l420 } position++ - goto l385 - l387: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l418 + l420: + position, tokenIndex, depth = position418, tokenIndex418, depth418 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l388 + goto l421 } position++ - goto l385 - l388: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l418 + l421: + position, tokenIndex, depth = position418, tokenIndex418, depth418 if buffer[position] != rune('_') { - goto l389 + goto l422 } position++ - goto l385 - l389: - position, tokenIndex, depth = position385, tokenIndex385, depth385 + goto l418 + l422: + position, tokenIndex, depth = position418, tokenIndex418, depth418 if buffer[position] != rune('-') { - goto l384 + goto l417 } position++ } - l385: - goto l383 - l384: - position, tokenIndex, depth = position384, tokenIndex384, depth384 + l418: + goto l416 + l417: + position, tokenIndex, depth = position417, tokenIndex417, depth417 } { - position390, tokenIndex390, depth390 := position, tokenIndex, depth + position423, tokenIndex423, depth423 := position, tokenIndex, depth if buffer[position] != rune(':') { - goto l390 + goto l423 } position++ { - position392, tokenIndex392, depth392 := position, tokenIndex, depth + position425, tokenIndex425, depth425 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l393 + goto l426 } position++ - goto l392 - l393: - position, tokenIndex, depth = position392, tokenIndex392, depth392 + goto l425 + l426: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l394 + goto l427 } position++ - goto l392 - l394: - position, tokenIndex, depth = position392, tokenIndex392, depth392 + goto l425 + l427: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l395 + goto l428 } position++ - goto l392 - l395: - position, tokenIndex, depth = position392, tokenIndex392, depth392 + goto l425 + l428: + position, tokenIndex, depth = position425, tokenIndex425, depth425 if buffer[position] != rune('_') { - goto l390 + goto l423 } position++ } - l392: - l396: + l425: + l429: { - position397, tokenIndex397, depth397 := position, tokenIndex, depth + position430, tokenIndex430, depth430 := position, tokenIndex, depth { - position398, tokenIndex398, depth398 := position, tokenIndex, depth + position431, tokenIndex431, depth431 := position, tokenIndex, depth if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l399 + goto l432 } position++ - goto l398 - l399: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l431 + l432: + position, tokenIndex, depth = position431, tokenIndex431, depth431 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l400 + goto l433 } position++ - goto l398 - l400: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l431 + l433: + position, tokenIndex, depth = position431, tokenIndex431, depth431 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l401 + goto l434 } position++ - goto l398 - l401: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l431 + l434: + position, tokenIndex, depth = position431, tokenIndex431, depth431 if buffer[position] != rune('_') { - goto l402 + goto l435 } position++ - goto l398 - l402: - position, tokenIndex, depth = position398, tokenIndex398, depth398 + goto l431 + l435: + position, tokenIndex, depth = position431, tokenIndex431, depth431 if buffer[position] != rune('-') { - goto l397 + goto l430 } position++ } - l398: - goto l396 - l397: - position, tokenIndex, depth = position397, tokenIndex397, depth397 + l431: + goto l429 + l430: + position, tokenIndex, depth = position430, tokenIndex430, depth430 } - goto l391 - l390: - position, tokenIndex, depth = position390, tokenIndex390, depth390 + goto l424 + l423: + position, tokenIndex, depth = position423, tokenIndex423, depth423 } - l391: + l424: depth-- - add(ruleKey, position378) + add(ruleKey, position411) } return true - l377: - position, tokenIndex, depth = position377, tokenIndex377, depth377 + l410: + position, tokenIndex, depth = position410, tokenIndex410, depth410 return false }, - /* 95 Index <- <('[' '-'? [0-9]+ ']')> */ + /* 98 Index <- <('[' '-'? [0-9]+ ']')> */ func() bool { - position403, tokenIndex403, depth403 := position, tokenIndex, depth + position436, tokenIndex436, depth436 := position, tokenIndex, depth { - position404 := position + position437 := position depth++ if buffer[position] != rune('[') { - goto l403 + goto l436 } position++ { - position405, tokenIndex405, depth405 := position, tokenIndex, depth + position438, tokenIndex438, depth438 := position, tokenIndex, depth if buffer[position] != rune('-') { - goto l405 + goto l438 } position++ - goto l406 - l405: - position, tokenIndex, depth = position405, tokenIndex405, depth405 + goto l439 + l438: + position, tokenIndex, depth = position438, tokenIndex438, depth438 } - l406: + l439: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l403 + goto l436 } position++ - l407: + l440: { - position408, tokenIndex408, depth408 := position, tokenIndex, depth + position441, tokenIndex441, depth441 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l408 + goto l441 } position++ - goto l407 - l408: - position, tokenIndex, depth = position408, tokenIndex408, depth408 + goto l440 + l441: + position, tokenIndex, depth = position441, tokenIndex441, depth441 } if buffer[position] != rune(']') { - goto l403 + goto l436 } position++ depth-- - add(ruleIndex, position404) + add(ruleIndex, position437) } return true - l403: - position, tokenIndex, depth = position403, tokenIndex403, depth403 + l436: + position, tokenIndex, depth = position436, tokenIndex436, depth436 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 + position442, tokenIndex442, depth442 := position, tokenIndex, depth { - position410 := position + position443 := position depth++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l442 } position++ - l411: + l444: { - position412, tokenIndex412, depth412 := position, tokenIndex, depth + position445, tokenIndex445, depth445 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l412 + goto l445 } position++ - goto l411 - l412: - position, tokenIndex, depth = position412, tokenIndex412, depth412 + goto l444 + l445: + position, tokenIndex, depth = position445, tokenIndex445, depth445 } if buffer[position] != rune('.') { - goto l409 + goto l442 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l442 } position++ - l413: + l446: { - position414, tokenIndex414, depth414 := position, tokenIndex, depth + position447, tokenIndex447, depth447 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l414 + goto l447 } position++ - goto l413 - l414: - position, tokenIndex, depth = position414, tokenIndex414, depth414 + goto l446 + l447: + position, tokenIndex, depth = position447, tokenIndex447, depth447 } if buffer[position] != rune('.') { - goto l409 + goto l442 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l442 } position++ - l415: + l448: { - position416, tokenIndex416, depth416 := position, tokenIndex, depth + position449, tokenIndex449, depth449 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l416 + goto l449 } position++ - goto l415 - l416: - position, tokenIndex, depth = position416, tokenIndex416, depth416 + goto l448 + l449: + position, tokenIndex, depth = position449, tokenIndex449, depth449 } if buffer[position] != rune('.') { - goto l409 + goto l442 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l409 + goto l442 } position++ - l417: + l450: { - position418, tokenIndex418, depth418 := position, tokenIndex, depth + position451, tokenIndex451, depth451 := position, tokenIndex, depth if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l418 + goto l451 } position++ - goto l417 - l418: - position, tokenIndex, depth = position418, tokenIndex418, depth418 + goto l450 + l451: + position, tokenIndex, depth = position451, tokenIndex451, depth451 } depth-- - add(ruleIP, position410) + add(ruleIP, position443) } return true - l409: - position, tokenIndex, depth = position409, tokenIndex409, depth409 + l442: + position, tokenIndex, depth = position442, tokenIndex442, depth442 return false }, - /* 97 ws <- <(' ' / '\t' / '\n' / '\r')*> */ + /* 100 ws <- <(' ' / '\t' / '\n' / '\r')*> */ func() bool { { - position420 := position + position453 := position depth++ - l421: + l454: { - position422, tokenIndex422, depth422 := position, tokenIndex, depth + position455, tokenIndex455, depth455 := position, tokenIndex, depth { - position423, tokenIndex423, depth423 := position, tokenIndex, depth + position456, tokenIndex456, depth456 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l424 + goto l457 } position++ - goto l423 - l424: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l456 + l457: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\t') { - goto l425 + goto l458 } position++ - goto l423 - l425: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l456 + l458: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\n') { - goto l426 + goto l459 } position++ - goto l423 - l426: - position, tokenIndex, depth = position423, tokenIndex423, depth423 + goto l456 + l459: + position, tokenIndex, depth = position456, tokenIndex456, depth456 if buffer[position] != rune('\r') { - goto l422 + goto l455 } position++ } - l423: - goto l421 - l422: - position, tokenIndex, depth = position422, tokenIndex422, depth422 + l456: + goto l454 + l455: + position, tokenIndex, depth = position455, tokenIndex455, depth455 } depth-- - add(rulews, position420) + add(rulews, position453) } return true }, - /* 98 req_ws <- <(' ' / '\t' / '\n' / '\r')+> */ + /* 101 req_ws <- <(' ' / '\t' / '\n' / '\r')+> */ func() bool { - position427, tokenIndex427, depth427 := position, tokenIndex, depth + position460, tokenIndex460, depth460 := position, tokenIndex, depth { - position428 := position + position461 := position depth++ { - position431, tokenIndex431, depth431 := position, tokenIndex, depth + position464, tokenIndex464, depth464 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l432 + goto l465 } position++ - goto l431 - l432: - position, tokenIndex, depth = position431, tokenIndex431, depth431 + goto l464 + l465: + position, tokenIndex, depth = position464, tokenIndex464, depth464 if buffer[position] != rune('\t') { - goto l433 + goto l466 } position++ - goto l431 - l433: - position, tokenIndex, depth = position431, tokenIndex431, depth431 + goto l464 + l466: + position, tokenIndex, depth = position464, tokenIndex464, depth464 if buffer[position] != rune('\n') { - goto l434 + goto l467 } position++ - goto l431 - l434: - position, tokenIndex, depth = position431, tokenIndex431, depth431 + goto l464 + l467: + position, tokenIndex, depth = position464, tokenIndex464, depth464 if buffer[position] != rune('\r') { - goto l427 + goto l460 } position++ } - l431: - l429: + l464: + l462: { - position430, tokenIndex430, depth430 := position, tokenIndex, depth + position463, tokenIndex463, depth463 := position, tokenIndex, depth { - position435, tokenIndex435, depth435 := position, tokenIndex, depth + position468, tokenIndex468, depth468 := position, tokenIndex, depth if buffer[position] != rune(' ') { - goto l436 + goto l469 } position++ - goto l435 - l436: - position, tokenIndex, depth = position435, tokenIndex435, depth435 + goto l468 + l469: + position, tokenIndex, depth = position468, tokenIndex468, depth468 if buffer[position] != rune('\t') { - goto l437 + goto l470 } position++ - goto l435 - l437: - position, tokenIndex, depth = position435, tokenIndex435, depth435 + goto l468 + l470: + position, tokenIndex, depth = position468, tokenIndex468, depth468 if buffer[position] != rune('\n') { - goto l438 + goto l471 } position++ - goto l435 - l438: - position, tokenIndex, depth = position435, tokenIndex435, depth435 + goto l468 + l471: + position, tokenIndex, depth = position468, tokenIndex468, depth468 if buffer[position] != rune('\r') { - goto l430 + goto l463 } position++ } - l435: - goto l429 - l430: - position, tokenIndex, depth = position430, tokenIndex430, depth430 + l468: + goto l462 + l463: + position, tokenIndex, depth = position463, tokenIndex463, depth463 } depth-- - add(rulereq_ws, position428) + add(rulereq_ws, position461) } return true - l427: - position, tokenIndex, depth = position427, tokenIndex427, depth427 + l460: + position, tokenIndex, depth = position460, tokenIndex460, depth460 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..2a85108 100644 --- a/dynaml/expression.go +++ b/dynaml/expression.go @@ -25,6 +25,9 @@ type State interface { FileSystem() vfs.VFS GetFunctions() Registry 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/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..5bf2c02 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.LastIndex(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..2bd27c5 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,35 @@ var _ = Describe("parsing", func() { }) }) + Describe("marker", func() { + markers := []string{ + "&template", + "&temporary", + "&state", + "&inject", + "&local", + "&default", + "&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 +103,28 @@ 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{""}}) + }) + }) + + 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}}, + }, + ) }) }) @@ -83,7 +134,7 @@ var _ = Describe("parsing", func() { `"foo" bar`, ConcatenationExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -92,7 +143,7 @@ var _ = Describe("parsing", func() { ConcatenationExpr{ ConcatenationExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -106,7 +157,7 @@ var _ = Describe("parsing", func() { `"foo" || bar`, OrExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -115,7 +166,7 @@ var _ = Describe("parsing", func() { OrExpr{ OrExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -129,7 +180,7 @@ var _ = Describe("parsing", func() { `"foo" + bar`, AdditionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -138,7 +189,7 @@ var _ = Describe("parsing", func() { AdditionExpr{ AdditionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -152,7 +203,7 @@ var _ = Describe("parsing", func() { `"foo" - bar`, SubtractionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -161,7 +212,7 @@ var _ = Describe("parsing", func() { SubtractionExpr{ SubtractionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -175,7 +226,7 @@ var _ = Describe("parsing", func() { `"foo" * bar`, MultiplicationExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -184,7 +235,7 @@ var _ = Describe("parsing", func() { MultiplicationExpr{ MultiplicationExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -198,7 +249,7 @@ var _ = Describe("parsing", func() { `"foo" / bar`, DivisionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) @@ -207,7 +258,7 @@ var _ = Describe("parsing", func() { DivisionExpr{ DivisionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, MergeExpr{}, }, @@ -221,7 +272,7 @@ var _ = Describe("parsing", func() { `"foo" % bar`, ModuloExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }, ) }) @@ -239,7 +290,7 @@ var _ = Describe("parsing", func() { []Expression{ IntegerExpr{1}, StringExpr{"two"}, - ReferenceExpr{[]string{"three"}}, + ReferenceExpr{Path: []string{"three"}}, }, }, ) @@ -251,7 +302,7 @@ var _ = Describe("parsing", func() { ListExpr{ []Expression{ IntegerExpr{1}, - ListExpansionExpr{ReferenceExpr{[]string{"foo"}}}, + ListExpansionExpr{ReferenceExpr{Path: []string{"foo"}}}, IntegerExpr{2}, }, }, @@ -267,7 +318,7 @@ var _ = Describe("parsing", func() { StringExpr{"two"}, ListExpr{ []Expression{ - ReferenceExpr{[]string{"three"}}, + ReferenceExpr{Path: []string{"three"}}, StringExpr{"four"}, }, }, @@ -282,7 +333,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo()`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, nil, false, }, @@ -293,7 +344,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo(1)`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, []Expression{ IntegerExpr{1}, }, @@ -306,10 +357,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 +372,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo.bar(1)`, CallExpr{ - ReferenceExpr{[]string{"foo", "bar"}}, + ReferenceExpr{Path: []string{"foo", "bar"}}, []Expression{ IntegerExpr{1}, }, @@ -334,7 +385,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 +398,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 +412,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 +426,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 +442,7 @@ var _ = Describe("parsing", func() { parsesAs( `(foo)(1)`, CallExpr{ - GroupedExpr{ReferenceExpr{[]string{"foo"}}}, + GroupedExpr{ReferenceExpr{Path: []string{"foo"}}}, []Expression{ IntegerExpr{1}, }, @@ -404,11 +455,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 +470,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 +489,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 +512,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo*()`, CallExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, nil, true, }, @@ -471,9 +522,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 +539,7 @@ var _ = Describe("parsing", func() { SubtractionExpr{ GroupedExpr{SubtractionExpr{ StringExpr{"foo"}, - ReferenceExpr{[]string{"bar"}}, + ReferenceExpr{Path: []string{"bar"}}, }}, MergeExpr{}, }, @@ -501,11 +552,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 +568,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 +583,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 +602,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 +621,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 +641,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 +657,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 +669,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 +681,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 +697,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 +709,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 +727,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 +742,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 +760,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 +773,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 +791,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 +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"}}, }, SelectToListContext, }, @@ -769,11 +820,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 +840,7 @@ var _ = Describe("parsing", func() { CreateMapExpr{ nil, }, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -806,7 +857,7 @@ var _ = Describe("parsing", func() { }, }, }, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -827,7 +878,7 @@ var _ = Describe("parsing", func() { }, }, }, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -840,7 +891,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ nil, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -851,7 +902,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ []Parameter{Parameter{Name: "x"}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -863,8 +914,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 +927,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 +942,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ []Parameter{Parameter{Name: "x"}}, true, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -901,7 +952,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ []Parameter{Parameter{Name: "a"}, Parameter{Name: "x"}}, true, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -912,7 +963,7 @@ var _ = Describe("parsing", func() { LambdaExpr{ []Parameter{Parameter{Name: "a", Default: IntegerExpr{5}}}, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -926,7 +977,7 @@ var _ = Describe("parsing", func() { Parameter{Name: "x", Default: IntegerExpr{6}}, }, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -940,7 +991,7 @@ var _ = Describe("parsing", func() { Parameter{Name: "x", Default: IntegerExpr{6}}, }, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -956,7 +1007,7 @@ var _ = Describe("parsing", func() { Parameter{Name: "y", Default: IntegerExpr{7}}, }, false, - ReferenceExpr{[]string{"x"}}, + ReferenceExpr{Path: []string{"x"}}, }, ) }) @@ -968,10 +1019,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 +1031,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo.[ 0 ]`, DynamicExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, IntegerExpr{0}, }, ) @@ -989,7 +1040,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 +1049,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 +1071,7 @@ var _ = Describe("parsing", func() { QualifiedExpr{ CallExpr{ CallExpr{ - ReferenceExpr{[]string{"a", "b"}}, + ReferenceExpr{Path: []string{"a", "b"}}, []Expression{ IntegerExpr{1}, }, @@ -1031,21 +1082,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 +1105,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 +1133,7 @@ var _ = Describe("parsing", func() { IntegerExpr{2}, }, }, - ReferenceExpr{[]string{"a"}}, + ReferenceExpr{Path: []string{"a"}}, }, []Expression{ IntegerExpr{1}, @@ -1094,21 +1145,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 +1171,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 +1183,7 @@ var _ = Describe("parsing", func() { parsesAs( `foo[ 0 ]`, DynamicExpr{ - ReferenceExpr{[]string{"foo"}}, + ReferenceExpr{Path: []string{"foo"}}, IntegerExpr{0}, }, ) @@ -1141,14 +1192,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 +1210,7 @@ var _ = Describe("parsing", func() { QualifiedExpr{ CallExpr{ ReferenceExpr{ - []string{"foo"}, + Path: []string{"foo"}, }, []Expression{ IntegerExpr{0}, @@ -1167,7 +1218,7 @@ var _ = Describe("parsing", func() { false, }, ReferenceExpr{ - []string{"[1]"}, + Path: []string{"[1]"}, }, }, []Expression{ @@ -1183,11 +1234,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..a7595a0 100644 --- a/dynaml/reference.go +++ b/dynaml/reference.go @@ -8,24 +8,92 @@ 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) - return e.find(func(end int, path []string) (yaml.Node, bool) { + debug.Debug("reference: (%s)%v\n", e.Tag, e.Path) + sel := 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...) + } return binding.FindReference(path[:end+1]) } - }, binding, locally) + } + + if e.Tag != "" { + info := DefaultInfo() + if e.Tag != "doc:0" { + 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] == "" { + 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") + } + fromRoot = true + } + } + return e.find(sel, 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) { @@ -65,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/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/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/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/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/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/cascade.go b/flow/cascade.go index af16272..ef7a6da 100644 --- a/flow/cascade.go +++ b/flow/cascade.go @@ -17,6 +17,7 @@ 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 @@ -24,6 +25,7 @@ func PrepareStubs(outer dynaml.Binding, partial bool, stubs ...yaml.Node) ([]yam stubs[i] = Cleanup(flowed, discardLocal) } + ResetStream(outer) return stubs, nil } @@ -36,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 } @@ -56,6 +59,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/environment.go b/flow/environment.go index 3fea075..9e5ce31 100644 --- a/flow/environment.go +++ b/flow/environment.go @@ -320,6 +320,27 @@ func CleanupEnvironment(binding dynaml.Binding) { } } +func ResetTags(binding dynaml.Binding) { + env, ok := binding.(DefaultEnvironment) + if ok && env.state != nil { + env.state.ResetTags() + } +} + +func ResetStream(binding dynaml.Binding) { + env, ok := binding.(DefaultEnvironment) + if ok && env.state != nil { + env.state.ResetStream() + } +} + +func PushDocument(binding dynaml.Binding, doc yaml.Node) { + env, ok := binding.(DefaultEnvironment) + if ok && env.state != nil { + env.state.PushDocument(doc) + } +} + 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..2463751 100644 --- a/flow/flow.go +++ b/flow/flow.go @@ -33,6 +33,31 @@ 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 != "" { + 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) + } + 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 +98,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 +139,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 +183,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 +251,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 +282,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 +292,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 +412,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 +475,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 +528,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 +550,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 +563,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 +625,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 +692,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..f5b7533 --- /dev/null +++ b/flow/flow_tag_test.go @@ -0,0 +1,247 @@ +package flow + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +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() { + 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)) + }) + 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)) + }) + }) + + 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`, + )) + }) + }) + + 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 e1e4cfd..7beda9e 100644 --- a/flow/state.go +++ b/flow/state.go @@ -7,6 +7,9 @@ import ( "io/ioutil" "net/http" "path" + "reflect" + "sort" + "strconv" "strings" "github.com/mandelsoft/vfs/pkg/osfs" @@ -15,6 +18,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 +32,8 @@ type State struct { fileSystem vfs.VFS // virtual filesystem to use for filesystem based operations functions dynaml.Registry interpolation bool + tags map[string]*dynaml.TagInfo + docno int // document number } var _ dynaml.State = &State{} @@ -43,11 +49,13 @@ func NewState(key string, mode int, optfs ...vfs.FileSystem) *State { mode = mode & ^MODE_OS_ACCESS } return &State{ + tags: map[string]*dynaml.TagInfo{}, files: map[string]string{}, fileCache: map[string][]byte{}, key: key, mode: mode, fileSystem: vfs.New(fs), + docno: 1, } } @@ -60,6 +68,14 @@ func (s *State) SetFunctions(f dynaml.Registry) *State { return s } +func (s *State) SetTags(tags ...*dynaml.Tag) *State { + s.tags = map[string]*dynaml.TagInfo{} + for _, v := range tags { + s.tags[v.Name()] = dynaml.NewTagInfo(v) + } + return s +} + func (s *State) EnableInterpolation() { s.interpolation = true } @@ -112,6 +128,104 @@ func (s *State) GetTempName(data []byte) (string, error) { return name, nil } +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.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.NewTagInfo(dynaml.NewTag(name, Cleanup(node, discardTags), path, scope)) + return nil +} + +func (s *State) GetTag(name string) *dynaml.Tag { + 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 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.TagInfo{} + s.docno = 1 +} + +func (s *State) ResetStream() { + n := map[string]*dynaml.TagInfo{} + for _, v := range s.tags { + if !v.IsStream() { + n[v.Name()] = v + } + } + s.docno = 1 + s.tags = n +} + +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() + } + s.docno++ +} + func (s *State) Cleanup() { 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/spiffing/interface.go b/spiffing/interface.go index c5464bc..c4e8e3f 100644 --- a/spiffing/interface.go +++ b/spiffing/interface.go @@ -55,6 +55,21 @@ 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 + // 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 // FileSource create a new file source based on the configured file system. @@ -84,13 +99,22 @@ type Spiff interface { Normalize(node Node) (interface{}, error) // Cascade processes a template with a list of given subs and state - // documents + // documents. + // 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 + // 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. - 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 9442c56..a57e7f1 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,48 @@ func New() Spiff { } } -func (s *spiff) reset() Spiff { +func (s *spiff) Reset() Spiff { s.binding = nil return s } +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 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 +140,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 +152,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 +178,13 @@ 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 global tag for subsequent processings. +func (s spiff) SetTag(tag string, node yaml.Node) Spiff { + s.tags[tag] = dynaml.NewTag(tag, node, nil, dynaml.TAG_SCOPE_GLOBAL) + return s.Reset() } // FileSystem return the virtual filesystem set for the execution context. @@ -165,30 +197,39 @@ 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() + 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...) } // ApplyStubs uses already prepared subs to process a template. -func (s *spiff) ApplyStubs(template Node, preparedstubs []Node) (Node, error) { +// It uses the configured implicit tag settings. +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) } 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