diff options
author | Robey Pointer <robey@twitter.com> | 2012-05-08 15:25:29 -0700 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-07 02:08:38 -0500 |
commit | 0318bf2b10782180940d5144ba6492b54e2bdd59 (patch) | |
tree | 53d3dfd65753c6d5ed67fa8d7a979c7b33caba01 /libraries/eval | |
parent | a03c54550d62550ea2292a5947fef4f5bcba040f (diff) | |
download | cbt-0318bf2b10782180940d5144ba6492b54e2bdd59.tar.gz cbt-0318bf2b10782180940d5144ba6492b54e2bdd59.tar.bz2 cbt-0318bf2b10782180940d5144ba6492b54e2bdd59.zip |
[split] improve the docs a bit.
Diffstat (limited to 'libraries/eval')
-rw-r--r-- | libraries/eval/Eval.scala | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/libraries/eval/Eval.scala b/libraries/eval/Eval.scala index 9f75811..522dcc7 100644 --- a/libraries/eval/Eval.scala +++ b/libraries/eval/Eval.scala @@ -43,25 +43,22 @@ object Eval extends Eval { } /** - * evaluates files, strings or input streams, and returns the result. - * In all cases, code to be evaled is wrapped in an apply method in a - * generated class. An instance of the class is instantiated, and the - * result of apply is returned. + * Evaluates files, strings, or input streams as scala code, and returns the result. * - * If target is None, the results are compiled to memory (and are therefore - * ephemeral). If target is Some(path), path must point to a directory, and - * eval emits class files to that directory. + * If `target` is `None`, the results are compiled to memory (and are therefore ephemeral). If + * `target` is `Some(path)`, the path must point to a directory, and classes will be saved into + * that directory. * - * eval also supports a limited set of preprocessors. Limited means - * exactly one, that supports directives of the form #include <file>. + * Eval also supports a limited set of preprocessors. Currently, "limited" means "exactly one": + * directives of the form `#include <file>`. * - * The general flow of evaluation is - * # convert arguments to a string - * # run preprocessors on that string - * # wrap processed code in a class - * # compile the class - * # create an instance of that class - * # return the results of apply() + * The flow of evaluation is: + * - extract a string of code from the file, string, or input stream + * - run preprocessors on that string + * - wrap processed code in an `apply` method in a generated class + * - compile the class + * - contruct an instance of that class + * - return the result of `apply()` */ class Eval(target: Option[File]) { /** @@ -109,7 +106,7 @@ class Eval(target: Option[File]) { ) ) - private lazy val compiler = new StringCompiler(2, target) + private[this] lazy val compiler = new StringCompiler(2, target) /** * run preprocessors on our string, returning a String that is the processed source |