From 2568412a508d1dd88e7a776d51c466707c726131 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 5 Apr 2020 19:41:21 +1200 Subject: [PATCH] stmt: add failing test for assignment expressions (need hoisting) --- README.md | 3 +++ fixtures/0006-expression-assignment.php | 11 +++++++++++ node.go | 9 +++++++++ 3 files changed, 23 insertions(+) create mode 100644 fixtures/0006-expression-assignment.php diff --git a/README.md b/README.md index 2cc48d7..a8cbb2c 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv [ ] `instanceof` [ ] `try`/`catch`/`finally` [ ] Abandon upon sight of `eval` / `extract` / ... +[ ] Assignment expressions + - Go doesn't support assignment in rvalues, only as a statement + - When walking below stmt level, need to first fully walk and check for any function calls + assignments that may need hoisting (and we can probably only do that correctly if there is no short-circuiting) [ ] Closures - [ ] Handle value/reference captures [ ] Sort callbacks diff --git a/fixtures/0006-expression-assignment.php b/fixtures/0006-expression-assignment.php new file mode 100644 index 0000000..0c7648b --- /dev/null +++ b/fixtures/0006-expression-assignment.php @@ -0,0 +1,11 @@ +