diff --git a/config/lang/ast/ast.go b/config/lang/ast/ast.go index 3bb748ccc..c9ae1b882 100644 --- a/config/lang/ast/ast.go +++ b/config/lang/ast/ast.go @@ -3,6 +3,8 @@ package ast // Node is the interface that all AST nodes must implement. type Node interface{} +//go:generate stringer -type=Type + // Type is the type of a literal. type Type uint diff --git a/config/lang/ast/type_string.go b/config/lang/ast/type_string.go new file mode 100644 index 000000000..59c336f5a --- /dev/null +++ b/config/lang/ast/type_string.go @@ -0,0 +1,17 @@ +// generated by stringer -type=Type; DO NOT EDIT + +package ast + +import "fmt" + +const _Type_name = "TypeInvalidTypeString" + +var _Type_index = [...]uint8{0, 11, 21} + +func (i Type) String() string { + i -= 1 + if i+1 >= Type(len(_Type_index)) { + return fmt.Sprintf("Type(%d)", i+1) + } + return _Type_name[_Type_index[i]:_Type_index[i+1]] +} diff --git a/config/lang/lex_test.go b/config/lang/lex_test.go index ce6a36960..b5cc7c583 100644 --- a/config/lang/lex_test.go +++ b/config/lang/lex_test.go @@ -105,11 +105,3 @@ func TestLex(t *testing.T) { } } } - -/* OTHERS: - -foo ${var.foo} -bar ${"hello"} -foo ${concat("foo ${var.bar}", var.baz)} - -*/