aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #170 from lrytz/module-pluginv0.9.6#2.13.0-M1#8Jason Zaugg2017-05-1017-205/+226
|\ | | | | Use scala-module-plugin, update tag-based publishing
| * Use scala-module-plugin, update tag-based publishingLukas Rytz2017-04-2617-205/+226
|/ | | | | | | The build didn't use the `scala-module-plugin` before but duplicated most of its settings - maybe I missed the reason why this is the case? Also update tag-based publishing to the latest version.
* Merge pull request #167 from jochenschneider/patch-1Jason Zaugg2017-01-301-1/+1
|\ | | | | Typo
| * TypoJochen Schneider2017-01-301-1/+1
|/
* Merge pull request #165 from mpociecha/fix-out-dir-in-testsJason Zaugg2016-11-221-1/+1
|\ | | | | In tests use tmp dir working on all operating systems
| * In tests use tmp dir working on all operating systemsMichał Pociecha2016-11-221-1/+1
|/ | | | After this change tests pass also on Windows.
* Merge pull request #164 from retronym/bump/0.9.7-SNAPSHOTJason Zaugg2016-10-302-5/+5
|\ | | | | Bump to new snapshot version
| * Bump to new snapshot versionJason Zaugg2016-10-302-5/+5
|/
* Merge pull request #163 from retronym/bump/2.12.0v0.9.6Jason Zaugg2016-10-302-2/+2
|\ | | | | Bump to Scala 2.12.0
| * Bump to Scala 2.12.0Jason Zaugg2016-10-302-2/+2
|/
* Merge pull request #162 from retronym/bump/RC2v0.9.6-RC6Jason Zaugg2016-10-182-4/+4
|\ | | | | Bump Scala version to 2.12.0-RC2
| * Bump Scala version to 2.12.0-RC2Jason Zaugg2016-10-172-4/+4
|/
* Document Scala 2.12 supportJason Zaugg2016-09-081-1/+3
|
* Merge pull request #161 from retronym/topic/matrixv0.9.6-RC5Jason Zaugg2016-09-082-11/+9
|\ | | | | Rework build logic to determine which JDK use for release build
| * Rework build logic to determine which JDK use for release buildJason Zaugg2016-09-082-11/+9
| |
* | Merge pull request #142 from knoldus/topic/doc-improvementv0.9.6-RC4Jason Zaugg2016-09-081-0/+18
|\ \ | | | | | | Add dependency information for including in project.
| * | Add dependency information for including in project.Satendra kumar2015-09-251-0/+18
| | | | | | | | | | | | Added dependency information for Maven and SBT so that it is easier for the developers who are new to the library.
* | | Merge pull request #160 from retronym/topic/2.12Jason Zaugg2016-09-088-13/+34
|\ \ \ | | |/ | |/| Compatibility with Scala 2.12.0-RC1
| * | Add maintainence warning in .travis.ymlJason Zaugg2016-09-081-2/+3
| | |
| * | Compatibility with Scala 2.12.0-RC1Jason Zaugg2016-09-088-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - method local lazy vals are now encoded as a single ValDef rather than a ValDef + DefDef pair. We need to treat ValDef-s with the LAZY flag in the same way as we used to treat the DefDef. - Rename one of the symbols `ANF,anf` in the same scope to avoid generating anonymous class names that differ only in case. The compiler warned about this one. - When patching the LabelDefs to have a `Unit` result type, propagate this other LabelDefs conclude with a jump to that label. Not sure why, but without this we now hit an error in the backend about the nonsensical attempt to emit a coercion from void to int. - Use crossScalaVersions in the build and update the Scala versions tested in CI.
* | | Merge pull request #155 from retronym/topic/isCompletedJason Zaugg2016-09-073-12/+15
|\ \ \ | | | | | | | | Rework extension point for checking for already-completed futures
| * | | Rework extension point for checking for already-completed futuresJason Zaugg2016-03-033-12/+15
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current extension point assumes that if a future is in the completed state, a subsequent call to get the already completed value will succeed. While this assumption holds for scala.concurrent.Future, it might not hold for a future system that has semantics like a weak reference. This commit uses a single call `getCompleted` to query the state and get the already completed value. This returns null if the value is not available.
* | | Merge pull request #159 from raboof/patch-1Jason Zaugg2016-09-071-1/+2
|\ \ \ | |/ / |/| | Fix dead link to Akka's Dataflow Concurrency
| * | Fix dead link to Akka's Dataflow ConcurrencyArnout Engelen2016-08-051-1/+2
|/ / | | | | And mention it's been removed in favour of this library.
* | Merge pull request #151 from retronym/topic/late-expansion-fixesv0.9.6-RC3Jason Zaugg2016-01-199-82/+495
|\ \ | | | | | | Late expansion fixes
| * | Various fixes to late expansionJason Zaugg2016-01-197-78/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Detect cross-state symbol references where the RefTree is nested in a LabelDef. Failure to do so led to ill-scoped local variable references which sometimes manifest as VerifyErrors. - Emit a default case in the Match intended to be a tableswitch. We have to do this ourselves if we expand after pattern matcher - Cleanup generated code to avoid redundant blocks - Avoid unnecessary `matchRes` temporary variable for unit-typed pattern matches - Fix the trace level logging in the ANF transform to restore indented output. - Emit `{ state = nextState; ... }` rather than `try { ... } finally { state = nextState }` in state handlers. This simplifies generated code and has the same meaning, as the code in the state machine isn't reentrant and can't observe the "early" transition of the state.
| * | Use AbstractFunction as a base class to emit leaner codeJason Zaugg2016-01-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Avoids mixing in all the specialized apply variants. We could go further and create an base class for all state machines, but that would require scala-async to be on the runtime classpath, which currently isn't a requirement. For now, I'm keeping it this way.
| * | Hooks to customize code generationJason Zaugg2015-11-103-3/+5
|/ /
* | Merge pull request #143 from retronym/ticket/prescompiler-nested-asyncv0.9.6-RC2Jason Zaugg2015-10-097-17/+63
|\ \ | |/ |/| Avoid spurious "illegal await" error in IDE with nesting
| * Avoid spurious "illegal await" error in IDE with nestingJason Zaugg2015-10-097-17/+63
|/ | | | | | | | | | | | | | | | | | | The presentation compiler runs with `-Ymacro-expand:discard`, which retains the macro expandee in the typechecked trees, rather than substituting in the expansion. This mode was motivated as a means to keep IDE functionality working (e.g. completion, navigation, refactoring) inside macro applications. However, if one has nested async macro applications, as reported in the IDE ticket: https://www.assembla.com/spaces/scala-ide/tickets/1002561 ... the expansion of the outer async application was reporting await calls enclosed by the inner async application. This change tweaks the traversers used for this analysis to stop whenever it sees an async.
* Merge pull request #141 from retronym/ticket/await-extractorv0.9.6-RC1_2.11v0.9.5-RC1_2.11Jason Zaugg2015-09-2411-55/+459
|\ | | | | Enable a compiler plugin to use the async transform after patmat
| * Small cleanups after code reviewJason Zaugg2015-09-233-12/+40
| | | | | | | | | | | | | | | | - More internal docs - Be more frugal with the `NoAwait` attachment, for some AST node types this is implied. - Just use `x`, rather than what was effectively `x.reverseMap(identity).reverse`
| * Enable a compiler plugin to use the async transform after patmatJason Zaugg2015-09-2211-54/+430
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the async transformation is performed during the typer phase, like all other macros. We have to levy a few artificial restrictions on whern an async boundary may be: for instance we don't support await within a pattern guard. A more natural home for the transform would be after patterns have been translated. The test case in this commit shows how to use the async transform from a custom compiler phase after patmat. The remainder of the commit updates the implementation to handle the new tree shapes. For states that correspond to a label definition, we use `-symbol.id` as the state ID. This made it easier to emit the forward jumps to when processing the label application before we had seen the label definition. I've also made the transformation more efficient in the way it checks whether a given tree encloses an `await` call: we traverse the input tree at the start of the macro, and decorate it with tree attachments containig the answer to this question. Even after the ANF and state machine transforms introduce new layers of synthetic trees, the `containsAwait` code need only traverse shallowly through those trees to find a child that has the cached answer from the original traversal. I had to special case the ANF transform for expressions that always lead to a label jump: we avoids trying to push an assignment to a result variable into `if (cond) jump1() else jump2()`, in trees of the form: ``` % cat sandbox/jump.scala class Test { def test = { (null: Any) match { case _: String => "" case _ => "" } } } % qscalac -Xprint:patmat -Xprint-types sandbox/jump.scala def test: String = { case <synthetic> val x1: Any = (null{Null(null)}: Any){Any}; case5(){ if (x1.isInstanceOf{[T0]=> Boolean}[String]{Boolean}) matchEnd4{(x: String)String}(""{String("")}){String} else case6{()String}(){String}{String} }{String}; case6(){ matchEnd4{(x: String)String}(""{String("")}){String} }{String}; matchEnd4(x: String){ x{String} }{String} }{String} ```
* Merge pull request #139 from backuitist/patch-1Jason Zaugg2015-09-131-1/+1
|\ | | | | Typo
| * TypoBruno Bieth2015-08-181-1/+1
|/
* Merge pull request #134 from retronym/merge/2.10.x-to-master-20150730Jason Zaugg2015-07-300-0/+0
|\ | | | | Noop merge of 2.10.x to master.
| * Merge commit 'f9e170e3187f83c5d00e9ea8128fe2edf2bd371c' into ↵Jason Zaugg2015-07-300-0/+0
| |\ | | | | | | | | | merge/2.10.x-to-master-20150730
| | * [backport] Make nsc.Global based tests work under SBTJason Zaugg2015-07-301-17/+3
| | | | | | | | | | | | | | | | | | And remove unused code. (cherry picked from commit 7238bc1982cb1d87157c650115a2ae92a58430c9)
| | * [backport] Stop test compiler before code generationJason Zaugg2015-07-301-3/+3
| | | | | | | | | | | | | | | | | | | | | This avoids leaving .class files in the working directory after running the test. (cherry picked from commit 5bb93b0b7357259eb588437a45063bf43595028a)
| | * [backport] Avoid dead code warning with async(throw T)Jason Zaugg2015-07-303-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | By declararing the parameter of `async` as by-name. Fixes #150 (the bug in the original ticket.) (cherry picked from commit 4b1dbeef9ec73612867afc5dd9c925faa8cbc30d)
| | * [backport] Avoid dead code warnings in generated code.Jason Zaugg2015-07-303-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we blindly splicing `{..$stats, ..$generatedCode}`, and the last expression in `$stats` is of type `Nothing`, we'll incur a dead code warning when typechecking the block. This commit: - introduces a helper method to augment user-written stats with synthetic code - Emit a try/finally in that code (so we advance the state, even if we are about to exit the state machine in the async-block global exception handler - Hide `Nothing` typed expressions from the dead code analysis by wrapping them in an `expr: Any` Fixes #150 (the part reported in the comments, not the original ticket.)
| | * [backport] Cleanup code generation by avoiding redundant blocksJason Zaugg2015-07-302-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't bother adding `{ ...; () }` if we can use the original tree(s) instead, e.g. if the last tree in `...` conforms to `Unit`. This makes the debug output of the macro a little easier to read. (cherry picked from commit de641dc265f34b06e17dfa7c64be00219f72b670)
| | * Merge pull request #124 from retronym/backport/sbt-bumpJason Zaugg2015-07-271-1/+1
| | |\ | | | | | | | | Update SBT for the warn command, now assumed by sbt-extras
| | | * Update SBT for the warn command, now assumed by sbt-extrasJason Zaugg2015-07-271-1/+1
| | | | | | | | | | | | | | | | (cherry picked from commit f6a5c93acb7628c4d169b778e386332c6d1bd99b)
* | | | Merge pull request #132 from retronym/ticket/105Jason Zaugg2015-07-306-24/+108
|\ \ \ \ | | | | | | | | | | Avoid dead code warnings for users of async.
| * | | | Make nsc.Global based tests work under SBTJason Zaugg2015-07-301-17/+3
| | | | | | | | | | | | | | | | | | | | And remove unused code.
| * | | | Stop test compiler before code generationJason Zaugg2015-07-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This avoids leaving .class files in the working directory after running the test.
| * | | | Avoid dead code warning with async(throw T)Jason Zaugg2015-07-293-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By declararing the parameter of `async` as by-name. Fixes #150 (the bug in the original ticket.)
| * | | | Avoid dead code warnings in generated code.Jason Zaugg2015-07-293-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we blindly splicing `{..$stats, ..$generatedCode}`, and the last expression in `$stats` is of type `Nothing`, we'll incur a dead code warning when typechecking the block. This commit: - introduces a helper method to augment user-written stats with synthetic code - Emit a try/finally in that code (so we advance the state, even if we are about to exit the state machine in the async-block global exception handler - Hide `Nothing` typed expressions from the dead code analysis by wrapping them in an `expr: Any` Fixes #150 (the part reported in the comments, not the original ticket.)
| * | | | Cleanup code generation by avoiding redundant blocksJason Zaugg2015-07-292-19/+44
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Don't bother adding `{ ...; () }` if we can use the original tree(s) instead, e.g. if the last tree in `...` conforms to `Unit`. This makes the debug output of the macro a little easier to read.