-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rudifa/add-txtar-files
add 1447.txtar
- Loading branch information
Showing
1 changed file
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -- |