(t *testing.T)
| 240 | } |
| 241 | |
| 242 | func TestYieldKeyExpr(t *testing.T) { |
| 243 | src := `<? yield $a => 1;` |
| 244 | |
| 245 | expected := &node.Root{ |
| 246 | Position: &position.Position{ |
| 247 | StartLine: 1, |
| 248 | EndLine: 1, |
| 249 | StartPos: 3, |
| 250 | EndPos: 17, |
| 251 | }, |
| 252 | Stmts: []node.Node{ |
| 253 | &stmt.Expression{ |
| 254 | Position: &position.Position{ |
| 255 | StartLine: 1, |
| 256 | EndLine: 1, |
| 257 | StartPos: 3, |
| 258 | EndPos: 17, |
| 259 | }, |
| 260 | Expr: &expr.Yield{ |
| 261 | Position: &position.Position{ |
| 262 | StartLine: 1, |
| 263 | EndLine: 1, |
| 264 | StartPos: 3, |
| 265 | EndPos: 16, |
| 266 | }, |
| 267 | Key: &expr.Variable{ |
| 268 | Position: &position.Position{ |
| 269 | StartLine: 1, |
| 270 | EndLine: 1, |
| 271 | StartPos: 9, |
| 272 | EndPos: 11, |
| 273 | }, |
| 274 | VarName: &node.Identifier{ |
| 275 | Position: &position.Position{ |
| 276 | StartLine: 1, |
| 277 | EndLine: 1, |
| 278 | StartPos: 9, |
| 279 | EndPos: 11, |
| 280 | }, |
| 281 | Value: "a", |
| 282 | }, |
| 283 | }, |
| 284 | Value: &scalar.Lnumber{ |
| 285 | Position: &position.Position{ |
| 286 | StartLine: 1, |
| 287 | EndLine: 1, |
| 288 | StartPos: 15, |
| 289 | EndPos: 16, |
| 290 | }, |
| 291 | Value: "1", |
| 292 | }, |
| 293 | }, |
| 294 | }, |
| 295 | }, |
| 296 | } |
| 297 | |
| 298 | php7parser := php7.NewParser([]byte(src), "7.4") |
| 299 | php7parser.Parse() |
nothing calls this directly
no test coverage detected
searching dependent graphs…