-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macros desugars code blocks #2
Comments
Wait a second. If you have multiple statements... only capture the last expression that gets returned. I don't know if I am reading this correctly, but I don't think that this will work with multi-line expressions.
That looks nice, but it is pre-release, so I don't know if it will work in production. In case neither of those things work, a temporary fix would be to manually get rid of the "." on all the scala operators via string manipulation and wait for scalameta to come out of pre-release // Removal of "." produces a small but noticeable improvement
{
val someVal = 2;
(1) +(someVal) ==(4)
} You can choose any of these three solutions as long as it works and it does not break anything and I will approve it. |
Hey Gaullaume, I was wrong about the source code. Check this out: case class Text[T](value: T, source: String) } ^ You mentioned sourceCode.Text and I didn't actually read it. /** Java file corresponding to the source file of this position.
^ The line "v.tree.pos.source.content" actually appears to be able to get the actual raw string. |
I solved the problem.
Note that it does not always behave as you would expect. Example:
The reason is because if you wrap an expression in parenthesis, it cuts off everything outside the parenthesis. So (lala).toString becomes lala. libraryDependencies += "scala-trace-debug" %% "scala-trace-debug" % "0.1.6" |
for example I see this in the trace
I expect
this project solve the problem
https://github.com/lihaoyi/sourcecode#debug-prints
scalameta also has a good print of ast, but no
def macro
support yet.https://github.com/scalameta/tutorial/tree/advanced-dendrology#showsyntax
The text was updated successfully, but these errors were encountered: