aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Contexts.scala
Commit message (Collapse)AuthorAgeFilesLines
* Remove duplication of console reportersFelix Mulder2016-10-101-1/+1
|
* Rename `ConsoleReporter` => `FancyConsoleReporter`Felix Mulder2016-10-101-1/+1
|
* Separate `ContextDocstrings` from `Context` and make it pluggableFelix Mulder2016-10-061-34/+0
|
* Implement docbase as propertyFelix Mulder2016-10-061-4/+5
|
* Move docstring cooking to dottyFelix Mulder2016-10-061-0/+2
|
* Fix cooking of docstringsFelix Mulder2016-10-061-0/+2
|
* Add `Comments` object instead of `Scanners.Comment` case classFelix Mulder2016-10-061-1/+1
|
* Simplify enclosingInlinedsMartin Odersky2016-10-021-4/+0
| | | | | - represent directly as a list - can replace separate inlineCount
* Print inlining positions in error messagesMartin Odersky2016-10-021-6/+2
| | | | | Error messages now print the inlined positions as well as the position of the inlined call, recursively.
* Track Inlined nodes in ctx.sourceMartin Odersky2016-10-021-3/+7
|
* Make Context#moreProperties strongly typedMartin Odersky2016-10-021-5/+10
| | | | To do this, factor out Key from Attachment into a new type, Property.Key.
* First version of inline schemeMartin Odersky2016-10-021-0/+4
| | | | | To be done: outer accessors To be done: error positions
* Fix #25: move doc related structures to `DocBase`Felix Mulder2016-08-191-1/+11
| | | | To access `DocBase`: `ctx.docbase.docstring(...)`
* Introduce DocMiniPhase concept, fused phasesFelix Mulder2016-08-191-1/+12
| | | | | | | | Like dotty, dottydoc can now also enjoy the modularity of having fused mini-phases. By extending `DocMiniPhase` and overriding the appropriate methods, one can alter the DocAST easily. ping: @DarkDimius
* Add the scaladoc CLI args that make sense for dottydocFelix Mulder2016-08-191-1/+1
|
* Port cooking of strings from NSCFelix Mulder2016-08-191-3/+4
|
* Merge pull request #1251 from felixmulder/topic/fix-stdoutredirect-replFelix Mulder2016-06-011-0/+4
|\ | | | | Fix stdout redirect for REPL's println
| * Disable "auto" alternative in `-color` flagFelix Mulder2016-06-011-1/+1
| |
| * Factor out coloring check to new method `Context#useColors`Felix Mulder2016-05-201-0/+4
| |
* | Add sbt incremental compilation supportGuillaume Martres2016-05-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To test this with sbt, see https://github.com/lampepfl/dotty/wiki/Using-Dotty-with-sbt The following flags are added: - -Yforce-sbt-phases: Run the phases used by sbt for incremental compilation (ExtractDependencies and ExtractAPI) even if the compiler is ran outside of sbt, for debugging. - -Ydump-sbt-inc: For every compiled foo.scala, output the API representation and dependencies used for sbt incremental compilation in foo.inc, implies -Yforce-sbt-phases. This commit introduces two new phases which do not transform trees: - `ExtractDependencies` which extracts the dependency information of the current compilation unit and sends it to sbt via callbacks - `ExtractAPI` which creates a representation of the API of the current compilation unit and sends it to sbt via callbacks Briefly, when a file changes sbt will recompile it, if its API has changed (determined by what `ExtractAPI` sent) then sbt will determine which reverse-dependencies (determined by what `ExtractDependencies` sent) of the API have to be recompiled depending on what changed. See http://www.scala-sbt.org/0.13/docs/Understanding-Recompilation.html for more information on how sbt incremental compilation works. This phase was originally based on https://github.com/adriaanm/scala/tree/sbt-api-consolidate/src/compiler/scala/tools/sbt which attempts to integrate the sbt phases into scalac (and is itself based on https://github.com/sbt/sbt/tree/0.13/compile/interface/src/main/scala/xsbt), but it has been heavily refactored and adapted to Dotty. The main functional differences are: - ExtractDependencies runs right after Frontend (so that we don't lose dependency informations because of the simplifications done by PostTyper), but ExtractAPI runs right after PostTyper (so that SuperAccessors are part of the API). - `ExtractAPI` only extract types as they are defined and never "as seen from" some some specific prefix, see its documentation for more details. - `ExtractDependenciesTraverser` and `ExtractUsedNames` have been fused into one tree traversal in `ExtractDependenciesCollector`. TODO: Try to run these phases in parallel with the rest of the compiler pipeline since they're independent (except for the sbt callbacks in `GenBCode`) ?
* | Fix withPhaseNoLaterMartin Odersky2016-05-231-1/+1
|/ | | | | It's possible that the given phase argument does not exist, in which case we do not want to set the current phase to NoPhase.
* Merge pull request #1211 from dotty-staging/fix-#1202odersky2016-04-161-3/+8
|\ | | | | Fix Tasty errors
| * Treat type parameters of secondary constructors as aliasesMartin Odersky2016-04-071-3/+8
| | | | | | | | | | | | | | | | | | | | ... of class parameters using the gadt mechanism. Previously they were encoded as aliases by hardcoding alias bounds in the type parameter declaration, but that then leads to weird behavior and failures in unpickling. To make this work, we also need to propagate gadt bounds into the this-call context. Test case in pickling/i1202a.scala.
* | Add binding between Symbol and Untyped tree in base contextFelix Mulder2016-04-071-0/+8
|/ | | | This commit also adds a printer for use by dottydoc.
* Move Mode to coreMartin Odersky2016-04-011-1/+1
| | | | | Mode is used from a lot of low-level code, does not just reflect Typer info. So it makes more sense top to place it in the core package.
* Initialize context in REPLMartin Odersky2016-03-181-1/+1
| | | | | | | | This broke under the recent introduction of the JS backend, because now the context needs to be initialized before the platform can be selected. So invoking `doti` immediately gave an IllegalStateException. No big deal to fix, but it shows how sorely we are lacking REPL tests.
* Store the JSDefinitions in a custom platform SJSPlatform.Sébastien Doeraene2016-03-011-2/+23
| | | | | | This required the ability to instantiate a different `Platform` depending on settings, which, in turn, required to defer the initialization of `ContextBase.platform`.
* Add a `dotty-interfaces` packageGuillaume Martres2016-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | We introduce a new entry point for the compiler in `dotty.tools.dotc.Driver`: ``` def process(args: Array[String], simple: interfaces.SimpleReporter, callback: interfaces.CompilerCallback): interfaces.ReporterResult ``` Except for `args` which is just an array, the argument types and return type of this method are Java interfaces defined in a new package called `dotty-interfaces` which has a stable ABI. This means that you can programmatically run a compiler with a custom reporter and callbacks without having to recompile it against every version of dotty: you only need to have `dotty-interfaces` present at compile-time and call the `process` method using Java reflection. See `test/test/InterfaceEntryPointTest.scala` for a concrete example. This design is based on discussions with the IntelliJ IDEA Scala plugin team. Thanks to Nikolay Tropin for the discussions and his PR proposal (see #1011).
* Enforce rule that laziness is preserved when overriding.Martin Odersky2016-02-091-1/+1
|
* Do not store context creation trace with -YdebugGuillaume Martres2016-02-061-1/+1
| | | | | This makes the compiler extremely slow. To store the trace, you now need to pass -Ytrace-context-creation
* Context: set compilerCallback like other context variablesGuillaume Martres2016-02-041-15/+6
| | | | | | Previously, we could set compilerCallback on non-fresh contexts, but there is no reason that this should be allowed, and this is not done anymore in the code since the last commit.
* Better compiler entry pointsGuillaume Martres2016-02-041-0/+1
| | | | | | | | | - Document the entry points - It is now possible to set a custom reporter without using a custom context - Use `null` for optional arguments to make it easier to run the compiler using reflection or from Java. - DPDirectCompiler does not use a custom context anymore
* Compiler: use the reporter passed from the DriverGuillaume Martres2016-02-041-1/+1
| | | | | | | | | | | | With this commit and the previous one, partest should finally correctly log the output of the compiler and display it at the end of its execution if compilation failed. Also make sure the initial Reporter in a Context is _not_ a ThrowingReporter. Previously, the initial Reporter was always overriden in Compiler by rootReporter so it had no effect, but this is not the case anymore, and the negative junit tests fail with the ThrowingReporter since they throw an exception instead of exiting with a certain number of errors.
* ConsoleReporter: remove unused argument ctxGuillaume Martres2016-02-041-1/+1
|
* Make asSeenFrom idempotentMartin Odersky2015-12-211-1/+7
| | | | | | Let asSeenFrom generate a marker annotated type for any unsafe instantiation. Then cleanup in typedSelect.
* Add initial CompilerCallback implementation for IntelliJGuillaume Martres2015-12-031-0/+15
| | | | | This adds some simple callbacks to Dotty that should be enough to get basic integration from IntelliJ.
* Merge pull request #889 from dotty-staging/fix-#877odersky2015-11-051-6/+10
|\ | | | | Fix #877
| * Make a new fresh name creator for each unitMartin Odersky2015-10-301-6/+10
| | | | | | | | Needed to make builds deterministic.
* | Check that access to context base is singlethreaded.Martin Odersky2015-10-311-0/+10
|/ | | | | | ContextBase is not intended to be threadsafe, We now test that indeed it is not shared by compileUnits calls operating on different threads.
* Replace withMode by addModeMartin Odersky2015-10-011-4/+4
| | | | | | withMode sets the whole mode, nit an individual bits. This was used wrongly in several places. Make this less of a trap by renaming withMode -> withModeBits.
* Revert "Workaround #742 and add a test for it."Martin Odersky2015-08-051-19/+18
| | | | This reverts commit a43d39ad719978fbb36663f336c1c7cd2c4da1e0.
* Workaround #742 and add a test for it.Dmitry Petrashko2015-07-281-18/+19
| | | | | Making a correct fix could take some time, and I want to find other issues before I start working on this one.
* Add @sharable annotationMartin Odersky2015-07-061-2/+3
| | | | | | | Add @sharable annotation for classes and vals that are presumed to be safely sharable between threads. Also: Document CtxLazy.
* Avoid double context creation when modes change on a fresh context.Martin Odersky2015-06-221-7/+15
| | | | | | | | | | | | | | | | | | | | Move addMode and friends to two decorators, one for Context, the other for FreshContext. Implement behavior accordingly. This avoids creating two contexts in situations like: c.fresh.setxploreTyperState.addMode(...) Mow we can write c.fresh.addMode(...).setExploreTyperState Because addMode returns a fresh context when applied to a fresh context. Note that we specifically do not want virtual dispatch of addMode, that's why it was moved to a decorator. Also: removed mention of ".fresh: when just forllowed by an addMode, because that one is redundant.
* Compute outer.path in lambdaLift at correct phase.Martin Odersky2015-06-031-0/+3
| | | | | | | | | | LambdaLift needs to compute outer.path at the phase in which the results are constructed, i.e. phase lambdaLift.next. Or else we get an error in outer.path for lost fo files, including pos/Fileish.scala as a minimized test case. Previously outer as computed at phase lambdaLift. The reason for this is that lambdaLift name mangles inner classes, which causes outer acessors to be not found. We now correct for the problem in outer.path itself, by calling outerAccessor only at a safe phase.
* Move findMember count tracking from TypeComparer to ContextMartin Odersky2015-05-211-0/+8
| | | | | Typecomparer is not a good place because it gets re-generated for new context, which causes the counts to be reset.
* Move threshold values to ConfigMartin Odersky2015-05-211-18/+3
| | | | It's a more logical home for them than the Context object.
* Correct a large number of typos.Jason Zaugg2015-05-141-5/+5
| | | | | I scanned the main sources with IntellIJ's spell checker and corrected what showed up.
* Remove trailing spaces in Dotty source.Dmitry Petrashko2015-04-091-1/+1
|
* Removing whitespaces before `[`Dmitry Petrashko2015-04-091-2/+2
|