diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-08-08 18:55:45 +0200 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-08-14 11:45:47 +0200 |
commit | e1bef09d8afe58d00aa0620ee1fd5e7ff92fe470 (patch) | |
tree | eadd8288ddf464d02e65824cc4834fce968d4bd3 /test/files/neg/quasiquotes-syntax-error-position.scala | |
parent | b4598b4a7826b76cc6405b448b50d6c20f7a5732 (diff) | |
download | scala-e1bef09d8afe58d00aa0620ee1fd5e7ff92fe470.tar.gz scala-e1bef09d8afe58d00aa0620ee1fd5e7ff92fe470.tar.bz2 scala-e1bef09d8afe58d00aa0620ee1fd5e7ff92fe470.zip |
SI-6843 well-positioned syntax errors for quasiquotes
This is achieved in a following way:
1. Similarly to toolbox quasiquotes can go away with wrapping for
parsing purpose after introduction of `parseStats` and `parseRule`
entry points.
2. In case of syntax error quasiquote computes equivalent corresponding
position in the source code with the help of `corrrespondingPosition`
mapper which relies on position data collected into `posMap` during
code generation.
Diffstat (limited to 'test/files/neg/quasiquotes-syntax-error-position.scala')
-rw-r--r-- | test/files/neg/quasiquotes-syntax-error-position.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/neg/quasiquotes-syntax-error-position.scala b/test/files/neg/quasiquotes-syntax-error-position.scala new file mode 100644 index 0000000000..b97af52cfc --- /dev/null +++ b/test/files/neg/quasiquotes-syntax-error-position.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +object test extends App { + val a = TermName("a") + val t = TypeName("t") + q"def $a f" + q"$a(" + q"class $t { def foo = $a" + q"import $t $t" + q"package p" + q"foo@$a" + q"case class A" + tq"$t => $t $t]" + cq"pattern => body ; case pattern2 =>" + pq"$a(bar" +}
\ No newline at end of file |