cuelang.org/go@v0.10.1/internal/core/export/testdata/selfcontained/alias.txtar (about)

     1  #path: a.b
     2  
     3  -- in.cue --
     4  E=ext: one: 1
     5  E1=("ext1"): two: 2
     6  E2=("ext2"): { three: 3, a: int}
     7  a: B=b: {
     8  	x: string
     9  	y: B.x
    10  
    11  	// TODO: use with non-concrete value. Right now, this causes the reference
    12  	// above to not shorten (it will point to b, instead of x, as x won't be
    13  	// reachable).
    14  	// Reevaluated after value aliases for embeddings are implemented.
    15  	z: "string"
    16  	X=(z): 4
    17  	Y=("y"): "foo"
    18  	enclosed: {
    19  		V=x: string
    20  		y: B.enclosed.x
    21  		z: V
    22  
    23  		// Comment.
    24  		labelX: X
    25  		labelY: Y
    26  	}
    27  	hoisted: {
    28  		"ext1": E
    29  		ext2: E
    30  		ext3: E1
    31  		ext4: E2
    32  		ext5: E2.a
    33  	}
    34  
    35  	other: [INNER=string]: name: INNER
    36  }
    37  
    38  [NAME=string]: b: name: NAME
    39  -- out/self/default --
    40  
    41  {
    42  	x: string
    43  	y: x
    44  
    45  	// TODO: use with non-concrete value. Right now, this causes the reference
    46  	// above to not shorten (it will point to b, instead of x, as x won't be
    47  	// reachable).
    48  	// Reevaluated after value aliases for embeddings are implemented.
    49  	z:     "string"
    50  	X=(z): 4
    51  	Y="y": "foo"
    52  	enclosed: {
    53  		V=x: string
    54  		y:   enclosed.x
    55  		z:   V
    56  
    57  		// Comment.
    58  		labelX: X
    59  		labelY: Y
    60  	}
    61  	hoisted: {
    62  		ext1: EXT
    63  		ext2: EXT
    64  		ext3: {
    65  			two: 2
    66  			b: {
    67  				name: "ext1"
    68  			}
    69  		}
    70  		ext4: EXT2
    71  		ext5: EXT2.a
    72  	}
    73  	other: {
    74  		[INNER=string]: {
    75  			name: INNER
    76  		}
    77  	}
    78  }
    79  name: "a"
    80  
    81  //cue:path: ext
    82  let EXT = {
    83  	one: 1
    84  	b: {
    85  		name: "ext"
    86  	}
    87  }
    88  
    89  //cue:path: ext2
    90  let EXT2 = {
    91  	three: 3
    92  	b: {
    93  		name: "ext2"
    94  	}
    95  	a: int
    96  }