Skip to content

Commit

Permalink
Comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielg committed Oct 26, 2024
1 parent 4daa03d commit 977693b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion ast/vcl_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (s *String) ID() uint64 { return s.Meta.ID }
func (s *String) Expression() {}
func (s *String) GetMeta() *Meta { return s.Meta }
func (s *String) String() string {
if s.LongString { // offset=4 means bracket string
if s.LongString {
return strings.TrimSpace(
fmt.Sprintf(`%s{%s"%s"%s}%s`, s.LeadingComment(inline), s.Delimiter, s.Value, s.Delimiter, s.TrailingComment(inline)),
)
Expand Down
1 change: 0 additions & 1 deletion formatter/expression_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func (f *Formatter) formatFloat(expr *ast.Float) string {

func (f *Formatter) formatString(expr *ast.String) string {
if expr.LongString {
// offset=4 means bracket string like {"..."}
return fmt.Sprintf(`{%s"%s"%s}`, expr.Delimiter, expr.Value, expr.Delimiter)
}
// Otherwise, double-quoted string
Expand Down

0 comments on commit 977693b

Please sign in to comment.