aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/parsing/Parsers.scala
Commit message (Collapse)AuthorAgeFilesLines
* Improve positions for MemberDefs using `namePos`Felix Mulder2016-10-101-3/+17
|
* Add deprecation message on `with` type operatorFelix Mulder2016-10-101-1/+1
|
* Make relevant parts of compiler conform to new error handlingFelix Mulder2016-10-101-12/+11
|
* Complete better structure to diagnostic messagesFelix Mulder2016-10-101-6/+7
|
* Change layout of ErrorMessagesFelix Mulder2016-10-101-4/+5
|
* Add initial structure for improved explanations of error messagesFelix Mulder2016-10-101-13/+10
|
* Add `Comments` object instead of `Scanners.Comment` case classFelix Mulder2016-10-061-1/+1
|
* Add inline for valsMartin Odersky2016-10-021-5/+10
| | | | | | | | | | - allow inline as an alternative to final for vals (final is retained for backwards compatibility for now) - allow inline for parameters - check that rhs of inline value has a constant type - check that arguments to inline value parameters have constant type - check that inline members are not deferred - make inline members effectively final
* Make inline a keywordMartin Odersky2016-10-021-12/+7
| | | | | | | `inline` is now a modifier keyword. To keep disruption tolerable, we still allow `@inline` as an annotation as well. Other uses of `inline` are supported only under `-language:Scala2` and are rewritten to identifiers in backticks.
* Get rid of Thicket(List(...)) as an expressionMartin Odersky2016-09-251-2/+2
| | | | Thicket has a vararg constructor, so this syntax is redundant.
* Get rid of SelectFromType tree node.Martin Odersky2016-09-251-1/+1
| | | | | | Roll its functionality into Select. Since we can always tell whether a tree is a type or term there is no expressiveness gained by having a separate tree node.
* Drop PairMartin Odersky2016-09-251-1/+1
| | | | | | | | Drop tree node class 'Pair'. It was used only in imports, where it can easily be replaced by Thicket. The envisaged use for generic pairs is almost sure better modelled by a "Pair" class in Dotty's standard library.
* Address reviewers commentsMartin Odersky2016-09-251-3/+13
|
* Specially mark functions coming from wildcard expressionsMartin Odersky2016-09-241-1/+1
| | | | | | That way, we can check functions for the ordering requirement as well. We only have to remember that the last parameter of a wildcard function does not precede its body (because the parameter is in fact part of the body).
* Make InterpolatedString conform to ordering requirementMartin Odersky2016-09-241-20/+20
| | | | Arrange its sub-elements so that they appear strictly left to right.
* Swap order of elements in AnnotatedMartin Odersky2016-09-241-4/+4
| | | | | | | | | Now it's annotated first, annotation second. This is in line with AnnotatedType and in line with the principle that tree arguments should come in the order they are written. The reason why the order was swapped before is historical - Scala2 did it that way.
* Make positions fit for metaMartin Odersky2016-09-241-46/+52
| | | | | | | | | | | | | | | | | | In particular: - get rid of envelope, it's too complicated and hides too many errors - check that everywhere in parsed trees the position range of a parent node contains the position ranges of its children. - check that all non-empty trees coming from parser have positions. The commit contains lots of fixes to make these checks pass. In particular, it changes the scheme how definitions are positioned. Previously the position of a definition was the token range of the name defined by it. That does obviously not work with the parent/children invariant. Now, the position is the whole definition range, with the point at the defined name (care is taken to not count backticks). Namer is changed to still use the token range of defined name as the position of the symbol.
* Fix isWildcardMartin Odersky2016-09-241-1/+1
| | | | | Code inspection revealed that it did the wrong thing for annotated trees, looking in the annotation instead of in the argument.
* Improve error message on empty catch blockFelix Mulder2016-09-151-0/+9
|
* Allow try expression without catch or finally, issue warningFelix Mulder2016-09-151-2/+7
|
* Port cooking of strings from NSCFelix Mulder2016-08-191-11/+12
|
* Error message for illegal self type (#1424)Martin Odersky2016-08-161-1/+1
| | | | Remove debug info from error message.
* Fix #1443: Replace toplevel TypeBounds with AnyClemens Winter2016-08-151-3/+8
|
* Fix #1403: Reject unbound wildcard typesClemens Winter2016-08-011-9/+27
|
* Fix #1396: Modify parser to allow wildcard types everywhereClemens Winter2016-08-011-21/+17
|
* more friendly error message for case traitliu fengyun2016-07-271-1/+4
|
* Drop restriction to 2nd order hk typesMartin Odersky2016-07-121-4/+2
| | | | Allow hk type parameters to be higher kinded themselves.
* Remove special case in parserMartin Odersky2016-07-111-10/+3
| | | | | | | | | | | | | | There was a special case that triggered a parse error in this course def lift[T <: Type](tp: T): (RecType => T) = arg match { case rt0: RecType => tp.subst(rt0, _).asInstanceOf[T] case _ => (x => tp) } The problem was that the rhs of the first case became a Function node, which caused a premature return from the case clause sequence. I could not determine anymore what the purpose of the removed case in the parser was; all tests compile without it.
* New type lambda scheme for hk typesMartin Odersky2016-07-111-1/+10
|
* Fix issues with `enterBlock` for comment parsingFelix Mulder2016-04-111-1/+1
|
* Implement comments as attachments instead of tree membersFelix Mulder2016-04-071-11/+7
|
* Add docstring support for types, vals, vars and defsFelix Mulder2016-04-071-11/+13
|
* Fix association of docstrings based on posisitionFelix Mulder2016-04-071-2/+2
| | | | | | | | | | | | | | | | | | | This commit fixes errors that would've occurred in this situation: ``` /** Docstring 1 */ <- this one would've been chosen /** Docstring 2 */ /** Docstring 3 */ class Class ``` And this situation: ``` /** Docstring 1 */ trait Trait /** Docstring 2 */ <- this one would've been chosen ```
* Add package object supportFelix Mulder2016-04-071-5/+6
|
* Add ability to parse nested classes/traits docstringsFelix Mulder2016-04-071-16/+18
|
* Add tests for classes and traitsFelix Mulder2016-04-071-1/+2
|
* Add initial support for raw docstrings in ASTsFelix Mulder2016-04-071-2/+9
|
* Merge pull request #1184 from liufengyun/error-posodersky2016-03-221-2/+4
|\ | | | | better positioning of `_*` not last argument error
| * better positioning of `_*` not last argument errorliu fengyun2016-03-181-2/+4
| | | | | | | | | | The error should be at the beginning of the underscore `_`, not the next token after the star `*`, which is the default.
* | support `xs @ _*` and `_*` in Scala2 modeliu fengyun2016-03-181-5/+34
|/ | | | | | | | | | | | The standard syntax in Dotty now is `xs : _*`. In Scala2 mode, following code should be valid: list match { case List(_, _, _, _ @ _*) => 0 case List(_, _, _*) => 1 case List(_, _: _*) => 2 case Nil => 3 }
* Address reviewer comments.Martin Odersky2016-03-141-1/+3
|
* Fix patch for constructors with procedure syntaxMartin Odersky2016-03-121-6/+7
| | | | | | | | | | | | | | A constructor def this() { ... } needs to be rewritten to def this() = { ... } not to def this(): Unit = { ... }
* Better encapsulationMartin Odersky2016-03-121-1/+1
| | | | | No more leaking ofMove PatchedFiles in a settings option. Move all patch classes into a `Rewrites` object.
* Add patching functionality for migrationMartin Odersky2016-03-121-1/+6
| | | | | Firs version of patching that can be invoked by dotty compiler itself.
* Allow Named Arguments in TypeArgsMartin Odersky2016-02-191-2/+2
| | | | Lets one also pass named arguments to methods.
* First version of named type argumentsMartin Odersky2016-02-191-5/+35
|
* Support named type parametersMartin Odersky2016-02-191-1/+1
| | | | | Changes needed to support simple named type parameters. Not yet implemented: named arguments.
* Improve migration message for Scala 2 proceduresGuillaume Martres2016-01-141-1/+1
| | | | | | It's not correct to just add `=` you also need to specify the return type to be `Unit` otherwise things may not work as expected, this is especially important for a `main` method.
* Fix parsing of blocks that end in an importMartin Odersky2015-12-191-1/+2
|
* Avoid spurious procedure syntax migration warningMartin Odersky2015-11-091-1/+1
|