[WIP] Skip comment only lines in the scala interpreter.#40
[WIP] Skip comment only lines in the scala interpreter.#40poplav wants to merge 1 commit intoapache:masterfrom
Conversation
|
We also need to consider multi-line comments ( val x = 3 /*
some comment
*/ val y = 4
// another comment
z = 5 // final comment?
// no, this is the final commentbecomes val x = 3
val y = 4
val z = 5Would 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 |
|
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. |
@chipsenkbeil does this fix https://issues.apache.org/jira/browse/TOREE-311?jql=project%20%3D%20TOREE?