forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#10040 from lrytz/t12597
Fix AST positions for XML literals, selections from blocks
- Loading branch information
Showing
16 changed files
with
195 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
List((26,30)) | ||
List((26,33)) | ||
List((26,42), (26,33)) | ||
List((26,44), (27,34)) | ||
List((26,46), (28,35)) | ||
List((26,37), (26,26), (26,33), (33,37)) | ||
List((26,46), (26,37), (26,26), (26,33), (33,37)) | ||
List((26,36), (26,27)) | ||
List((26,36), (26,27)) | ||
List((26,51), (26,42), (28,37), (36,37), (39,40)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import scala.tools.partest._ | ||
import scala.collection.mutable.LinkedHashMap | ||
|
||
object Test extends CompilerTest { | ||
import global._ | ||
override def extraSettings = super.extraSettings + " -Yrangepos -Ystop-after:parser" | ||
val tests = List( | ||
"class A1 { def t = <a/> }", | ||
"class A2 { def t = <a></a> }", | ||
"class A3 { def t = <a></a>.toString }", | ||
"class A4 { def t = (<a></a>).toString }", | ||
"class A5 { def t = { <a></a> }.toString }", | ||
"class A6 { def t = <a></a><b/> }", | ||
"class A7 { def t = <a></a><b/>.toString }", | ||
"class B1 { def t(c: A1) = c.toString }", | ||
"class B2 { def t(c: A1) = c toString }", | ||
"class B3 { def t(c: A1) = { val x = c; x }.toString }", | ||
// ^ 26 ^ 36 | ||
) | ||
|
||
override def sources = tests | ||
|
||
def check(source: String, unit: CompilationUnit): Unit = unit.body foreach { | ||
case dd: DefDef if dd.name.startsWith("t") => | ||
val poss = dd.rhs.collect { | ||
case t if t.pos != NoPosition => (t.pos.start, t.pos.end) | ||
}.distinct | ||
println(poss) | ||
case _ => | ||
} | ||
} |
Oops, something went wrong.