Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix #42 - Futures created by async are not properly completed with exceptions | phaller | 2012-11-26 | 4 | -20/+84 |
| | | | | | | | | | | | | This augments the on-complete handler for an async state with await as follows: if (tr.isFailure) result$async.complete(tr.asInstanceOf[Try[T]]) else { <resultName> = tr.get.asInstanceOf[<resultType>] <nextState> <mkResumeApply> } | ||||
* | Merge pull request #37 from phaller/ticket/23-port-futures-tests | Philipp Haller | 2012-11-26 | 1 | -0/+536 |
|\ | | | | | Port futures tests of scala.concurrent | ||||
| * | Replace uses of Future.map/Future.flatMap with async+await | phaller | 2012-11-26 | 1 | -24/+33 |
| | | |||||
| * | Add ported futures tests | phaller | 2012-11-26 | 1 | -0/+527 |
| | | | | | | | | | | | | These tests do not use async/await, yet. Refs #23 | ||||
* | | Show that indirectly nested defs aren't lifted. | Jason Zaugg | 2012-11-26 | 2 | -3/+18 |
| | | |||||
* | | Fix #26, leaner code gen for `async { <no awaits> }`. | Jason Zaugg | 2012-11-26 | 1 | -9/+20 |
| | | | | | | | | We can then use this as a replacement for `Future { expr }`. | ||||
* | | Make the name uniqification more selective. | Jason Zaugg | 2012-11-26 | 2 | -12/+12 |
| | | | | | | | | | | | | We need not, and should not, rename definitions beyond the scope of the async transform, e.g. in nested classes of function bodies. | ||||
* | | Rewrite the state machine to a class, rather than an object. | Jason Zaugg | 2012-11-26 | 8 | -87/+91 |
| | | | | | | | | | | | | | | | | | | | | | | | | To avoid suprises in tree retyping, the instance of this class is immediately upcase to StateMachine[Promise[T], ExecContext]. Allow nested non-case classes. These pop up when we use nested async calls. Only look for duplicate names in the subtrees traversed by AsyncTraverser. | ||||
* | | Preserve outer This() refs through resetAttrs. | Jason Zaugg | 2012-11-26 | 6 | -40/+120 |
| | | | | | | | | | | | | Adapt the compiler's standard ResetAttrs to keep This() nodes don't refer to a symbol defined in the current async block. | ||||
* | | Synthesize an object implementing Function#apply and resume() | Jason Zaugg | 2012-11-26 | 5 | -52/+84 |
| | | | | | | | | | | | | | | | | There is a fly in the ointment: any This() trees in the provided code are getting rebound to this class. Sounds like more resetAttrs fun ahead. The object also serves as the Future {} thunk. | ||||
* | | Lift local defs and functions. | Jason Zaugg | 2012-11-26 | 5 | -11/+81 |
| | | | | | | | | | | | | | | Any vals referred to in the body of these must also be lifted. Fixes #36 | ||||
* | | Fix await in if condition / match scrutinee. | Jason Zaugg | 2012-11-26 | 7 | -41/+59 |
| | | | | | | | | | | | | The type-checking performed in ANF transform is precarious, and needed to use the original condition/ scrutinee in a throwaway tree to get things to work. | ||||
* | | Extract vals for all names bound in a pattern. | Jason Zaugg | 2012-11-26 | 6 | -49/+106 |
| | | | | | | | | | | | | | | These gives us something to lift to vars to be accessed from multiple states of the state machine. Fixes #35 | ||||
* | | Flatmap it, Sam. | Jason Zaugg | 2012-11-26 | 1 | -4/+1 |
| | | |||||
* | | Merge pull request #38 from phaller/ticket/19-external-vars | Philipp Haller | 2012-11-26 | 1 | -26/+64 |
|\ \ | | | | | | | Fix #19 | ||||
| * | | Address review comment | phaller | 2012-11-26 | 1 | -3/+1 |
| | | | |||||
| * | | Fix #19 | phaller | 2012-11-26 | 1 | -26/+66 |
| |/ | | | | | | | | | | | | | - Add tests where the result of an await is assigned to a variable external to the async block. - Clean up HygieneSpec. | ||||
* | | Turn object into def | phaller | 2012-11-26 | 1 | -12/+11 |
| | | |||||
* | | Simplify attachCopy in TransformUtils | phaller | 2012-11-26 | 3 | -39/+14 |
| | | | | | | | | This refactoring removes a group of factory methods. | ||||
* | | Remove modifiers of case class parameters | phaller | 2012-11-26 | 4 | -4/+4 |
|/ | |||||
* | Refactor some tree creation from Async to ExprBuilder. | Jason Zaugg | 2012-11-24 | 3 | -72/+89 |
| | |||||
* | Tiny aesthetic refactorings. | Jason Zaugg | 2012-11-24 | 2 | -14/+14 |
| | |||||
* | Refactoring to avoid unneeded mutable fields. | Jason Zaugg | 2012-11-24 | 1 | -34/+21 |
| | | | | Brings uniformity to the result generation of AsyncStateBuilder. | ||||
* | Refactoring to use Awaitable | Jason Zaugg | 2012-11-24 | 1 | -19/+16 |
| | | | | Rather than three separate parameters. | ||||
* | Refactor AsyncState heirarchy. | Jason Zaugg | 2012-11-24 | 1 | -34/+38 |
| | | | | | No more extension from concrete classes; no more dummy values for nextState. | ||||
* | More refactoring in ExprBuilder. | Jason Zaugg | 2012-11-24 | 1 | -41/+33 |
| | | | | | | - Moving some private methods out of the top-billing at the head of the file - Replace three nullable fields with one Option. | ||||
* | Address a little duplication in ExprBuilder. | Jason Zaugg | 2012-11-24 | 1 | -20/+19 |
| | |||||
* | More small refactorings. | Jason Zaugg | 2012-11-24 | 3 | -27/+14 |
| | | | | Goal is to make ExprBuilder less cluttered. | ||||
* | Refactor name substitution out of ExprBuilder. | Jason Zaugg | 2012-11-24 | 2 | -12/+17 |
| | |||||
* | Favouring composition over inheritance. | Jason Zaugg | 2012-11-24 | 5 | -31/+31 |
| | |||||
* | add missing copyright | Jason Zaugg | 2012-11-24 | 27 | -15/+64 |
| | |||||
* | Refine tracing of ANF. | Jason Zaugg | 2012-11-24 | 1 | -2/+3 |
| | | | | - show the AST on one line. | ||||
* | Centralize naming. | Jason Zaugg | 2012-11-24 | 3 | -29/+33 |
| | |||||
* | Cleanup var lifting. | Jason Zaugg | 2012-11-24 | 2 | -33/+12 |
| | | | | | Seeing as we know in advance the full set of lifted vars, we don't need to thread this information through ExprBuilder. | ||||
* | Cleaner while rewriting | Jason Zaugg | 2012-11-24 | 2 | -21/+22 |
| | | | | | | | -preserve LabelDef symbols to allow use of Symbol, rather than Names as map keys. -a label jump overwrites the nextState of an AsyncState. This is cleaner than inserting a return { state = 12; resume() }. | ||||
* | Prohibit await in if condition (for now) | Jason Zaugg | 2012-11-24 | 6 | -20/+62 |
| | | | | | | Test nested loops. Control ANF tracing with another system property. | ||||
* | Prohibit return. | Jason Zaugg | 2012-11-23 | 2 | -0/+14 |
| | | | | Closes #21 | ||||
* | Explicitly prohibit await in nested methods. | Jason Zaugg | 2012-11-23 | 4 | -2/+19 |
| | |||||
* | Enable debug logging with a system property. | Jason Zaugg | 2012-11-23 | 2 | -5/+6 |
| | |||||
* | Support await in a while loop. | Jason Zaugg | 2012-11-23 | 7 | -43/+112 |
| | |||||
* | Test for await in while (currently forbidden). | Jason Zaugg | 2012-11-23 | 4 | -3/+40 |
| | | | | Lookup the ValDef symbol from Assign#rhs.symbol. | ||||
* | Forbid await in try/catch. | Jason Zaugg | 2012-11-23 | 2 | -0/+40 |
| | |||||
* | Tightenen up modifiers and other refactoring. | Jason Zaugg | 2012-11-23 | 4 | -18/+13 |
| | |||||
* | Fix #31, Unfinished ANF transform | Jason Zaugg | 2012-11-23 | 4 | -10/+67 |
| | | | | | | | | Prepend {(); ... } before starting the ANF transform. Add tracing to the anf/inline transform. Also enables and addresses SIP-18 warnings. | ||||
* | Move TestUtils contents directly into the package object. | Jason Zaugg | 2012-11-23 | 2 | -59/+42 |
| | | | | Why suffer SI-4695 needlessly? | ||||
* | Fix scaladoc formatting. | Jason Zaugg | 2012-11-23 | 1 | -3/+3 |
| | |||||
* | Preserve positions and attachments. | Jason Zaugg | 2012-11-23 | 2 | -28/+78 |
| | | | | | | | | | Not quite sure how to test this yet; the original trees coming from toolbox don't seem to come with position to start with. But this is a start. | ||||
* | Convert null check to an assert. | Jason Zaugg | 2012-11-23 | 1 | -5/+4 |
| | | | | We seem to be symful now. | ||||
* | Ensure unique names for definitions in the async block. | Jason Zaugg | 2012-11-23 | 6 | -49/+113 |
| | | | | | | | | - transform the provided tree using reflect.internal.Symbols#Symbol.name_= and treeCopy.{Ident, Select}. - not sure if this is possible within the public Symbol API. - move checking for unsupported nested module/class to AsyncAnalysis. - make block merging selective (only do so if there are nested await calls.) | ||||
* | Minor refactoring in ANF transform. | Jason Zaugg | 2012-11-22 | 1 | -31/+27 |
| |