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

     1  -- in.cue --
     2  x: string
     3  X=(x): 4
     4  Y=(x): 6
     5  Z=("y"): int
     6  a: {
     7  	labelX: X
     8  	labelY: Y
     9  	labelZ: Z
    10  }
    11  E=["cue"]: name: E | null
    12  
    13  q: "q"
    14  q1: "q1"
    15  r: "r"
    16  r1: "r1"
    17  ("s-"+q)?: 1
    18  ("s-"+r)!: 2
    19  ("s-"+q1)?: (r1)!: 3
    20  -- out/definition --
    21  x:     string
    22  X=(x): 4
    23  Y=(x): 6
    24  Z="y": int
    25  a: {
    26  	labelX: X
    27  	labelY: Y
    28  	labelZ: Z
    29  }
    30  E=["cue"]: {
    31  	name: E | null
    32  }
    33  q:      "q"
    34  q1:     "q1"
    35  r:      "r"
    36  r1:     "r1"
    37  "s-q"?: 1
    38  "s-r"!: 2
    39  "s-q1"?: {
    40  	(r1)!: 3
    41  }
    42  -- out/doc-v3 --
    43  []
    44  [x]
    45  [a]
    46  [a labelX]
    47  [a labelY]
    48  [a labelZ]
    49  [q]
    50  [q1]
    51  [r]
    52  [r1]
    53  [y]
    54  ["s-q"]
    55  ["s-r"]
    56  ["s-q1"]
    57  -- diff/-out/doc-v3<==>+out/doc --
    58  diff old new
    59  --- old
    60  +++ new
    61  @@ -8,9 +8,7 @@
    62   [q1]
    63   [r]
    64   [r1]
    65  -[_]
    66   [y]
    67   ["s-q"]
    68   ["s-r"]
    69   ["s-q1"]
    70  -["s-q1" r1]
    71  -- diff/out/todo/p3 --
    72  One missing entry is the result of the new evaluator not generating a
    73  bogus field for a failed dynamic field.
    74  The second one results from the fact that the new evaluator does not
    75  resolve `r1`, but rather propagates the error of the top-level node.
    76  This is probably okay.
    77  -- out/doc --
    78  []
    79  [x]
    80  [a]
    81  [a labelX]
    82  [a labelY]
    83  [a labelZ]
    84  [q]
    85  [q1]
    86  [r]
    87  [r1]
    88  [_]
    89  [y]
    90  ["s-q"]
    91  ["s-r"]
    92  ["s-q1"]
    93  ["s-q1" r1]
    94  -- out/value-v3 --
    95  == Simplified
    96  {
    97  	x:     string
    98  	X=(x): 4
    99  	Y=(x): 6
   100  	Z="y": int
   101  	a: {
   102  		labelX: X
   103  		labelY: Y
   104  		labelZ: Z
   105  	}
   106  	E=["cue"]: {
   107  		name: E | null
   108  	}
   109  	q:           "q"
   110  	q1:          "q1"
   111  	r:           "r"
   112  	r1:          "r1"
   113  	("s-" + q)?: 1
   114  	("s-" + r)!: 2
   115  	("s-" + q1)?: {
   116  		(r1)!: 3
   117  	}
   118  }
   119  == Raw
   120  {
   121  	x:     string
   122  	X=(x): 4
   123  	Y=(x): 6
   124  	Z="y": int
   125  	a: {
   126  		labelX: X
   127  		labelY: Y
   128  		labelZ: Z
   129  	}
   130  	E=["cue"]: {
   131  		name: E | null
   132  	}
   133  	q:           "q"
   134  	q1:          "q1"
   135  	r:           "r"
   136  	r1:          "r1"
   137  	("s-" + q)?: 1
   138  	("s-" + r)!: 2
   139  	("s-" + q1)?: {
   140  		(r1)!: 3
   141  	}
   142  }
   143  == Final
   144  _|_ // key value of dynamic field must be concrete, found string (and 2 more errors)
   145  == All
   146  {
   147  	x:     string
   148  	X=(x): 4
   149  	Y=(x): 6
   150  	Z="y": int
   151  	a: {
   152  		labelX: X
   153  		labelY: Y
   154  		labelZ: Z
   155  	}
   156  	E=["cue"]: {
   157  		name: E | null
   158  	}
   159  	q:           "q"
   160  	q1:          "q1"
   161  	r:           "r"
   162  	r1:          "r1"
   163  	("s-" + q)?: 1
   164  	("s-" + r)!: 2
   165  	("s-" + q1)?: {
   166  		(r1)!: 3
   167  	}
   168  }
   169  == Eval
   170  {
   171  	x:     string
   172  	X=(x): 4
   173  	Y=(x): 6
   174  	Z="y": int
   175  	a: {
   176  		labelX: X
   177  		labelY: Y
   178  		labelZ: Z
   179  	}
   180  	E=["cue"]: {
   181  		name: E | null
   182  	}
   183  	q:           "q"
   184  	q1:          "q1"
   185  	r:           "r"
   186  	r1:          "r1"
   187  	("s-" + q)?: 1
   188  	("s-" + r)!: 2
   189  	("s-" + q1)?: {
   190  		(r1)!: 3
   191  	}
   192  }
   193  -- diff/-out/value-v3<==>+out/value --
   194  diff old new
   195  --- old
   196  +++ new
   197  @@ -1,10 +1,98 @@
   198   == Simplified
   199  -_|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   200  +{
   201  +	x:     string
   202  +	X=(x): 4
   203  +	Y=(x): 6
   204  +	Z="y": int
   205  +	a: {
   206  +		labelX: X
   207  +		labelY: Y
   208  +		labelZ: Z
   209  +	}
   210  +	E=["cue"]: {
   211  +		name: E | null
   212  +	}
   213  +	q:           "q"
   214  +	q1:          "q1"
   215  +	r:           "r"
   216  +	r1:          "r1"
   217  +	("s-" + q)?: 1
   218  +	("s-" + r)!: 2
   219  +	("s-" + q1)?: {
   220  +		(r1)!: 3
   221  +	}
   222  +}
   223   == Raw
   224  -_|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   225  +{
   226  +	x:     string
   227  +	X=(x): 4
   228  +	Y=(x): 6
   229  +	Z="y": int
   230  +	a: {
   231  +		labelX: X
   232  +		labelY: Y
   233  +		labelZ: Z
   234  +	}
   235  +	E=["cue"]: {
   236  +		name: E | null
   237  +	}
   238  +	q:           "q"
   239  +	q1:          "q1"
   240  +	r:           "r"
   241  +	r1:          "r1"
   242  +	("s-" + q)?: 1
   243  +	("s-" + r)!: 2
   244  +	("s-" + q1)?: {
   245  +		(r1)!: 3
   246  +	}
   247  +}
   248   == Final
   249  -_|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   250  +_|_ // key value of dynamic field must be concrete, found string (and 2 more errors)
   251   == All
   252  -_|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   253  +{
   254  +	x:     string
   255  +	X=(x): 4
   256  +	Y=(x): 6
   257  +	Z="y": int
   258  +	a: {
   259  +		labelX: X
   260  +		labelY: Y
   261  +		labelZ: Z
   262  +	}
   263  +	E=["cue"]: {
   264  +		name: E | null
   265  +	}
   266  +	q:           "q"
   267  +	q1:          "q1"
   268  +	r:           "r"
   269  +	r1:          "r1"
   270  +	("s-" + q)?: 1
   271  +	("s-" + r)!: 2
   272  +	("s-" + q1)?: {
   273  +		(r1)!: 3
   274  +	}
   275  +}
   276   == Eval
   277  -_|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   278  +{
   279  +	x:     string
   280  +	X=(x): 4
   281  +	Y=(x): 6
   282  +	Z="y": int
   283  +	a: {
   284  +		labelX: X
   285  +		labelY: Y
   286  +		labelZ: Z
   287  +	}
   288  +	E=["cue"]: {
   289  +		name: E | null
   290  +	}
   291  +	q:           "q"
   292  +	q1:          "q1"
   293  +	r:           "r"
   294  +	r1:          "r1"
   295  +	("s-" + q)?: 1
   296  +	("s-" + r)!: 2
   297  +	("s-" + q1)?: {
   298  +		(r1)!: 3
   299  +	}
   300  +}
   301  -- diff/value/todo/p0 --
   302  Ignored errors?
   303  -- out/value --
   304  == Simplified
   305  _|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   306  == Raw
   307  _|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   308  == Final
   309  _|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   310  == All
   311  _|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)
   312  == Eval
   313  _|_ // invalid non-ground value string (must be concrete string) (and 1 more errors)