...

Text file src/cuelang.org/go/cue/testdata/definitions/issue491.txtar

Documentation: cuelang.org/go/cue/testdata/definitions

     1-- in.cue --
     2package x
     3
     4#Prestep: {
     5	Args: *null | _
     6}
     7
     8#PrestepNewUser: #Prestep & {
     9	Args: #NewUser
    10}
    11
    12#NewUser: {
    13	Repos: [...#Repo]
    14}
    15
    16#Repo: {
    17	Var:     string
    18	Pattern: *"*" | string
    19}
    20
    21x: [...#Repo]
    22x: [{
    23	Var: "REPO1"
    24}]
    25
    26y: #Repo & {
    27	Var: "REPO1"
    28}
    29
    30z: #PrestepNewUser & {
    31	Args: {
    32		Repos: [{
    33			Var: "REPO1"
    34		}]
    35	}
    36}
    37-- out/eval/stats --
    38Leaks:  0
    39Freed:  45
    40Reused: 36
    41Allocs: 9
    42Retain: 1
    43
    44Unifications: 29
    45Conjuncts:    71
    46Disjuncts:    46
    47-- out/eval --
    48(struct){
    49  #Prestep: (#struct){
    50    Args: (_){ |(*(null){ null }, (_){ _ }) }
    51  }
    52  #PrestepNewUser: (#struct){
    53    Args: (#struct){
    54      Repos: (list){
    55      }
    56    }
    57  }
    58  #NewUser: (#struct){
    59    Repos: (list){
    60    }
    61  }
    62  #Repo: (#struct){
    63    Var: (string){ string }
    64    Pattern: (string){ |(*(string){ "*" }, (string){ string }) }
    65  }
    66  x: (#list){
    67    0: (#struct){
    68      Var: (string){ "REPO1" }
    69      Pattern: (string){ |(*(string){ "*" }, (string){ string }) }
    70    }
    71  }
    72  y: (#struct){
    73    Var: (string){ "REPO1" }
    74    Pattern: (string){ |(*(string){ "*" }, (string){ string }) }
    75  }
    76  z: (#struct){
    77    Args: (#struct){
    78      Repos: (#list){
    79        0: (#struct){
    80          Var: (string){ "REPO1" }
    81          Pattern: (string){ |(*(string){ "*" }, (string){ string }) }
    82        }
    83      }
    84    }
    85  }
    86}
    87-- out/compile --
    88--- in.cue
    89{
    90  #Prestep: {
    91    Args: (*null|_)
    92  }
    93  #PrestepNewUser: (〈0;#Prestep〉 & {
    94    Args: 〈1;#NewUser〉
    95  })
    96  #NewUser: {
    97    Repos: [
    98      ...〈2;#Repo〉,
    99    ]
   100  }
   101  #Repo: {
   102    Var: string
   103    Pattern: (*"*"|string)
   104  }
   105  x: [
   106    ...〈1;#Repo〉,
   107  ]
   108  x: [
   109    {
   110      Var: "REPO1"
   111    },
   112  ]
   113  y: (〈0;#Repo〉 & {
   114    Var: "REPO1"
   115  })
   116  z: (〈0;#PrestepNewUser〉 & {
   117    Args: {
   118      Repos: [
   119        {
   120          Var: "REPO1"
   121        },
   122      ]
   123    }
   124  })
   125}

View as plain text