cuelang.org/go@v0.13.0/encoding/toml/testdata/decode/example.txtar (about) 1 -- example.toml -- 2 # This is a TOML document. 3 # Copied from various examples from the TOML spec website. 4 5 title = "TOML Example" 6 7 [owner] 8 name = "Tom Preston-Werner" 9 dob = 1979-05-27T07:32:00-08:00 10 11 [database] 12 enabled = true 13 ports = [ 8000, 8001, 8002 ] 14 data = [ ["delta", "phi"], [3.14] ] 15 temp_targets = { cpu = 79.5, case = 72.0 } 16 17 [servers] 18 19 [servers.alpha] 20 ip = "10.0.0.1" 21 role = "frontend" 22 23 [servers.beta] 24 ip = "10.0.0.2" 25 role = "backend" 26 27 [[products]] 28 name = "Hammer" 29 sku = 738594937 30 31 [[products]] # empty table within the array 32 33 [[products]] 34 name = "Nail" 35 sku = 284758393 36 37 color = "gray" 38 -- out/decode/example.toml/positions -- 39 *ast.StructLit{ 40 Elts: []ast.Decl{ 41 *ast.Field{ 42 Label: *ast.Ident{ 43 NamePos: token.Pos("example.toml:4:1", newline) 44 } 45 Value: *ast.BasicLit{ 46 ValuePos: token.Pos("example.toml:4:9") 47 } 48 } 49 *ast.Field{ 50 Label: *ast.Ident{ 51 NamePos: token.Pos("example.toml:6:2", newline) 52 } 53 Value: *ast.StructLit{ 54 Lbrace: token.Pos("-", blank) 55 Elts: []ast.Decl{ 56 *ast.Field{ 57 Label: *ast.Ident{ 58 NamePos: token.Pos("example.toml:7:1", newline) 59 } 60 Value: *ast.BasicLit{ 61 ValuePos: token.Pos("example.toml:7:8") 62 } 63 } 64 *ast.Field{ 65 Label: *ast.Ident{ 66 NamePos: token.Pos("example.toml:8:1", newline) 67 } 68 } 69 } 70 Rbrace: token.Pos("-", newline) 71 } 72 } 73 *ast.Field{ 74 Label: *ast.Ident{ 75 NamePos: token.Pos("example.toml:10:2", newline) 76 } 77 Value: *ast.StructLit{ 78 Lbrace: token.Pos("-", blank) 79 Elts: []ast.Decl{ 80 *ast.Field{ 81 Label: *ast.Ident{ 82 NamePos: token.Pos("example.toml:11:1", newline) 83 } 84 } 85 *ast.Field{ 86 Label: *ast.Ident{ 87 NamePos: token.Pos("example.toml:12:1", newline) 88 } 89 Value: *ast.ListLit{ 90 Elts: []ast.Expr{ 91 *ast.BasicLit{ 92 ValuePos: token.Pos("example.toml:12:11") 93 } 94 *ast.BasicLit{ 95 ValuePos: token.Pos("example.toml:12:17") 96 } 97 *ast.BasicLit{ 98 ValuePos: token.Pos("example.toml:12:23") 99 } 100 } 101 } 102 } 103 *ast.Field{ 104 Label: *ast.Ident{ 105 NamePos: token.Pos("example.toml:13:1", newline) 106 } 107 Value: *ast.ListLit{ 108 Elts: []ast.Expr{ 109 *ast.ListLit{ 110 Elts: []ast.Expr{ 111 *ast.BasicLit{ 112 ValuePos: token.Pos("example.toml:13:11") 113 } 114 *ast.BasicLit{ 115 ValuePos: token.Pos("example.toml:13:20") 116 } 117 } 118 } 119 *ast.ListLit{ 120 Elts: []ast.Expr{ 121 *ast.BasicLit{ 122 ValuePos: token.Pos("example.toml:13:29") 123 } 124 } 125 } 126 } 127 } 128 } 129 *ast.Field{ 130 Label: *ast.Ident{ 131 NamePos: token.Pos("example.toml:14:1", newline) 132 } 133 Value: *ast.StructLit{ 134 Lbrace: token.Pos("example.toml:14:16") 135 Elts: []ast.Decl{ 136 *ast.Field{ 137 Label: *ast.Ident{ 138 NamePos: token.Pos("example.toml:14:18", blank) 139 } 140 Value: *ast.BasicLit{ 141 ValuePos: token.Pos("example.toml:14:24") 142 } 143 } 144 *ast.Field{ 145 Label: *ast.Ident{ 146 NamePos: token.Pos("example.toml:14:30", blank) 147 } 148 Value: *ast.BasicLit{ 149 ValuePos: token.Pos("example.toml:14:37") 150 } 151 } 152 } 153 Rbrace: token.Pos("-", blank) 154 } 155 } 156 } 157 Rbrace: token.Pos("-", newline) 158 } 159 } 160 *ast.Field{ 161 Label: *ast.Ident{ 162 NamePos: token.Pos("example.toml:16:2", newline) 163 } 164 Value: *ast.StructLit{ 165 Lbrace: token.Pos("-", blank) 166 Rbrace: token.Pos("-", newline) 167 } 168 } 169 *ast.Field{ 170 Label: *ast.Ident{ 171 NamePos: token.Pos("example.toml:18:2", newline) 172 } 173 Value: *ast.StructLit{ 174 Elts: []ast.Decl{ 175 *ast.Field{ 176 Label: *ast.Ident{ 177 NamePos: token.Pos("example.toml:18:10", blank) 178 } 179 Value: *ast.StructLit{ 180 Lbrace: token.Pos("-", blank) 181 Elts: []ast.Decl{ 182 *ast.Field{ 183 Label: *ast.Ident{ 184 NamePos: token.Pos("example.toml:19:1", newline) 185 } 186 Value: *ast.BasicLit{ 187 ValuePos: token.Pos("example.toml:19:6") 188 } 189 } 190 *ast.Field{ 191 Label: *ast.Ident{ 192 NamePos: token.Pos("example.toml:20:1", newline) 193 } 194 Value: *ast.BasicLit{ 195 ValuePos: token.Pos("example.toml:20:8") 196 } 197 } 198 } 199 Rbrace: token.Pos("-", newline) 200 } 201 } 202 } 203 } 204 } 205 *ast.Field{ 206 Label: *ast.Ident{ 207 NamePos: token.Pos("example.toml:22:2", newline) 208 } 209 Value: *ast.StructLit{ 210 Elts: []ast.Decl{ 211 *ast.Field{ 212 Label: *ast.Ident{ 213 NamePos: token.Pos("example.toml:22:10", blank) 214 } 215 Value: *ast.StructLit{ 216 Lbrace: token.Pos("-", blank) 217 Elts: []ast.Decl{ 218 *ast.Field{ 219 Label: *ast.Ident{ 220 NamePos: token.Pos("example.toml:23:1", newline) 221 } 222 Value: *ast.BasicLit{ 223 ValuePos: token.Pos("example.toml:23:6") 224 } 225 } 226 *ast.Field{ 227 Label: *ast.Ident{ 228 NamePos: token.Pos("example.toml:24:1", newline) 229 } 230 Value: *ast.BasicLit{ 231 ValuePos: token.Pos("example.toml:24:8") 232 } 233 } 234 } 235 Rbrace: token.Pos("-", newline) 236 } 237 } 238 } 239 } 240 } 241 *ast.Field{ 242 Label: *ast.Ident{ 243 NamePos: token.Pos("example.toml:26:3", newline) 244 } 245 Value: *ast.ListLit{ 246 Lbrack: token.Pos("-", blank) 247 Elts: []ast.Expr{ 248 *ast.StructLit{ 249 Lbrace: token.Pos("-", newline) 250 Elts: []ast.Decl{ 251 *ast.Field{ 252 Label: *ast.Ident{ 253 NamePos: token.Pos("example.toml:27:1", newline) 254 } 255 Value: *ast.BasicLit{ 256 ValuePos: token.Pos("example.toml:27:8") 257 } 258 } 259 *ast.Field{ 260 Label: *ast.Ident{ 261 NamePos: token.Pos("example.toml:28:1", newline) 262 } 263 Value: *ast.BasicLit{ 264 ValuePos: token.Pos("example.toml:28:7") 265 } 266 } 267 } 268 Rbrace: token.Pos("-", newline) 269 } 270 *ast.StructLit{ 271 Lbrace: token.Pos("-", newline) 272 Rbrace: token.Pos("-", newline) 273 } 274 *ast.StructLit{ 275 Lbrace: token.Pos("-", newline) 276 Elts: []ast.Decl{ 277 *ast.Field{ 278 Label: *ast.Ident{ 279 NamePos: token.Pos("example.toml:33:1", newline) 280 } 281 Value: *ast.BasicLit{ 282 ValuePos: token.Pos("example.toml:33:8") 283 } 284 } 285 *ast.Field{ 286 Label: *ast.Ident{ 287 NamePos: token.Pos("example.toml:34:1", newline) 288 } 289 Value: *ast.BasicLit{ 290 ValuePos: token.Pos("example.toml:34:7") 291 } 292 } 293 *ast.Field{ 294 Label: *ast.Ident{ 295 NamePos: token.Pos("example.toml:36:1", newline) 296 } 297 Value: *ast.BasicLit{ 298 ValuePos: token.Pos("example.toml:36:9") 299 } 300 } 301 } 302 Rbrace: token.Pos("-", newline) 303 } 304 } 305 Rbrack: token.Pos("-", newline) 306 } 307 } 308 } 309 }