scala-macro-debug
scala-macro-debug copied to clipboard
Can you def str(arg) => (arg, String) instead printing?
It would be universal solution to stringify a param for later reuse of the string rather than simply println it in the debug.
Sure you can, should be an easy change - or rather adding another quote
method as you suggest in #4. Maybe you'd like to attempt creating a PR?
No, I will be happy to install "com.softwaremill.scalamacrodebug" %% "macros" % "0.4"
right into my sbt :)
Know what, QUOTE(expression: ScalaCode => String)
is not enough. We still need TITLED(expression: ScalaCode => (String, Expression))
you know because it is the only way to replace
test("integer_literal", integer_literal, 10)
test("integer_literal", integer_literal, 16xAA)
in use with the desired
def test(parserSpec) {
val parser = parserSpec._2 ; val parserName = parserSpec._1
...
print("parser " + parserName + " produced " + result)
}
test(integer_literal, 10)
test(integer_literal, 16xAA)