p

sjsonnet

package sjsonnet

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. case class Applyer(f: Func, ev: EvalScope, fs: FileScope) extends Product with Serializable
  2. class BaseRenderer[T <: Writer] extends JsVisitor[T, T]

    Vendored version of ujson.BaseRenderer from ujson 1.2.3.

    Vendored version of ujson.BaseRenderer from ujson 1.2.3.

    uJson has replaced this with a pair of byte/char specialized renderers for performance. For now, we just want to upgrade uJson to the latest version to avoid classpath conflicts, so just vendor this code for now. In the future we may remove it to interface with uJson's specialized renderers directly, to benefit from their improved performance.

  3. case class Config(interactive: Flag = Flag(), jpaths: List[String] = Nil, outputFile: Option[String] = None, multi: Option[String] = None, createDirs: Flag = Flag(), yamlStream: Flag = Flag(), expectString: Flag = Flag(), extStr: Seq[String] = Nil, extStrFile: Seq[String] = Nil, extCode: Seq[String] = Nil, extCodeFile: Seq[String] = Nil, tlaStr: Seq[String] = Nil, tlaStrFile: Seq[String] = Nil, tlaCode: Seq[String] = Nil, tlaCodeFile: Seq[String] = Nil, indent: Int = 3, preserveOrder: Flag = Flag(), strict: Flag = Flag(), yamlOut: Flag = Flag(), file: String, yamlDebug: Flag = Flag()) extends Product with Serializable
    Annotations
    @main()
  4. case class Error(msg: String, stack: List[StackTraceElement], underlying: Option[Throwable]) extends Exception with Product with Serializable

    An exception that can keep track of the Sjsonnet call-stack while it is propagating upwards.

    An exception that can keep track of the Sjsonnet call-stack while it is propagating upwards. This helps provide good error messages with line numbers pointing towards user code.

  5. trait EvalErrorScope extends AnyRef
  6. trait EvalScope extends EvalErrorScope

    EvalScope models the per-evaluator context that is propagated throughout the Jsonnet evaluation.

  7. class Evaluator extends EvalScope

    Recursively walks the Expr trees to convert them into into Val objects that can be materialized to JSON.

    Recursively walks the Expr trees to convert them into into Val objects that can be materialized to JSON.

    Performs import resolution and parsing on-demand when the relevant nodes in the syntax tree are reached, and caches the evaluated result of each imported module to be re-used. Parsing is cached separatedly by an external parseCache.

  8. trait Expr extends AnyRef

    Exprs are the parsed syntax trees of a Jsonnet program.

    Exprs are the parsed syntax trees of a Jsonnet program. They model the program mostly as-written, except for resolving local variable names and assigning them indices in the scope bindings array.

    Each Expr represents an expression in the Jsonnet program, and contains an integer offset into the file that is later used to provide error messages.

  9. class FileScope extends AnyRef

    FileScope models the per-file context that is propagated throughout the evaluation of a single Jsonnet file.

    FileScope models the per-file context that is propagated throughout the evaluation of a single Jsonnet file. Contains the current file path, as well as the mapping of local variable names to local variable array indices which is shared throughout each file.

  10. class Interpreter extends AnyRef

    Wraps all the machinery of evaluating Jsonnet source code, from parsing to evaluation to materialization, into a convenient wrapper class.

  11. case class OsPath(p: os.Path) extends Path with Product with Serializable
  12. class Parser extends AnyRef
  13. trait Path extends AnyRef

    Paths represent handles that Sjsonnet can use to resolve imports and load file contents.

    Paths represent handles that Sjsonnet can use to resolve imports and load file contents. Abstracts away the filesystem access so import resolution can be customized, e.g. using a virtual filesystem when running in the browser.

  14. class Position extends AnyRef
  15. class PrettyNamed[T] extends AnyRef
  16. class PrettyYamlRenderer extends BaseRenderer[Writer]

    A version of YamlRenderer that tries its best to make the output YAML as pretty as possible: unquoted strings, de-dented lists, etc.

    A version of YamlRenderer that tries its best to make the output YAML as pretty as possible: unquoted strings, de-dented lists, etc. Follows the PyYAML style. Also adds the ability to stream writes to a generic Writer.

  17. class PythonRenderer extends BaseRenderer[Writer]
  18. sealed abstract class ReadWriter[T] extends AnyRef

    Typeclasses for easy conversion between Vals and Scala data types

  19. class Renderer extends BaseRenderer[Writer]

    Custom JSON renderer to try and match the behavior of google/jsonnet's render:

    Custom JSON renderer to try and match the behavior of google/jsonnet's render:

    - Custom printing of Doubles - Custom printing of empty dictionaries and arrays

  20. sealed abstract class Val extends AnyRef

    Vals represented Jsonnet values that are the result of evaluating a Jsonnet program.

    Vals represented Jsonnet values that are the result of evaluating a Jsonnet program. The Val data structure is essentially a JSON tree, except evaluation of object attributes and array contents are lazy, and the tree can contain functions.

  21. class ValScope extends AnyRef

    ValScopes which model the lexical scopes within a Jsonnet file that bind variable names to Vals, as well as other contextual information like self this or super.

    ValScopes which model the lexical scopes within a Jsonnet file that bind variable names to Vals, as well as other contextual information like self this or super.

    Note that scopes are standalone, and nested scopes are done by copying and updating the array of bindings rather than using a linked list. This is because the bindings array is typically pretty small and the constant factor overhead from a cleverer data structure dominates any algorithmic improvements

    The bindings array is private and only copy-on-write, so for nested scopes which do not change it (e.g. those just updating dollar0 or self0) the bindings array can be shared cheaply.

  22. class YamlRenderer extends BaseRenderer[StringWriter]

Value Members

  1. object BaseRenderer
  2. object BitSetUtils
  3. object DecimalFormat

    Minimal re-implementation of java.text.DecimalFormat, for Scala.js compatibility (the existing shim for java.text scala-java-locales isn't fully compliant, and adds tons of unnecessary code that bloats the JS bundle)

  4. object Error extends Serializable
  5. object Evaluator
  6. object Expr
  7. object Format

    Minimal re-implementation of Python's % formatting logic, since Jsonnet's % formatter is basically "do whatever python does", with a link to:

    Minimal re-implementation of Python's % formatting logic, since Jsonnet's % formatter is basically "do whatever python does", with a link to:

    - https://docs.python.org/2/library/stdtypes.html#string-formatting

    Parses the formatted strings into a sequence of literal strings separated by % interpolations modelled as structured Format.FormatSpecs, and use those to decide how to inteprolate the provided Jsonnet Vals into the final string.

  8. object Materializer

    Serializes the given Val out to the given upickle.core.Visitor, which can transform it into ujson.Values or directly serialize it to Strings

  9. object Parser

    Parses Jsonnet source code Strings into a Expr syntax tree, using the FastParse parsing library.

    Parses Jsonnet source code Strings into a Expr syntax tree, using the FastParse parsing library. Uses precedence climbing to handle infix operators, and resolves local variable names to array indices during parsing to allow better performance at runtime.

  10. object Platform
  11. object PrettyNamed
  12. object PrettyYamlRenderer
  13. object ReadWriter
  14. object RenderUtils
  15. object SjsonnetMain
  16. object Std

    The Jsonnet standard library, std, with each builtin function implemented in Scala code.

    The Jsonnet standard library, std, with each builtin function implemented in Scala code. Uses builtin and other helpers to handle the common wrapper logic automatically

  17. object Util
  18. object Val
  19. object ValScope
  20. object Version
  21. object YamlRenderer

Ungrouped