|
Scala example source code file (RunnerUtils.scala)
The Scala RunnerUtils.scala source code/* NEST (New Scala Test) * Copyright 2007-2011 LAMP/EPFL * @author Philipp Haller */ // $Id$ package scala.tools.partest package nest object RunnerUtils { def splitArgs(str: String) = str split "\\s" filterNot (_ == "") toList def searchPath(option: String, as: List[String]): Option[String] = as match { case `option` :: r :: _ => Some(r) case _ :: rest => searchPath(option, rest) case Nil => None } def searchAndRemovePath(option: String, as: List[String]) = (as indexOf option) match { case -1 => (None, as) case idx => (Some(as(idx + 1)), (as take idx) ::: (as drop (idx + 2))) } def searchAndRemoveOption(option: String, as: List[String]) = (as indexOf option) match { case -1 => (false, as) case idx => (true, (as take idx) ::: (as drop (idx + 1))) } } Other Scala examples (source code examples)Here is a short list of links related to this Scala RunnerUtils.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.