|
| 1 | +{ |
| 2 | + "name": "V03 design simple command substitution", |
| 3 | + "input": "Remove-Item $(Get-Item target.txt)", |
| 4 | + "powerShellInitialStateMode": "IsolatedNonInteractiveNoProfile", |
| 5 | + "expected": { |
| 6 | + "isUnparseable": false, |
| 7 | + "clauses": [ |
| 8 | + { |
| 9 | + "operator": "None", |
| 10 | + "verb": [ |
| 11 | + "Get-Item" |
| 12 | + ], |
| 13 | + "args": [ |
| 14 | + { |
| 15 | + "raw": "target.txt", |
| 16 | + "kind": "Literal", |
| 17 | + "isPath": true, |
| 18 | + "resolved": "C:/work/target.txt" |
| 19 | + } |
| 20 | + ], |
| 21 | + "redirects": [], |
| 22 | + "elements": [ |
| 23 | + { |
| 24 | + "raw": "Get-Item", |
| 25 | + "value": "Get-Item", |
| 26 | + "role": "Verb", |
| 27 | + "sourceStart": 14, |
| 28 | + "sourceLength": 8, |
| 29 | + "precedingVerbElementCount": 0, |
| 30 | + "kind": "Literal", |
| 31 | + "isFlag": false, |
| 32 | + "isPath": false |
| 33 | + }, |
| 34 | + { |
| 35 | + "raw": "target.txt", |
| 36 | + "value": "target.txt", |
| 37 | + "role": "Argument", |
| 38 | + "sourceStart": 23, |
| 39 | + "sourceLength": 10, |
| 40 | + "precedingVerbElementCount": 1, |
| 41 | + "kind": "Literal", |
| 42 | + "isFlag": false, |
| 43 | + "isPath": true, |
| 44 | + "resolved": "C:/work/target.txt" |
| 45 | + } |
| 46 | + ] |
| 47 | + }, |
| 48 | + { |
| 49 | + "operator": "None", |
| 50 | + "verb": [ |
| 51 | + "Remove-Item" |
| 52 | + ], |
| 53 | + "args": [ |
| 54 | + { |
| 55 | + "raw": "$(Get-Item target.txt)", |
| 56 | + "kind": "DynamicSkip", |
| 57 | + "isPath": false |
| 58 | + } |
| 59 | + ], |
| 60 | + "redirects": [], |
| 61 | + "elements": [ |
| 62 | + { |
| 63 | + "raw": "Remove-Item", |
| 64 | + "value": "Remove-Item", |
| 65 | + "role": "Verb", |
| 66 | + "sourceStart": 0, |
| 67 | + "sourceLength": 11, |
| 68 | + "precedingVerbElementCount": 0, |
| 69 | + "kind": "Literal", |
| 70 | + "isFlag": false, |
| 71 | + "isPath": false |
| 72 | + }, |
| 73 | + { |
| 74 | + "raw": "$(Get-Item target.txt)", |
| 75 | + "value": "$(Get-Item target.txt)", |
| 76 | + "role": "Argument", |
| 77 | + "sourceStart": 12, |
| 78 | + "sourceLength": 22, |
| 79 | + "precedingVerbElementCount": 1, |
| 80 | + "kind": "DynamicSkip", |
| 81 | + "isFlag": false, |
| 82 | + "isPath": false |
| 83 | + } |
| 84 | + ] |
| 85 | + } |
| 86 | + ], |
| 87 | + "syntax": [ |
| 88 | + { |
| 89 | + "kind": "Block", |
| 90 | + "parentIndex": null, |
| 91 | + "region": "Unknown", |
| 92 | + "childIndex": null, |
| 93 | + "sourceStart": 0, |
| 94 | + "sourceLength": 34, |
| 95 | + "clauseIndex": null, |
| 96 | + "groupKind": null, |
| 97 | + "listOperator": null |
| 98 | + }, |
| 99 | + { |
| 100 | + "kind": "SimpleCommand", |
| 101 | + "parentIndex": 0, |
| 102 | + "region": "Root", |
| 103 | + "childIndex": 0, |
| 104 | + "sourceStart": 0, |
| 105 | + "sourceLength": 34, |
| 106 | + "clauseIndex": 1, |
| 107 | + "groupKind": null, |
| 108 | + "listOperator": null |
| 109 | + }, |
| 110 | + { |
| 111 | + "kind": "CommandSubstitution", |
| 112 | + "parentIndex": 1, |
| 113 | + "region": "Substitution", |
| 114 | + "childIndex": 0, |
| 115 | + "sourceStart": 12, |
| 116 | + "sourceLength": 22, |
| 117 | + "clauseIndex": null, |
| 118 | + "groupKind": null, |
| 119 | + "listOperator": null |
| 120 | + }, |
| 121 | + { |
| 122 | + "kind": "Block", |
| 123 | + "parentIndex": 2, |
| 124 | + "region": "Substitution", |
| 125 | + "childIndex": 0, |
| 126 | + "sourceStart": 14, |
| 127 | + "sourceLength": 19, |
| 128 | + "clauseIndex": null, |
| 129 | + "groupKind": null, |
| 130 | + "listOperator": null |
| 131 | + }, |
| 132 | + { |
| 133 | + "kind": "SimpleCommand", |
| 134 | + "parentIndex": 3, |
| 135 | + "region": "Statement", |
| 136 | + "childIndex": 0, |
| 137 | + "sourceStart": 14, |
| 138 | + "sourceLength": 19, |
| 139 | + "clauseIndex": 0, |
| 140 | + "groupKind": null, |
| 141 | + "listOperator": null |
| 142 | + } |
| 143 | + ], |
| 144 | + "commands": [ |
| 145 | + { |
| 146 | + "clauseIndex": 0, |
| 147 | + "immediateRole": "Substitution", |
| 148 | + "isComplete": true, |
| 149 | + "ancestry": [ |
| 150 | + { |
| 151 | + "ancestorKind": "Block", |
| 152 | + "region": "Root", |
| 153 | + "childIndex": 0, |
| 154 | + "sourceStart": 0, |
| 155 | + "sourceLength": 34 |
| 156 | + }, |
| 157 | + { |
| 158 | + "ancestorKind": "CommandSubstitution", |
| 159 | + "region": "Substitution", |
| 160 | + "childIndex": 0, |
| 161 | + "sourceStart": 12, |
| 162 | + "sourceLength": 22 |
| 163 | + }, |
| 164 | + { |
| 165 | + "ancestorKind": "Block", |
| 166 | + "region": "Statement", |
| 167 | + "childIndex": 0, |
| 168 | + "sourceStart": 14, |
| 169 | + "sourceLength": 19 |
| 170 | + } |
| 171 | + ], |
| 172 | + "effectiveArguments": [], |
| 173 | + "workingDirectory": { |
| 174 | + "kind": "Exact", |
| 175 | + "values": [ |
| 176 | + "C:/work" |
| 177 | + ], |
| 178 | + "pattern": null, |
| 179 | + "coveringDirectory": null |
| 180 | + } |
| 181 | + }, |
| 182 | + { |
| 183 | + "clauseIndex": 1, |
| 184 | + "immediateRole": "Ordinary", |
| 185 | + "isComplete": true, |
| 186 | + "ancestry": [ |
| 187 | + { |
| 188 | + "ancestorKind": "Block", |
| 189 | + "region": "Root", |
| 190 | + "childIndex": 0, |
| 191 | + "sourceStart": 0, |
| 192 | + "sourceLength": 34 |
| 193 | + } |
| 194 | + ], |
| 195 | + "effectiveArguments": [ |
| 196 | + { |
| 197 | + "clauseElementIndex": 1, |
| 198 | + "value": { |
| 199 | + "kind": "Unknown", |
| 200 | + "values": [], |
| 201 | + "pattern": null, |
| 202 | + "coveringDirectory": null |
| 203 | + } |
| 204 | + } |
| 205 | + ], |
| 206 | + "workingDirectory": { |
| 207 | + "kind": "Exact", |
| 208 | + "values": [ |
| 209 | + "C:/work" |
| 210 | + ], |
| 211 | + "pattern": null, |
| 212 | + "coveringDirectory": null |
| 213 | + } |
| 214 | + } |
| 215 | + ] |
| 216 | + }, |
| 217 | + "notes": "Promotes stable design case pwsh-simple-command-substitution." |
| 218 | +} |
0 commit comments