[WIP] Skip comment only lines in the scala interpreter.
@chipsenkbeil does this fix https://issues.apache.org/jira/browse/TOREE-311?jql=project%20%3D%20TOREE?
We also need to consider multi-line comments (/*) if we're going to filter out that way. Might be a better idea to use regex to remove comments from the full code blob before splitting. // matches to newline and /* matches until */. E.g.
val x = 3 /*
some comment
*/ val y = 4
// another comment
z = 5 // final comment?
// no, this is the final comment
becomes
val x = 3
val y = 4
val z = 5
Would also be a good idea to have some sort of test (maybe system?) that can verify that providing comments does not provide an empty syntax error like you've seen.
@Lull3rSkat3r, @lbustelo, feel free to chime in on this one with your own thoughts.
agreed 🎐
I wonder is there is code in some Apache package to do this rather than rely on regex or string lookups directly.
@poplav Can you rename this into a [WIP]? I think there is more work to do here.
I'm not sure if this is the right place to comment, but having just switched to Toree it seems like this is just a symptom of the lack of :paste mode, along with having to use braces to give companion objects the same scope as their class, and not being able to do method chaining with dots at the beginnings of lines.
I know there are line magics, but I wonder if there's a way (maybe through a notebook magic) to make each cell be sent to the interpreter in :paste mode and disable the line-by-line functionality. This would bring things much more in line experientially with other REPLs.