From 4ed8bfd72d7348f68cf9c551da84ab0a98049f82 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 11 Apr 2020 13:34:31 +1200 Subject: [PATCH] doc: update README status --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b235cf9..d68f467 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,13 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv - [X] Non-leaf function calls need to check + bubble errors [X] Array handling - [X] Infer whether to use slice/map for PHP array -[ ] Multi-file programs - - [ ] Include/Require [-] Namespaces - [X] Basic support for `namespace` -> package name transformation - [ ] Resolve namespace names in calls - [ ] Resolve `use` statements +[X] `if` +[X] `for`/`foreach` +[ ] `switch` [ ] Generators [ ] Numbered break/continue [ ] Goto @@ -41,7 +42,7 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv - 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) - [X] Add subtree walk + catch error for this case -[ ] Closures +[X] Closures - [ ] Handle value/reference captures [X] Convert top-level calls to `init()`/`main()` - [X] Wrap in function @@ -69,6 +70,8 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv ### Productionize +[ ] Multi-file programs + - [ ] Include/Require [ ] Infer whether to declare variable (`var` / `:=`) or reuse (`=`) - [ ] Track current visibility scope [ ] Comprehensive coverage of all AST node types @@ -76,6 +79,7 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv - [ ] Node - [ ] Stmt - [ ] Expr + - [ ] Assign - [X] Binary - [ ] Scalar - [ ] Heredocs/nowdocs @@ -91,6 +95,10 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv [ ] Simple standard library transformations - [X] common string/array functions - [ ] More string/array functions + - Top 100 from https://www.exakat.io/top-100-php-functions/ + - [ ] substr -> slice index operator (although that doesn't have the same reference semantics) + - [ ] error_reporting(E_ALL) --> just remove it + - [ ] ini_set('display_errors', 'On') --> remove it when the parameter is known [ ] Elide error return for functions that cannot throw - ?? Could be a standalone Go refactoring tool @@ -124,3 +132,8 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv - The parser does have full positional information - exporting at the stmt level would be reasonable - But the gofmt pass may lose this information [ ] Command-line tool option to `go run` + + +## Reference + +- [The Go Programming Language Specification](https://golang.org/ref/spec)