cuelang.org/go@v0.10.1/internal/core/export/testdata/main/docs.txtar (about) 1 2 -- in.cue -- 3 // foobar defines at least foo. 4 package foobar 5 6 // A Foo fooses stuff. 7 Foo: { 8 // field1 is an int. 9 field1: int 10 11 field2: int 12 13 // duplicate field comment 14 dup3: int 15 } 16 17 // foos are instances of Foo. 18 foos: [string]: Foo 19 20 // My first little foo. 21 foos: MyFoo: { 22 // local field comment. 23 field1: 0 24 25 // Dangling comment. 26 27 // other field comment. 28 field2: 1 29 30 // duplicate field comment 31 dup3: int 32 } 33 34 bar: { 35 // comment from bar on field 1 36 field1: int 37 // comment from bar on field 2 38 field2: int // don't include this 39 } 40 41 baz: bar & { 42 // comment from baz on field 1 43 field1: int 44 field2: int 45 } 46 47 sub: { 48 // comment on comprehension 49 if true { 50 // comment inside of if comprehension 51 field1: int 52 } 53 54 // comprehension with nesting. 55 for x in [1] 56 // nested let 57 let y = x 58 // nested for 59 for z in [y] 60 61 // nested if 62 if z == 1 { 63 innerField: y 64 } 65 66 } 67 -- out.txt -- 68 -- out/doc-v3 -- 69 [] 70 - foobar defines at least foo. 71 72 [Foo] 73 - A Foo fooses stuff. 74 75 [Foo field1] 76 - field1 is an int. 77 78 [Foo field2] 79 [Foo dup3] 80 - duplicate field comment 81 82 [foos] 83 - foos are instances of Foo. 84 85 [foos MyFoo] 86 - My first little foo. 87 88 [foos MyFoo field1] 89 - local field comment. 90 91 - field1 is an int. 92 93 [foos MyFoo field2] 94 - other field comment. 95 96 [foos MyFoo dup3] 97 - duplicate field comment 98 99 [bar] 100 [bar field1] 101 - comment from bar on field 1 102 103 [bar field2] 104 - comment from bar on field 2 105 106 [baz] 107 [baz field1] 108 - comment from baz on field 1 109 110 - comment from bar on field 1 111 112 [baz field2] 113 - comment from bar on field 2 114 115 [sub] 116 [sub field1] 117 - comment inside of if comprehension 118 119 [sub innerField] 120 -- diff/-out/doc-v3<==>+out/doc -- 121 diff old new 122 --- old 123 +++ new 124 @@ -37,10 +37,10 @@ 125 126 [baz] 127 [baz field1] 128 -- comment from bar on field 1 129 - 130 - comment from baz on field 1 131 132 +- comment from bar on field 1 133 + 134 [baz field2] 135 - comment from bar on field 2 136 137 -- diff/out/explanation -- 138 Reordering. 139 -- out/doc -- 140 [] 141 - foobar defines at least foo. 142 143 [Foo] 144 - A Foo fooses stuff. 145 146 [Foo field1] 147 - field1 is an int. 148 149 [Foo field2] 150 [Foo dup3] 151 - duplicate field comment 152 153 [foos] 154 - foos are instances of Foo. 155 156 [foos MyFoo] 157 - My first little foo. 158 159 [foos MyFoo field1] 160 - local field comment. 161 162 - field1 is an int. 163 164 [foos MyFoo field2] 165 - other field comment. 166 167 [foos MyFoo dup3] 168 - duplicate field comment 169 170 [bar] 171 [bar field1] 172 - comment from bar on field 1 173 174 [bar field2] 175 - comment from bar on field 2 176 177 [baz] 178 [baz field1] 179 - comment from bar on field 1 180 181 - comment from baz on field 1 182 183 [baz field2] 184 - comment from bar on field 2 185 186 [sub] 187 [sub field1] 188 - comment inside of if comprehension 189 190 [sub innerField] 191 -- out/definition -- 192 // foobar defines at least foo. 193 package foobar 194 195 // A Foo fooses stuff. 196 Foo: { 197 // field1 is an int. 198 field1: int 199 field2: int 200 201 // duplicate field comment 202 dup3: int 203 } 204 205 // foos are instances of Foo. 206 foos: { 207 { 208 [string]: Foo 209 } 210 MyFoo: { 211 // local field comment. 212 field1: 0 213 214 // other field comment. 215 field2: 1 216 217 // duplicate field comment 218 dup3: int 219 } 220 } 221 bar: { 222 // comment from bar on field 1 223 field1: int 224 // comment from bar on field 2 225 field2: int 226 } 227 baz: bar & { 228 // comment from baz on field 1 229 field1: int 230 field2: int 231 } 232 sub: { 233 // comment on comprehension 234 if true { 235 // comment inside of if comprehension 236 field1: int 237 } 238 239 // comprehension with nesting. 240 for x in [1] 241 // nested let 242 let y = x 243 // nested for 244 for z in [y] 245 246 // nested if 247 if z == 1 { 248 innerField: y 249 } 250 } 251 -- out/value-v3 -- 252 == Simplified 253 { 254 // A Foo fooses stuff. 255 Foo: { 256 // field1 is an int. 257 field1: int 258 field2: int 259 260 // duplicate field comment 261 dup3: int 262 } 263 264 // foos are instances of Foo. 265 foos: { 266 // My first little foo. 267 MyFoo: { 268 // local field comment. 269 270 // field1 is an int. 271 field1: 0 272 273 // other field comment. 274 field2: 1 275 276 // duplicate field comment 277 dup3: int 278 } 279 } 280 bar: { 281 // comment from bar on field 1 282 field1: int 283 // comment from bar on field 2 284 field2: int 285 } 286 baz: { 287 // comment from baz on field 1 288 289 // comment from bar on field 1 290 field1: int 291 // comment from bar on field 2 292 field2: int 293 } 294 sub: { 295 // comment inside of if comprehension 296 field1: int 297 innerField: 1 298 } 299 } 300 == Raw 301 { 302 // A Foo fooses stuff. 303 Foo: { 304 // field1 is an int. 305 field1: int 306 field2: int 307 308 // duplicate field comment 309 dup3: int 310 } 311 312 // foos are instances of Foo. 313 foos: { 314 // My first little foo. 315 MyFoo: { 316 // local field comment. 317 318 // field1 is an int. 319 field1: 0 320 321 // other field comment. 322 field2: 1 323 324 // duplicate field comment 325 dup3: int 326 } 327 } 328 bar: { 329 // comment from bar on field 1 330 field1: int 331 // comment from bar on field 2 332 field2: int 333 } 334 baz: { 335 // comment from baz on field 1 336 337 // comment from bar on field 1 338 field1: int 339 // comment from bar on field 2 340 field2: int 341 } 342 sub: { 343 // comment inside of if comprehension 344 field1: int 345 innerField: 1 346 } 347 } 348 == Final 349 { 350 Foo: { 351 field1: int 352 field2: int 353 dup3: int 354 } 355 foos: { 356 MyFoo: { 357 field1: 0 358 field2: 1 359 dup3: int 360 } 361 } 362 bar: { 363 field1: int 364 field2: int 365 } 366 baz: { 367 field1: int 368 field2: int 369 } 370 sub: { 371 field1: int 372 innerField: 1 373 } 374 } 375 == All 376 { 377 // A Foo fooses stuff. 378 Foo: { 379 // field1 is an int. 380 field1: int 381 field2: int 382 383 // duplicate field comment 384 dup3: int 385 } 386 387 // foos are instances of Foo. 388 foos: { 389 // My first little foo. 390 MyFoo: { 391 // local field comment. 392 393 // field1 is an int. 394 field1: 0 395 396 // other field comment. 397 field2: 1 398 399 // duplicate field comment 400 dup3: int 401 } 402 } 403 bar: { 404 // comment from bar on field 1 405 field1: int 406 // comment from bar on field 2 407 field2: int 408 } 409 baz: { 410 // comment from baz on field 1 411 412 // comment from bar on field 1 413 field1: int 414 // comment from bar on field 2 415 field2: int 416 } 417 sub: { 418 // comment inside of if comprehension 419 field1: int 420 innerField: 1 421 } 422 } 423 == Eval 424 { 425 Foo: { 426 field1: int 427 field2: int 428 dup3: int 429 } 430 foos: { 431 MyFoo: { 432 field1: 0 433 field2: 1 434 dup3: int 435 } 436 } 437 bar: { 438 field1: int 439 field2: int 440 } 441 baz: { 442 field1: int 443 field2: int 444 } 445 sub: { 446 field1: int 447 innerField: 1 448 } 449 } 450 -- diff/-out/value-v3<==>+out/value -- 451 diff old new 452 --- old 453 +++ new 454 @@ -33,9 +33,9 @@ 455 field2: int 456 } 457 baz: { 458 - // comment from bar on field 1 459 - 460 - // comment from baz on field 1 461 + // comment from baz on field 1 462 + 463 + // comment from bar on field 1 464 field1: int 465 // comment from bar on field 2 466 field2: int 467 @@ -81,9 +81,9 @@ 468 field2: int 469 } 470 baz: { 471 - // comment from bar on field 1 472 - 473 - // comment from baz on field 1 474 + // comment from baz on field 1 475 + 476 + // comment from bar on field 1 477 field1: int 478 // comment from bar on field 2 479 field2: int 480 @@ -156,9 +156,9 @@ 481 field2: int 482 } 483 baz: { 484 - // comment from bar on field 1 485 - 486 - // comment from baz on field 1 487 + // comment from baz on field 1 488 + 489 + // comment from bar on field 1 490 field1: int 491 // comment from bar on field 2 492 field2: int 493 -- diff/value/explanation -- 494 Reordering. 495 -- out/value -- 496 == Simplified 497 { 498 // A Foo fooses stuff. 499 Foo: { 500 // field1 is an int. 501 field1: int 502 field2: int 503 504 // duplicate field comment 505 dup3: int 506 } 507 508 // foos are instances of Foo. 509 foos: { 510 // My first little foo. 511 MyFoo: { 512 // local field comment. 513 514 // field1 is an int. 515 field1: 0 516 517 // other field comment. 518 field2: 1 519 520 // duplicate field comment 521 dup3: int 522 } 523 } 524 bar: { 525 // comment from bar on field 1 526 field1: int 527 // comment from bar on field 2 528 field2: int 529 } 530 baz: { 531 // comment from bar on field 1 532 533 // comment from baz on field 1 534 field1: int 535 // comment from bar on field 2 536 field2: int 537 } 538 sub: { 539 // comment inside of if comprehension 540 field1: int 541 innerField: 1 542 } 543 } 544 == Raw 545 { 546 // A Foo fooses stuff. 547 Foo: { 548 // field1 is an int. 549 field1: int 550 field2: int 551 552 // duplicate field comment 553 dup3: int 554 } 555 556 // foos are instances of Foo. 557 foos: { 558 // My first little foo. 559 MyFoo: { 560 // local field comment. 561 562 // field1 is an int. 563 field1: 0 564 565 // other field comment. 566 field2: 1 567 568 // duplicate field comment 569 dup3: int 570 } 571 } 572 bar: { 573 // comment from bar on field 1 574 field1: int 575 // comment from bar on field 2 576 field2: int 577 } 578 baz: { 579 // comment from bar on field 1 580 581 // comment from baz on field 1 582 field1: int 583 // comment from bar on field 2 584 field2: int 585 } 586 sub: { 587 // comment inside of if comprehension 588 field1: int 589 innerField: 1 590 } 591 } 592 == Final 593 { 594 Foo: { 595 field1: int 596 field2: int 597 dup3: int 598 } 599 foos: { 600 MyFoo: { 601 field1: 0 602 field2: 1 603 dup3: int 604 } 605 } 606 bar: { 607 field1: int 608 field2: int 609 } 610 baz: { 611 field1: int 612 field2: int 613 } 614 sub: { 615 field1: int 616 innerField: 1 617 } 618 } 619 == All 620 { 621 // A Foo fooses stuff. 622 Foo: { 623 // field1 is an int. 624 field1: int 625 field2: int 626 627 // duplicate field comment 628 dup3: int 629 } 630 631 // foos are instances of Foo. 632 foos: { 633 // My first little foo. 634 MyFoo: { 635 // local field comment. 636 637 // field1 is an int. 638 field1: 0 639 640 // other field comment. 641 field2: 1 642 643 // duplicate field comment 644 dup3: int 645 } 646 } 647 bar: { 648 // comment from bar on field 1 649 field1: int 650 // comment from bar on field 2 651 field2: int 652 } 653 baz: { 654 // comment from bar on field 1 655 656 // comment from baz on field 1 657 field1: int 658 // comment from bar on field 2 659 field2: int 660 } 661 sub: { 662 // comment inside of if comprehension 663 field1: int 664 innerField: 1 665 } 666 } 667 == Eval 668 { 669 Foo: { 670 field1: int 671 field2: int 672 dup3: int 673 } 674 foos: { 675 MyFoo: { 676 field1: 0 677 field2: 1 678 dup3: int 679 } 680 } 681 bar: { 682 field1: int 683 field2: int 684 } 685 baz: { 686 field1: int 687 field2: int 688 } 689 sub: { 690 field1: int 691 innerField: 1 692 } 693 }