github.com/solo-io/cue@v0.4.7/internal/core/export/testdata/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  -- out.txt --
    48  -- out/doc --
    49  []
    50  - foobar defines at least foo.
    51  
    52  [Foo]
    53  - A Foo fooses stuff.
    54  
    55  [Foo field1]
    56  - field1 is an int.
    57  
    58  [Foo field2]
    59  [Foo dup3]
    60  - duplicate field comment
    61  
    62  [foos]
    63  - foos are instances of Foo.
    64  
    65  [foos MyFoo]
    66  - My first little foo.
    67  
    68  [foos MyFoo field1]
    69  - local field comment.
    70  
    71  - field1 is an int.
    72  
    73  [foos MyFoo field2]
    74  - other field comment.
    75  
    76  [foos MyFoo dup3]
    77  - duplicate field comment
    78  
    79  [bar]
    80  [bar field1]
    81  - comment from bar on field 1
    82  
    83  [bar field2]
    84  - comment from bar on field 2
    85  
    86  [baz]
    87  [baz field1]
    88  - comment from bar on field 1
    89  
    90  - comment from baz on field 1
    91  
    92  [baz field2]
    93  - comment from bar on field 2
    94  
    95  -- out/definition --
    96  // foobar defines at least foo.
    97  package foobar
    98  
    99  // A Foo fooses stuff.
   100  Foo: {
   101  	// field1 is an int.
   102  	field1: int
   103  	field2: int
   104  
   105  	// duplicate field comment
   106  	dup3: int
   107  }
   108  
   109  // foos are instances of Foo.
   110  foos: {
   111  	{
   112  		[string]: Foo
   113  	}
   114  	MyFoo: {
   115  		// local field comment.
   116  		field1: 0
   117  
   118  		// other field comment.
   119  		field2: 1
   120  
   121  		// duplicate field comment
   122  		dup3: int
   123  	}
   124  }
   125  bar: {
   126  	// comment from bar on field 1
   127  	field1: int
   128  	// comment from bar on field 2
   129  	field2: int
   130  }
   131  baz: bar & {
   132  	// comment from baz on field 1
   133  	field1: int
   134  	field2: int
   135  }
   136  -- out/value --
   137  == Simplified
   138  {
   139  	// A Foo fooses stuff.
   140  	Foo: {
   141  		// field1 is an int.
   142  		field1: int
   143  		field2: int
   144  
   145  		// duplicate field comment
   146  		dup3: int
   147  	}
   148  
   149  	// foos are instances of Foo.
   150  	foos: {
   151  		// My first little foo.
   152  		MyFoo: {
   153  			// local field comment.
   154  
   155  			// field1 is an int.
   156  			field1: 0
   157  
   158  			// other field comment.
   159  			field2: 1
   160  
   161  			// duplicate field comment
   162  			dup3: int
   163  		}
   164  	}
   165  	bar: {
   166  		// comment from bar on field 1
   167  		field1: int
   168  		// comment from bar on field 2
   169  		field2: int
   170  	}
   171  	baz: {
   172  		// comment from bar on field 1
   173  
   174  		// comment from baz on field 1
   175  		field1: int
   176  		// comment from bar on field 2
   177  		field2: int
   178  	}
   179  }
   180  == Raw
   181  {
   182  	// A Foo fooses stuff.
   183  	Foo: {
   184  		// field1 is an int.
   185  		field1: int
   186  		field2: int
   187  
   188  		// duplicate field comment
   189  		dup3: int
   190  	}
   191  
   192  	// foos are instances of Foo.
   193  	foos: {
   194  		// My first little foo.
   195  		MyFoo: {
   196  			// local field comment.
   197  
   198  			// field1 is an int.
   199  			field1: 0
   200  
   201  			// other field comment.
   202  			field2: 1
   203  
   204  			// duplicate field comment
   205  			dup3: int
   206  		}
   207  	}
   208  	bar: {
   209  		// comment from bar on field 1
   210  		field1: int
   211  		// comment from bar on field 2
   212  		field2: int
   213  	}
   214  	baz: {
   215  		// comment from bar on field 1
   216  
   217  		// comment from baz on field 1
   218  		field1: int
   219  		// comment from bar on field 2
   220  		field2: int
   221  	}
   222  }
   223  == Final
   224  {
   225  	Foo: {
   226  		field1: int
   227  		field2: int
   228  		dup3:   int
   229  	}
   230  	foos: {
   231  		MyFoo: {
   232  			field1: 0
   233  			field2: 1
   234  			dup3:   int
   235  		}
   236  	}
   237  	bar: {
   238  		field1: int
   239  		field2: int
   240  	}
   241  	baz: {
   242  		field1: int
   243  		field2: int
   244  	}
   245  }
   246  == All
   247  {
   248  	// A Foo fooses stuff.
   249  	Foo: {
   250  		// field1 is an int.
   251  		field1: int
   252  		field2: int
   253  
   254  		// duplicate field comment
   255  		dup3: int
   256  	}
   257  
   258  	// foos are instances of Foo.
   259  	foos: {
   260  		// My first little foo.
   261  		MyFoo: {
   262  			// local field comment.
   263  
   264  			// field1 is an int.
   265  			field1: 0
   266  
   267  			// other field comment.
   268  			field2: 1
   269  
   270  			// duplicate field comment
   271  			dup3: int
   272  		}
   273  	}
   274  	bar: {
   275  		// comment from bar on field 1
   276  		field1: int
   277  		// comment from bar on field 2
   278  		field2: int
   279  	}
   280  	baz: {
   281  		// comment from bar on field 1
   282  
   283  		// comment from baz on field 1
   284  		field1: int
   285  		// comment from bar on field 2
   286  		field2: int
   287  	}
   288  }
   289  == Eval
   290  {
   291  	Foo: {
   292  		field1: int
   293  		field2: int
   294  		dup3:   int
   295  	}
   296  	foos: {
   297  		MyFoo: {
   298  			field1: 0
   299  			field2: 1
   300  			dup3:   int
   301  		}
   302  	}
   303  	bar: {
   304  		field1: int
   305  		field2: int
   306  	}
   307  	baz: {
   308  		field1: int
   309  		field2: int
   310  	}
   311  }