cuelang.org/go@v0.13.0/internal/astinternal/testdata/debugprint/file.txtar (about) 1 -- empty.cue -- 2 -- package_only.cue -- 3 package p 4 -- comments_only.cue -- 5 // some 6 // comment lines 7 -- imports.cue -- 8 package p 9 10 import "foo" 11 12 import ( 13 "bar" 14 name "baz" 15 ) 16 -- out/debugprint/empty.cue -- 17 *ast.File{ 18 Filename: "empty.cue" 19 Decls: []ast.Decl{} 20 Imports: []*ast.ImportSpec{} 21 } 22 -- out/debugprint/package_only.cue -- 23 *ast.File{ 24 Filename: "package_only.cue" 25 Decls: []ast.Decl{ 26 *ast.Package{ 27 PackagePos: token.Pos("package_only.cue:1:1", nospace) 28 Name: *ast.Ident{ 29 NamePos: token.Pos("package_only.cue:1:9", blank) 30 Name: "p" 31 } 32 } 33 } 34 Imports: []*ast.ImportSpec{} 35 } 36 -- out/debugprint/comments_only.cue -- 37 *ast.File{ 38 Filename: "comments_only.cue" 39 Decls: []ast.Decl{} 40 Imports: []*ast.ImportSpec{} 41 Comments: []*ast.CommentGroup{ 42 { 43 Doc: false 44 Line: false 45 Position: 0 46 List: []*ast.Comment{ 47 { 48 Slash: token.Pos("comments_only.cue:1:1", newline) 49 Text: "// some" 50 } 51 { 52 Slash: token.Pos("comments_only.cue:2:1", newline) 53 Text: "// comment lines" 54 } 55 } 56 } 57 } 58 } 59 -- out/debugprint/imports.cue -- 60 *ast.File{ 61 Filename: "imports.cue" 62 Decls: []ast.Decl{ 63 *ast.Package{ 64 PackagePos: token.Pos("imports.cue:1:1", nospace) 65 Name: *ast.Ident{ 66 NamePos: token.Pos("imports.cue:1:9", blank) 67 Name: "p" 68 } 69 } 70 *ast.ImportDecl{ 71 Import: token.Pos("imports.cue:3:1", section) 72 Lparen: token.Pos("-") 73 Specs: []*ast.ImportSpec{ 74 { 75 Name: nil 76 Path: *ast.BasicLit{ 77 ValuePos: token.Pos("imports.cue:3:8", blank) 78 Kind: token.Token("STRING") 79 Value: "\"foo\"" 80 } 81 EndPos: token.Pos("-") 82 } 83 } 84 Rparen: token.Pos("-") 85 } 86 *ast.ImportDecl{ 87 Import: token.Pos("imports.cue:5:1", section) 88 Lparen: token.Pos("imports.cue:5:8", blank) 89 Specs: []*ast.ImportSpec{ 90 { 91 Name: nil 92 Path: *ast.BasicLit{ 93 ValuePos: token.Pos("imports.cue:6:2", newline) 94 Kind: token.Token("STRING") 95 Value: "\"bar\"" 96 } 97 EndPos: token.Pos("-") 98 } 99 { 100 Name: *ast.Ident{ 101 NamePos: token.Pos("imports.cue:7:2", newline) 102 Name: "name" 103 } 104 Path: *ast.BasicLit{ 105 ValuePos: token.Pos("imports.cue:7:7", blank) 106 Kind: token.Token("STRING") 107 Value: "\"baz\"" 108 } 109 EndPos: token.Pos("-") 110 } 111 } 112 Rparen: token.Pos("imports.cue:8:1", newline) 113 } 114 } 115 Imports: []*ast.ImportSpec{ 116 { 117 Name: nil 118 Path: *ast.BasicLit{ 119 ValuePos: token.Pos("imports.cue:3:8", blank) 120 Kind: token.Token("STRING") 121 Value: "\"foo\"" 122 } 123 EndPos: token.Pos("-") 124 } 125 { 126 Name: nil 127 Path: *ast.BasicLit{ 128 ValuePos: token.Pos("imports.cue:6:2", newline) 129 Kind: token.Token("STRING") 130 Value: "\"bar\"" 131 } 132 EndPos: token.Pos("-") 133 } 134 { 135 Name: *ast.Ident{ 136 NamePos: token.Pos("imports.cue:7:2", newline) 137 Name: "name" 138 } 139 Path: *ast.BasicLit{ 140 ValuePos: token.Pos("imports.cue:7:7", blank) 141 Kind: token.Token("STRING") 142 Value: "\"baz\"" 143 } 144 EndPos: token.Pos("-") 145 } 146 } 147 } 148 -- out/debugprint/empty.cue/omitempty-strings -- 149 *ast.File{ 150 Filename: "empty.cue" 151 } 152 -- out/debugprint/package_only.cue/omitempty-strings -- 153 *ast.File{ 154 Filename: "package_only.cue" 155 Decls: []ast.Decl{ 156 *ast.Package{ 157 Name: *ast.Ident{ 158 Name: "p" 159 } 160 } 161 } 162 } 163 -- out/debugprint/comments_only.cue/omitempty-strings -- 164 *ast.File{ 165 Filename: "comments_only.cue" 166 Comments: []*ast.CommentGroup{ 167 { 168 List: []*ast.Comment{ 169 { 170 Text: "// some" 171 } 172 { 173 Text: "// comment lines" 174 } 175 } 176 } 177 } 178 } 179 -- out/debugprint/imports.cue/omitempty-strings -- 180 *ast.File{ 181 Filename: "imports.cue" 182 Decls: []ast.Decl{ 183 *ast.Package{ 184 Name: *ast.Ident{ 185 Name: "p" 186 } 187 } 188 *ast.ImportDecl{ 189 Specs: []*ast.ImportSpec{ 190 { 191 Path: *ast.BasicLit{ 192 Value: "\"foo\"" 193 } 194 } 195 } 196 } 197 *ast.ImportDecl{ 198 Specs: []*ast.ImportSpec{ 199 { 200 Path: *ast.BasicLit{ 201 Value: "\"bar\"" 202 } 203 } 204 { 205 Name: *ast.Ident{ 206 Name: "name" 207 } 208 Path: *ast.BasicLit{ 209 Value: "\"baz\"" 210 } 211 } 212 } 213 } 214 } 215 Imports: []*ast.ImportSpec{ 216 { 217 Path: *ast.BasicLit{ 218 Value: "\"foo\"" 219 } 220 } 221 { 222 Path: *ast.BasicLit{ 223 Value: "\"bar\"" 224 } 225 } 226 { 227 Name: *ast.Ident{ 228 Name: "name" 229 } 230 Path: *ast.BasicLit{ 231 Value: "\"baz\"" 232 } 233 } 234 } 235 }