Package

ammonite

repl

Permalink

package repl

Visibility
  1. Public
  2. All

Type Members

  1. case class ArgParseException(name: String, value: String, typeName: String, cause: Throwable) extends Exception with Product with Serializable

    Permalink
  2. case class Bind[T](name: String, value: T)(implicit typeTag: scala.reflect.api.JavaUniverse.TypeTag[T]) extends Product with Serializable

    Permalink

    Models a binding of a value to a typed name, and is passed into the REPL so it can re-create the bindings inside the REPL's scope

  3. case class Catching(handler: PartialFunction[Throwable, Failing]) extends Product with Serializable

    Permalink

    Fake for-comprehension generator to catch errors and turn them into Res.Failures

  4. trait CodeColors extends AnyRef

    Permalink
  5. case class Colors(prompt: Ref[Attrs], ident: Ref[Attrs], type: Ref[Attrs], literal: Ref[Attrs], prefix: Ref[Attrs], comment: Ref[Attrs], keyword: Ref[Attrs], selected: Ref[Attrs], error: Ref[Attrs], warning: Ref[Attrs]) extends Product with Serializable

    Permalink

    A set of colors used to highlight the miscellanious bits of the REPL.

    A set of colors used to highlight the miscellanious bits of the REPL. Re-used all over the place in PPrint, TPrint, syntax highlighting, command-echoes, etc. in order to keep things consistent

    prompt

    The command prompt

    ident

    Definition of top-level identifiers

    literal

    Strings, integers and other literal expressions

    prefix

    The Seq/Foo when printing a Seq(...) or case class Foo(...)

    selected

    The color of text selected in the line-editor

    error

    The color used to print error messages of all kinds

  6. class CompilationError extends Exception

    Permalink

    Exception for reporting script compilation failures

  7. case class EntryConfig(file: Option[Path]) extends Product with Serializable

    Permalink
  8. case class Evaluated(wrapper: String, imports: Imports) extends Product with Serializable

    Permalink
  9. class History extends IndexedSeq[String] with IndexedSeqLike[String, History]

    Permalink
  10. case class ImportData(fromName: String, toName: String, prefix: String, importType: ImportType) extends Product with Serializable

    Permalink

    Represents the importing of a single name in the Ammonite REPL, of the form

    Represents the importing of a single name in the Ammonite REPL, of the form

    import $prefix.{$fromName => $toName}

    All imports are reduced to this form; import $prefix.$name is results in the fromName and toName being the same, while import $prefix._ or import $prefix.{foo, bar, baz} are split into multiple distinct ImportData objects.

    Note that imports can be of one of three distinct ImportTypes: importing a type, a term, or both. This lets us properly deal with shadowing correctly if we import the type and term of the same name from different places

  11. class Imports extends AnyRef

    Permalink

    Represents the imports that occur before a piece of user code in the Ammonite REPL.

    Represents the imports that occur before a piece of user code in the Ammonite REPL. It's basically a Seq[ImportData], except we really want it to be always in a "canonical" form without shadowed/duplicate imports.

    Thus we only expose an apply method which performs this de-duplication, and a ++ operator that combines two sets of imports while performing de-duplication.

  12. case class Main(predef: String = "", defaultPredef: Boolean = true, storageBackend: Storage = ..., wd: Path = ammonite.ops.cwd, welcomeBanner: Option[String] = Some(Main.defaultWelcomeBanner), inputStream: InputStream = System.in, outputStream: OutputStream = System.out, errorStream: OutputStream = System.err) extends Product with Serializable

    Permalink

    Contains the various entry points to the Ammonite REPL.

    Contains the various entry points to the Ammonite REPL.

    Configuration of the basic REPL is done by passing in arguments when constructing the Main instance, and the various entrypoints such as run runScript and so on are methods on that instance.

    It is more or less equivalent to the Repl object itself, and has a similar set of parameters, but does not have any of the Repl's implementation-related code and provides a more convenient set of entry-points that a user can call.

    Note that the instantiateRepl function generates a new Repl every time it is called!

    predef

    Any additional code you want to run before the REPL session starts. Can contain multiple blocks separated by @s

    defaultPredef

    Do you want to include the "standard" predef imports provided by Ammonite? These include tools like time, grep, the | || |? pipes from ammonite-ops, and other helpers. Can be disabled to give a clean namespace for you to fill using your own predef.

    storageBackend

    Where will all of Ammonite's persistent data get stored? Things like any predef.scala file, compilation/ivy caches, etc.. Defaults include Storage.Folder and Storage.InMemory, though you can create your own.

    wd

    The working directory of the REPL; when it load scripts, where the scripts will be considered relative to when assigning them packages

  13. case class Printer(out: (String) ⇒ Unit, warning: (String) ⇒ Unit, error: (String) ⇒ Unit, info: (String) ⇒ Unit) extends Product with Serializable

    Permalink

    Encapsulates the ways the Ammonite REPL prints things.

    Encapsulates the ways the Ammonite REPL prints things. Does not print a trailing newline by default; you have to add one yourself.

    out

    How you want it to print streaming fragments of stdout

    warning

    How you want it to print a compile warning

    error

    How you want it to print a compile error

    info

    How you want to print compile info logging. *Not* the same as out, which is used to print runtime output.

  14. trait Ref[T] extends StableRef[T]

    Permalink
  15. class Repl extends AnyRef

    Permalink
  16. sealed abstract class Res[+T] extends AnyRef

    Permalink

    The result of a single pass through the ammonite REPL.

    The result of a single pass through the ammonite REPL. Results in a single T, or of one of a fixed number of failures that are common for anyone who is evaluating code via the REPL.

  17. trait StableRef[T] extends AnyRef

    Permalink

    Encapsulates a read-write cell that can be passed around

  18. trait Storage extends AnyRef

    Permalink

    Trait for the interface of common persistent storage.

    Trait for the interface of common persistent storage. This handles history and persistent caches. Right now it is not threadsafe nor does it handle the mutual exclusion of files between processes. Mutexes should be added to be able to run multiple Ammonite processes on the same system.

Value Members

  1. object Bind extends Serializable

    Permalink
  2. object Colors extends Serializable

    Permalink
  3. object Ex

    Permalink

    Nice pattern matching for chained exceptions

  4. object History

    Permalink
  5. object ImportData extends Serializable

    Permalink
  6. object Imports

    Permalink
  7. object Main extends Serializable

    Permalink
  8. object Parsers

    Permalink
  9. object Ref

    Permalink
  10. object Repl

    Permalink
  11. object Res

    Permalink
  12. object ScriptInit

    Permalink

    Code used to de-serialize command-line arguments when calling an Ammonite script.

    Code used to de-serialize command-line arguments when calling an Ammonite script. Basically looks for a scopt.Read for the type of each argument and uses that to de-serialize the given String into that argument.

    Needs a bit of macro magic to work.

  13. object Storage

    Permalink
  14. object Timer

    Permalink
  15. object Util

    Permalink
  16. package frontend

    Permalink

    Everything to do with the interaction of the Ammonite REPL with the user and the terminal.

    Everything to do with the interaction of the Ammonite REPL with the user and the terminal. Interfacing with ammonite-terminal (or with JLine)

  17. package interp

    Permalink

    What actually lets us compile and execute code in the Ammonite REPL; deals with the Scala compiler, preprocessing the strings, JVM classloaders, etc.

  18. package tools

    Permalink

    Things that are available inside the Ammonite REPL, are really convenient to have available.

Ungrouped