lang: interpolate: Rename interpolate functions to please linters
This commit is contained in:
@@ -253,7 +253,7 @@ func (obj *GAPI) Cli(cliInfo *gapi.CliInfo) (*gapi.Deploy, error) {
|
||||
|
||||
LexParser: parser.LexParse,
|
||||
Downloader: downloader,
|
||||
StrInterpolater: interpolate.InterpolateStr,
|
||||
StrInterpolater: interpolate.StrInterpolate,
|
||||
//World: obj.World, // TODO: do we need this?
|
||||
|
||||
Prefix: prefix,
|
||||
@@ -726,7 +726,7 @@ func (obj *GAPI) Get(getInfo *gapi.GetInfo) error {
|
||||
|
||||
LexParser: parser.LexParse,
|
||||
Downloader: downloader,
|
||||
StrInterpolater: interpolate.InterpolateStr,
|
||||
StrInterpolater: interpolate.StrInterpolate,
|
||||
//World: obj.World, // TODO: do we need this?
|
||||
|
||||
Prefix: prefix,
|
||||
|
||||
@@ -38,21 +38,21 @@ const (
|
||||
UseHilInterpolation = false
|
||||
)
|
||||
|
||||
// InterpolateStr interpolates a string and returns the representative AST.
|
||||
func InterpolateStr(str string, pos *interfaces.Pos, data *interfaces.Data) (interfaces.Expr, error) {
|
||||
// StrInterpolate interpolates a string and returns the representative AST.
|
||||
func StrInterpolate(str string, pos *interfaces.Pos, data *interfaces.Data) (interfaces.Expr, error) {
|
||||
if data.Debug {
|
||||
data.Logf("interpolating: %s", str)
|
||||
}
|
||||
|
||||
if UseHilInterpolation {
|
||||
return InterpolateHil(str, pos, data)
|
||||
return HilInterpolate(str, pos, data)
|
||||
}
|
||||
return InterpolateRagel(str, pos, data)
|
||||
return RagelInterpolate(str, pos, data)
|
||||
}
|
||||
|
||||
// InterpolateRagel interpolates a string and returns the representative AST. It
|
||||
// RagelInterpolate interpolates a string and returns the representative AST. It
|
||||
// uses the ragel parser to perform the string interpolation.
|
||||
func InterpolateRagel(str string, pos *interfaces.Pos, data *interfaces.Data) (interfaces.Expr, error) {
|
||||
func RagelInterpolate(str string, pos *interfaces.Pos, data *interfaces.Data) (interfaces.Expr, error) {
|
||||
sequence, err := Parse(str)
|
||||
if err != nil {
|
||||
return nil, errwrap.Wrapf(err, "parser failed")
|
||||
@@ -101,9 +101,9 @@ func InterpolateRagel(str string, pos *interfaces.Pos, data *interfaces.Data) (i
|
||||
return result, errwrap.Wrapf(result.Init(data), "init failed")
|
||||
}
|
||||
|
||||
// InterpolateHil interpolates a string and returns the representative AST. This
|
||||
// HilInterpolate interpolates a string and returns the representative AST. This
|
||||
// particular implementation uses the hashicorp hil library and syntax to do so.
|
||||
func InterpolateHil(str string, pos *interfaces.Pos, data *interfaces.Data) (interfaces.Expr, error) {
|
||||
func HilInterpolate(str string, pos *interfaces.Pos, data *interfaces.Data) (interfaces.Expr, error) {
|
||||
var line, column int = -1, -1
|
||||
var filename string
|
||||
if pos != nil {
|
||||
|
||||
@@ -217,7 +217,7 @@ func TestInterpolate0(t *testing.T) {
|
||||
|
||||
data := &interfaces.Data{
|
||||
// TODO: add missing fields here if/when needed
|
||||
StrInterpolater: InterpolateStr,
|
||||
StrInterpolater: StrInterpolate,
|
||||
|
||||
Debug: testing.Verbose(), // set via the -test.v flag to `go test`
|
||||
Logf: func(format string, v ...interface{}) {
|
||||
@@ -472,7 +472,7 @@ func TestInterpolateBasicStmt(t *testing.T) {
|
||||
|
||||
data := &interfaces.Data{
|
||||
// TODO: add missing fields here if/when needed
|
||||
StrInterpolater: InterpolateStr,
|
||||
StrInterpolater: StrInterpolate,
|
||||
|
||||
Debug: testing.Verbose(), // set via the -test.v flag to `go test`
|
||||
Logf: func(format string, v ...interface{}) {
|
||||
@@ -797,7 +797,7 @@ func TestInterpolateBasicExpr(t *testing.T) {
|
||||
|
||||
data := &interfaces.Data{
|
||||
// TODO: add missing fields here if/when needed
|
||||
StrInterpolater: InterpolateStr,
|
||||
StrInterpolater: StrInterpolate,
|
||||
|
||||
Debug: testing.Verbose(), // set via the -test.v flag to `go test`
|
||||
Logf: func(format string, v ...interface{}) {
|
||||
|
||||
@@ -452,7 +452,7 @@ func TestAstFunc0(t *testing.T) {
|
||||
|
||||
data := &interfaces.Data{
|
||||
// TODO: add missing fields here if/when needed
|
||||
StrInterpolater: interpolate.InterpolateStr,
|
||||
StrInterpolater: interpolate.StrInterpolate,
|
||||
|
||||
Debug: testing.Verbose(), // set via the -test.v flag to `go test`
|
||||
Logf: func(format string, v ...interface{}) {
|
||||
@@ -824,7 +824,7 @@ func TestAstFunc1(t *testing.T) {
|
||||
Modules: "/" + interfaces.ModuleDirectory, // not really needed here afaict
|
||||
|
||||
LexParser: parser.LexParse,
|
||||
StrInterpolater: interpolate.InterpolateStr,
|
||||
StrInterpolater: interpolate.StrInterpolate,
|
||||
|
||||
Debug: testing.Verbose(), // set via the -test.v flag to `go test`
|
||||
Logf: func(format string, v ...interface{}) {
|
||||
@@ -1309,7 +1309,7 @@ func TestAstFunc2(t *testing.T) {
|
||||
Modules: "/" + interfaces.ModuleDirectory, // not really needed here afaict
|
||||
|
||||
LexParser: parser.LexParse,
|
||||
StrInterpolater: interpolate.InterpolateStr,
|
||||
StrInterpolater: interpolate.StrInterpolate,
|
||||
|
||||
Debug: testing.Verbose(), // set via the -test.v flag to `go test`
|
||||
Logf: func(format string, v ...interface{}) {
|
||||
|
||||
@@ -147,7 +147,7 @@ func (obj *Lang) Init() error {
|
||||
|
||||
LexParser: parser.LexParse,
|
||||
Downloader: nil, // XXX: is this used here?
|
||||
StrInterpolater: interpolate.InterpolateStr,
|
||||
StrInterpolater: interpolate.StrInterpolate,
|
||||
//World: obj.World, // TODO: do we need this?
|
||||
|
||||
Prefix: obj.Prefix,
|
||||
|
||||
Reference in New Issue
Block a user