title: How to distinguish triple quotes from single quotes in macros?
body: <p>I am writing a macro <code>m(expr: String)</code>, where <code>expr</code> is an expression in some language (not Scala):</p>
  
  <pre><code>m("SOME EXPRESSION")
  
  m("""
    SOME EXPRESSION
  """)
  </code></pre>
  
  <p>When I am parsing the expression I would like to report error messages with proper locations in the source file. To achieve this I should know the location of the string literal itself and the number of quotes of the literal (3 or 1). Unfortunately, I did not find any method that returns the number of quotes of the literal:</p>
  
  <pre><code>import scala.language.experimental.macros
  import scala.reflect.macros.blackbox.Context
  
  object Temp {
    def m(s: String) : String = macro mImpl
  
    def mImpl(context: Context)(s: context.Expr[String]): context.universe.Tree = {
      import context.universe._
  
      s match {
        case l @ Literal(Constant(p: String)) =&gt;
          if (l.&lt;TRIPLE QUOTES&gt;) {
            ...
          } else {
            ...
          }
  
        case _ =&gt;
          context.abort(context.enclosingPosition, "The argument of m must be a string literal")
      }
    }
  }
  </code></pre>
  
  <p>What should I put instead of <code>&lt;TRIPLE QUOTES&gt;</code>?</p>