doc: update README status
This commit is contained in:
parent
f86631880b
commit
e82a4bb1c4
62
README.md
62
README.md
@ -6,31 +6,21 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv
|
|||||||
|
|
||||||
## Progress
|
## Progress
|
||||||
|
|
||||||
|
### Phase 1
|
||||||
|
|
||||||
[X] Convert some small programs
|
[X] Convert some small programs
|
||||||
[X] Error handling
|
[X] Error handling
|
||||||
- [X] All functions return `(type, error)`
|
- [X] All functions return `(type, error)`
|
||||||
- [X] Convert `throw` to err return
|
- [X] Convert `throw` to err return
|
||||||
- [ ] Elide error return for functions that cannot throw
|
|
||||||
- ?? Could be a standalone Go refactoring tool
|
|
||||||
- [X] Non-leaf function calls need to check + bubble errors
|
- [X] Non-leaf function calls need to check + bubble errors
|
||||||
- [ ] Behaviour of function calls in rvalue cases where err cannot be checked
|
|
||||||
[ ] Comprehensive coverage of all AST node types
|
|
||||||
- [ ] Node
|
|
||||||
- [ ] Stmt
|
|
||||||
- [ ] Expr
|
|
||||||
- [X] Binary
|
|
||||||
- [ ] Scalar
|
|
||||||
- [ ] Heredocs/nowdocs
|
|
||||||
[X] Array handling
|
[X] Array handling
|
||||||
- [X] Infer whether to use slice/map for PHP array
|
- [X] Infer whether to use slice/map for PHP array
|
||||||
- [ ] Infer whether map use should be order-preserving
|
|
||||||
[ ] Multi-file programs
|
[ ] Multi-file programs
|
||||||
- [ ] Include/Require
|
- [ ] Include/Require
|
||||||
[X] Namespaces
|
[-] Namespaces
|
||||||
- [X] Basic support for `namespace` -> package name transformation
|
- [X] Basic support for `namespace` -> package name transformation
|
||||||
- [ ] Namespace resolution in calls
|
- [ ] Resolve namespace names in calls
|
||||||
- [ ] `use`
|
- [ ] Resolve `use` statements
|
||||||
- [ ] Support scoped namespace (`namespace { ... }`) and multiple namespaces in file
|
|
||||||
[ ] Generators
|
[ ] Generators
|
||||||
[ ] Numbered break/continue
|
[ ] Numbered break/continue
|
||||||
[ ] Goto
|
[ ] Goto
|
||||||
@ -46,16 +36,16 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv
|
|||||||
- [ ] `finally`
|
- [ ] `finally`
|
||||||
- Runs before any return statement inside the try block or catch block; also runs after the try block is complete
|
- Runs before any return statement inside the try block or catch block; also runs after the try block is complete
|
||||||
- Maybe `finally` would be more concisely implemented as defer inside an IIFE, but that is not idiomatic, maintainable Go code
|
- Maybe `finally` would be more concisely implemented as defer inside an IIFE, but that is not idiomatic, maintainable Go code
|
||||||
[ ] Abandon upon sight of `eval` / `extract` / ...
|
[ ] Abandon upon sight of `eval` / `extract` / variable-variables ...
|
||||||
[ ] Assignment expressions
|
[X] Detect assignment expressions
|
||||||
- Go doesn't support assignment in rvalues, only as a statement
|
- 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)
|
- 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
|
- [X] Add subtree walk + catch error for this case
|
||||||
- [ ] Add hoisting pass
|
|
||||||
[ ] Closures
|
[ ] Closures
|
||||||
- [ ] Handle value/reference captures
|
- [ ] Handle value/reference captures
|
||||||
[X] Convert top-level calls to `init()`/`main()`
|
[X] Convert top-level calls to `init()`/`main()`
|
||||||
- *Currently always `init`*
|
- [X] Wrap in function
|
||||||
|
- [X] Determine init/main based on package name
|
||||||
[ ] Class/object transformations
|
[ ] Class/object transformations
|
||||||
- [X] Convert `new X` constructor calls to `NewX`
|
- [X] Convert `new X` constructor calls to `NewX`
|
||||||
- [X] Visibility
|
- [X] Visibility
|
||||||
@ -73,13 +63,37 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv
|
|||||||
- [ ] static::
|
- [ ] static::
|
||||||
- [ ] Traits / `use`
|
- [ ] Traits / `use`
|
||||||
- [ ] Abstract methods
|
- [ ] Abstract methods
|
||||||
|
[X] Track golang package imports
|
||||||
|
[X] Variadic function parameters
|
||||||
|
[X] Preserve comments
|
||||||
|
|
||||||
|
### Productionize
|
||||||
|
|
||||||
|
[ ] Infer whether to declare variable (`var` / `:=`) or reuse (`=`)
|
||||||
|
- [ ] Track current visibility scope
|
||||||
|
[ ] Comprehensive coverage of all AST node types
|
||||||
|
- [ ] Node
|
||||||
|
- [ ] Stmt
|
||||||
|
- [ ] Expr
|
||||||
|
- [X] Binary
|
||||||
|
- [ ] Scalar
|
||||||
|
- [ ] Heredocs/nowdocs
|
||||||
[ ] Type inference
|
[ ] Type inference
|
||||||
- [ ] Type declarations for literals (string, slice/map with constant initializer, etc)
|
- [ ] Type declarations for literals (string, slice/map with constant initializer, etc)
|
||||||
- [ ] Convert known PHP typenames to Go equivalents
|
- [ ] Convert known PHP typenames to Go equivalents
|
||||||
- [ ] Parse extra types from phpdoc blocks
|
- [ ] Parse extra types from phpdoc blocks
|
||||||
[ ] Infer whether to declare variable (`var` / `:=`) or reuse (`=`)
|
[ ] Hoisting pass for rvalue expressions
|
||||||
- [ ] Track current visibility scope
|
- [ ] Behaviour of function calls in rvalue cases where err cannot be checked
|
||||||
[ ] Library/environment transformations
|
- [ ] Assignment expressions
|
||||||
|
[ ] Simple standard library transformations
|
||||||
|
- [ ] string/array functions
|
||||||
|
- [ ] uasort -> sort.Slice
|
||||||
|
[ ] Elide error return for functions that cannot throw
|
||||||
|
- ?? Could be a standalone Go refactoring tool
|
||||||
|
|
||||||
|
### Wishlist
|
||||||
|
|
||||||
|
[ ] Extended library/environment transformations
|
||||||
- [ ] Standard library transformations
|
- [ ] Standard library transformations
|
||||||
- [X] Track golang package imports
|
- [X] Track golang package imports
|
||||||
- [ ] Handle conflicts between golang stdlib packages / local variable names
|
- [ ] Handle conflicts between golang stdlib packages / local variable names
|
||||||
@ -94,9 +108,9 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv
|
|||||||
- [ ] AWS SDK
|
- [ ] AWS SDK
|
||||||
- [ ] PHPUnit -> Go Test
|
- [ ] PHPUnit -> Go Test
|
||||||
- [ ] Replace Composer/PSR-4 autoloading with Go imports
|
- [ ] Replace Composer/PSR-4 autoloading with Go imports
|
||||||
[X] Variadic function parameters
|
|
||||||
[X] Preserve comments
|
|
||||||
[ ] Preserve rough line spacing
|
[ ] Preserve rough line spacing
|
||||||
|
[ ] Somehow detect whether map use should be order-preserving
|
||||||
|
[ ] Support scoped namespace (`namespace { ... }`) and multiple namespaces in file
|
||||||
[ ] Convert wordpress / mediawiki / symfony
|
[ ] Convert wordpress / mediawiki / symfony
|
||||||
- [ ] Option to convert with preset=cli, preset=web, webroot path
|
- [ ] Option to convert with preset=cli, preset=web, webroot path
|
||||||
- [ ] Option to generate built-in web server
|
- [ ] Option to generate built-in web server
|
||||||
|
Loading…
x
Reference in New Issue
Block a user