Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
aq17 committed Oct 13, 2022
1 parent b4bf3dd commit 8197483
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/codegen/go/gen_program.go
Expand Up @@ -647,6 +647,7 @@ func (g *generator) genResource(w io.Writer, r *pcl.Resource) {
g.diagnostics = append(g.diagnostics, diagnostics...)
expr, temps := g.lowerExpression(input.Value, destType.(model.Type))
input.Value = expr
fmt.Printf("input val set to %v\n", input.Value)
g.genTemps(w, temps)
}

Expand All @@ -672,6 +673,7 @@ func (g *generator) genResource(w io.Writer, r *pcl.Resource) {
if len(r.Inputs) > 0 {
g.Fgenf(w, "&%s.%sArgs{\n", modOrAlias, typ)
for _, attr := range r.Inputs {
fmt.Printf("attr name %v, val %v\n", attr.Name, attr.Value)
g.Fgenf(w, "%s: ", strings.Title(attr.Name))
g.Fgenf(w, "%.v,\n", attr.Value)

Expand Down
2 changes: 2 additions & 0 deletions pkg/codegen/hcl2/model/format/gen.go
Expand Up @@ -175,6 +175,7 @@ func (e *Formatter) Fgen(w io.Writer, vs ...interface{}) {
func (e *Formatter) Fgenf(w io.Writer, format string, args ...interface{}) {
for i := range args {
if node, ok := args[i].(model.Expression); ok {
fmt.Printf("before modify, format %v, for %v\n", format, args[0])
args[i] = Func(func(f fmt.State, c rune) {
parentPrecedence := 0
if pp, ok := f.Precision(); ok {
Expand All @@ -183,6 +184,7 @@ func (e *Formatter) Fgenf(w io.Writer, format string, args ...interface{}) {
rhs := c == 'o'
e.gen(f, parentPrecedence, rhs, node)
})
fmt.Printf("after modify, format %v, for %v\n", format, args[0])
}
}
fmt.Fprintf(w, format, args...)
Expand Down

0 comments on commit 8197483

Please sign in to comment.