aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scala
Commit message (Collapse)AuthorAgeFilesLines
...
| * Prohibit lazy vals in async blocks.Jason Zaugg2012-12-101-3/+6
| |
| * Workaround non-idempotency of typing pattern matching anonymous functions.Jason Zaugg2012-12-103-19/+64
| | | | | | | | | | | | | | - Undo the transformation that takes place in Typers to leave us with Match(EmptyTree, cases). - Make sure we don't descend into the cases of such a tree when peforming the async transform
* | Merge pull request #47 from phaller/ticket/46-varargs-holistic-applyPhilipp Haller2012-12-032-11/+32
|\ \ | | | | | | Fix ANF transform involving `xs: _*` trees.
| * | Fix ANF transform involving `xs: _*` trees.Jason Zaugg2012-11-272-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | We need to unwrap and inline `xs`, then rewrap the result expression with the wildcard star. Addresses the first half of #46.
* | | Fix typophaller2012-11-291-3/+3
|/ /
* / Remove @author tagsphaller2012-11-273-9/+0
|/
* No need to extract vals for inlinable args.Jason Zaugg2012-11-272-4/+14
| | | | | | We use `isExprSafeToInline` from the non-public reflection API to check. In addtion, we now that an untyped Ident("await$N") is also an inlinable expression.
* Disallow await in non-primary param sections.Jason Zaugg2012-11-271-7/+22
| | | | | | | | | We can allow it, but we need to treat nested Apply trees holistically, in order to lift out all the arguments and maintain the correct evaluation order. Fixes #33.
* Fix semantics of by-name applicationJason Zaugg2012-11-271-8/+16
| | | | | | | | - If we lift one arg, we must lift them all. This preserves evaluation order. - But, never lift an by-name arg Addresses the first half of #33.
* Fix execution context lookup for the trivial async block.Jason Zaugg2012-11-271-1/+1
|
* Lookup log level dynamically from system property.Jason Zaugg2012-11-271-2/+2
| | | | | | And change TreeInterrogation to set if via this means, rather than through a direct means, which seems to assume too much about classloaders.
* Fix #42 - Futures created by async are not properly completed with exceptionsphaller2012-11-262-5/+26
| | | | | | | | | | | | 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> }
* Fix #26, leaner code gen for `async { <no awaits> }`.Jason Zaugg2012-11-261-9/+20
| | | | We can then use this as a replacement for `Future { expr }`.
* Make the name uniqification more selective.Jason Zaugg2012-11-261-11/+11
| | | | | | 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 Zaugg2012-11-265-24/+58
| | | | | | | | | | | | 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 Zaugg2012-11-263-17/+82
| | | | | | 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 Zaugg2012-11-263-50/+60
| | | | | | | | 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 Zaugg2012-11-263-8/+40
| | | | | | | Any vals referred to in the body of these must also be lifted. Fixes #36
* Fix await in if condition / match scrutinee.Jason Zaugg2012-11-263-9/+16
| | | | | | 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 Zaugg2012-11-264-21/+51
| | | | | | | These gives us something to lift to vars to be accessed from multiple states of the state machine. Fixes #35
* Flatmap it, Sam.Jason Zaugg2012-11-261-4/+1
|
* Turn object into defphaller2012-11-261-12/+11
|
* Simplify attachCopy in TransformUtilsphaller2012-11-263-39/+14
| | | | This refactoring removes a group of factory methods.
* Remove modifiers of case class parametersphaller2012-11-264-4/+4
|
* Refactor some tree creation from Async to ExprBuilder.Jason Zaugg2012-11-243-72/+89
|
* Tiny aesthetic refactorings.Jason Zaugg2012-11-242-14/+14
|
* Refactoring to avoid unneeded mutable fields.Jason Zaugg2012-11-241-34/+21
| | | | Brings uniformity to the result generation of AsyncStateBuilder.
* Refactoring to use AwaitableJason Zaugg2012-11-241-19/+16
| | | | Rather than three separate parameters.
* Refactor AsyncState heirarchy.Jason Zaugg2012-11-241-34/+38
| | | | | No more extension from concrete classes; no more dummy values for nextState.
* More refactoring in ExprBuilder.Jason Zaugg2012-11-241-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 Zaugg2012-11-241-20/+19
|
* More small refactorings.Jason Zaugg2012-11-243-27/+14
| | | | Goal is to make ExprBuilder less cluttered.
* Refactor name substitution out of ExprBuilder.Jason Zaugg2012-11-242-12/+17
|
* Favouring composition over inheritance.Jason Zaugg2012-11-245-31/+31
|
* add missing copyrightJason Zaugg2012-11-248-5/+18
|
* Refine tracing of ANF.Jason Zaugg2012-11-241-2/+3
| | | | - show the AST on one line.
* Centralize naming.Jason Zaugg2012-11-243-29/+33
|
* Cleanup var lifting.Jason Zaugg2012-11-242-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 rewritingJason Zaugg2012-11-242-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 Zaugg2012-11-243-6/+14
| | | | | | Test nested loops. Control ANF tracing with another system property.
* Prohibit return.Jason Zaugg2012-11-231-0/+2
| | | | Closes #21
* Explicitly prohibit await in nested methods.Jason Zaugg2012-11-232-0/+8
|
* Enable debug logging with a system property.Jason Zaugg2012-11-231-1/+1
|
* Support await in a while loop.Jason Zaugg2012-11-234-15/+52
|
* Test for await in while (currently forbidden).Jason Zaugg2012-11-232-3/+3
| | | | Lookup the ValDef symbol from Assign#rhs.symbol.
* Forbid await in try/catch.Jason Zaugg2012-11-231-0/+10
|
* Tightenen up modifiers and other refactoring.Jason Zaugg2012-11-234-18/+13
|
* Fix #31, Unfinished ANF transformJason Zaugg2012-11-232-9/+33
| | | | | | | | Prepend {(); ... } before starting the ANF transform. Add tracing to the anf/inline transform. Also enables and addresses SIP-18 warnings.
* Fix scaladoc formatting.Jason Zaugg2012-11-231-3/+3
|
* Preserve positions and attachments.Jason Zaugg2012-11-232-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.