Skip to content

Commit

Permalink
Merge pull request #5 from rudifa/add-txtar-files
Browse files Browse the repository at this point in the history
add 1447.txtar
  • Loading branch information
rudifa committed Dec 17, 2023
2 parents 59159dd + 5120e10 commit 3488425
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions testdata/pending/1447.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# cmd/fmt: single import and comment combined #1447

exec cue fmt 1447.cue
cmp 1447.cue 1447.got.cue

-- 1447.cue --
import "strings"

// comment

s: string
u: strings.ToUpper(s)
-- 1447.got.cue --
import ( "strings"

// comment
)

s: string
u: strings.ToUpper(s)
-- print_tool.got --
pending % print_tool 1447.cue [add-txtar-files|…4]
*ast.File{
Filename: "1447.cue"
Decls: []ast.Decl{
*ast.ImportDecl{
Import: token.Pos("1447.cue:1:1")
Lparen: token.Pos("-")
Specs: []*ast.ImportSpec{
*ast.ImportSpec{
Name: nil
Path: *ast.BasicLit{
ValuePos: token.Pos("1447.cue:1:8")
Kind: token.Token("STRING")
Value: "\"strings\""
}
EndPos: token.Pos("-")
Comments: []*ast.CommentGroup{
*ast.CommentGroup{
Doc: false
Line: false
Position: 2
List: []*ast.Comment{
*ast.Comment{
Slash: token.Pos("1447.cue:3:1")
Text: "// comment"
}
}
}
}
}
}
Rparen: token.Pos("-")
}
*ast.Field{
Label: *ast.Ident{
NamePos: token.Pos("1447.cue:5:1")
Name: "s"
}
Optional: token.Pos("-")
Constraint: token.Token("ILLEGAL")
TokenPos: token.Pos("1447.cue:5:2")
Token: token.Token(":")
Value: *ast.Ident{
NamePos: token.Pos("1447.cue:5:4")
Name: "string"
}
Attrs: []*ast.Attribute{
}
}
*ast.Field{
Label: *ast.Ident{
NamePos: token.Pos("1447.cue:6:1")
Name: "u"
}
Optional: token.Pos("-")
Constraint: token.Token("ILLEGAL")
TokenPos: token.Pos("1447.cue:6:2")
Token: token.Token(":")
Value: *ast.CallExpr{
Fun: *ast.SelectorExpr{
X: *ast.Ident{
NamePos: token.Pos("1447.cue:6:4")
Name: "strings"
}
Sel: *ast.Ident{
NamePos: token.Pos("1447.cue:6:12")
Name: "ToUpper"
}
}
Lparen: token.Pos("1447.cue:6:19")
Args: []ast.Expr{
*ast.Ident{
NamePos: token.Pos("1447.cue:6:20")
Name: "s"
}
}
Rparen: token.Pos("1447.cue:6:21")
}
Attrs: []*ast.Attribute{
}
}
}
Imports: []*ast.ImportSpec{
*ast.ImportSpec{
Name: panic: encountered a cycle; stopping
-- end --

0 comments on commit 3488425

Please sign in to comment.