Parser

ammonite.compiler.iface.Parser
See theParser companion object
abstract class Parser

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

def defaultHighlight(buffer: Vector[Char], comment: Attrs, `type`: Attrs, literal: Attrs, keyword: Attrs, reset: Attrs, notImplemented: Attrs): Vector[Char]
def isObjDef(code: String): Boolean
def parseImportHooksWithIndices(source: CodeSource, stmts: Seq[(Int, String)]): (Seq[String], Seq[ImportTree])
def scriptBlocksWithStartIndices(rawCode: String, fileName: String): Either[ScriptSplittingError, Seq[ScriptBlock]]
def split(code: String, ignoreIncomplete: Boolean, fileName: String): Option[Either[String, Seq[String]]]
def splitScript(rawCode: String, fileName: String): Either[String, IndexedSeq[(String, Seq[String])]]

Splits up a script file into its constituent blocks, each of which is a tuple of (leading-whitespace, statements). Leading whitespace is returned separately so we can later manipulate the statements e.g. by adding val res2 = without the whitespace getting in the way

Splits up a script file into its constituent blocks, each of which is a tuple of (leading-whitespace, statements). Leading whitespace is returned separately so we can later manipulate the statements e.g. by adding val res2 = without the whitespace getting in the way

Attributes

Concrete methods

final def parseImportHooks(source: CodeSource, stmts: Seq[String]): (Seq[String], Seq[ImportTree])