aboutsummaryrefslogtreecommitdiff
path: root/src/main
Commit message (Collapse)AuthorAgeFilesLines
* Generate cleaner code for Unit-typed if-else expressionsphaller2012-11-161-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of generating an assignment to a Unit-typed variable, just add the Unit value after the if-else expression: [async] scala.async.Async.async[Unit]({ val f: scala.concurrent.Future[Int] = AnfTestClass.this.base(y); if (y.>(0)) State.result_=(scala.async.Async.await[Int](f).+(2)) else State.result_=(scala.async.Async.await[Int](f).-(2)) }) [async] ANF transform expands to: { val f: scala.concurrent.Future[Int] = AnfTestClass.this.base(y); if (y.>(0)) { val await$8: Int = scala.async.Async.await[Int](f); State.result_=(await$8.+(2)) } else { val await$9: Int = scala.async.Async.await[Int](f); State.result_=(await$9.-(2)) }; () }
* Add TransformUtils class for shared utilitiesphaller2012-11-163-21/+25
|
* Clean up and improve debug/error outputphaller2012-11-163-6/+5
|
* Add selective ANF transformphaller2012-11-163-12/+130
| | | | | - Does not descend into class and module defs - Adds several tests, including tests for if-else
* Fix typosphaller2012-11-121-2/+2
|
* Resolve feature warningsphaller2012-11-123-3/+5
|
* Reduce visibility of members of ExprBuilderphaller2012-11-122-14/+13
|
* Fix doc comment of awaitphaller2012-11-121-7/+7
|
* Fix merge conflicts and testsphaller2012-11-124-417/+434
|\
| * Add a test to interrogate the expanded tree.Jason Zaugg2012-11-112-3/+5
| | | | | | | | | | | | | | - checks that only one function is synthesized - checks the set of vars created (TODO minimize these) - use x$1 rather than x1 for the freshened names for lifted vars. - make execContext a val, not a var.
| * Fixes #7, allow async blocks without await or with a single expression.Jason Zaugg2012-11-112-85/+87
| |
| * Use a var rather than a lazy val to break a cycle.Jason Zaugg2012-11-111-4/+4
| | | | | | | | (onCompleteHandler and resume refer to each other)
| * Refer to an relevant bug in the comments.Jason Zaugg2012-11-111-1/+1
| |
| * Collapse all the onComplete handlers into a single function.Jason Zaugg2012-11-113-46/+68
| | | | | | | | | | | | | | | | We're now down to two inner classes per async block: the `onComplete` function, and the by-name argument to the initial call to `future`. Also caches the execution context in a val.
| * Synthezise a match directly.Jason Zaugg2012-11-112-24/+9
| | | | | | | | Rather than a function applied to the state.
| * Shuffle a bit more code around.Jason Zaugg2012-11-113-32/+19
| |
| * Synthesize `case 23 => rhs` rather than `case any @ (_: Int) if any == 25)`Jason Zaugg2012-11-111-13/+1
| |
| * Synthesize a Function1, rather than a PartialFunction.Jason Zaugg2012-11-112-43/+14
| |
| * Minor refactoringsJason Zaugg2012-11-112-19/+19
| |
| * Deleting unused code.Jason Zaugg2012-11-111-143/+1
| |
| * Synthesize a single PartialFunction rather than two and an orElse call.Jason Zaugg2012-11-102-30/+33
| | | | | | | | Give the handler a real class name.
| * Remove unneed ().Jason Zaugg2012-11-091-5/+2
| |
| * Avoid hygiene problems by suffixing result/result/state.Jason Zaugg2012-11-092-8/+15
| | | | | | | | Perhaps we should freshen them, but that will be a little awkward in our reify block.
| * Doc fix.Jason Zaugg2012-11-091-2/+3
| |
| * Further cleanup in AST generationJason Zaugg2012-11-092-84/+104
| | | | | | | | | | | | | | | | - centralize names - centralize more module/class lookup - reduce duplication - centralize use of resetAllAttrs - remove uses of asInstanceOf
| * Abstract over the future implementation.Jason Zaugg2012-11-093-167/+341
| | | | | | | | | | | | | | | | | | - Refactor the base macro implementation to be parameterized by a FutureSystem, which is defines the triple of types (Future, Promise, ExecutionContext) and the operations on those types (at the AST level) - Cleanup generation of ASTs, in particular, use reify more widely.
* | Reject local object definitionsphaller2012-11-091-0/+4
| |
* | Add comment, and decode class namesphaller2012-11-091-1/+2
| |
* | Reject local classes without crashingphaller2012-11-091-0/+3
|/
* Merge pull request #5 from phaller/wip-matchJason Zaugg2012-11-061-23/+79
|\ | | | | Support await inside match expressions
| * Support await inside match expressionsphaller2012-11-061-23/+79
| |
* | Use the fresh name generator provided by the macro API.Jason Zaugg2012-11-062-7/+2
| |
* | Use @deprecated as a poor-man's @compileTimeOnlyJason Zaugg2012-11-061-2/+3
|/ | | | This helps detect naked awaits.
* Small cleanups in the tree crafting.Jason Zaugg2012-11-052-136/+135
| | | | | | - Use imports of c.universe._ rather than fully qualifying - Use attributed idents to refer to standard library symbols - Refactor duplicated code for default values
* A minimal SBT build.Jason Zaugg2012-11-053-0/+690
Doesn't execute tests yet.