added checking for multiline comments in scala
authorYaniv Rodenski <roadan@gmail.com>
Sat, 9 Jun 2018 04:23:57 +0000 (14:23 +1000)
committerYaniv Rodenski <roadan@gmail.com>
Sat, 9 Jun 2018 04:23:57 +0000 (14:23 +1000)
executor/src/main/scala/org/apache/spark/repl/amaterasu/runners/spark/SparkScalaRunner.scala
executor/src/test/scala/org/apache/amaterasu/spark/SparkScalaRunnerTests.scala

index a45b8c0..56a04cf 100755 (executable)
@@ -61,7 +61,8 @@ class SparkScalaRunner(var env: Environment,
 
     for (line <- source.getLines()) {
 
-      if (!line.isEmpty) {
+      // ignoring empty or commented lines
+      if (!line.isEmpty && !line.trim.startsWith("*") && !line.startsWith("/")) {
 
         outStream.reset()
         log.debug(line)
index 9575205..1d79fc9 100755 (executable)
@@ -33,7 +33,6 @@ class SparkScalaRunnerTests extends FlatSpec with Matchers with BeforeAndAfterAl
 
   "SparkScalaRunner" should "execute the simple-spark.scala" in {
 
-
     val sparkRunner =factory.getRunner("spark", "scala").get.asInstanceOf[SparkScalaRunner]
     val script = getClass.getResource("/simple-spark.scala").getPath
     val sourceCode = Source.fromFile(script).getLines().mkString("\n")