p

sjsonnet

package sjsonnet

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. class BaseCharRenderer[T <: Output] extends JsVisitor[T, T]
  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. class CachedImporter extends Importer
  4. class CachedResolver extends CachedImporter
  5. class DefaultParseCache extends ParseCache
  6. class Error extends Exception

    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.

  7. trait EvalErrorScope extends AnyRef
  8. abstract class EvalScope extends EvalErrorScope

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

  9. 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.

  10. 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.

  11. abstract class ExprTransform extends AnyRef

    Simple tree transformer for the AST.

  12. 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.

  13. abstract class Importer extends AnyRef

    Resolve and read imported files

  14. class Interpreter extends AnyRef

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

  15. case class JsVirtualPath(path: String) extends Path with Product with Serializable
  16. abstract class Lazy extends AnyRef

    Lazy models lazy evaluation within a Jsonnet program.

    Lazy models lazy evaluation within a Jsonnet program. Lazily evaluated dictionary values, array contents, or function parameters are all wrapped in Lazy and only truly evaluated on-demand

  17. case class MaterializeJsonRenderer(indent: Int = 4, escapeUnicode: Boolean = false, out: StringWriter = new StringWriter()) extends BaseCharRenderer[StringWriter] with Product with Serializable

    Renderer used by std.manifestJson and std.manifestJsonEx

  18. abstract class Materializer extends AnyRef

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

  19. trait ParseCache extends AnyRef
  20. class ParseError extends Error
  21. class Parser extends AnyRef
  22. 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.

  23. final class Position extends AnyRef
  24. class PrettyNamed[T] extends AnyRef
  25. 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.

  26. class PythonRenderer extends BaseCharRenderer[Writer]
  27. sealed abstract class ReadWriter[T] extends AnyRef

    Typeclasses for easy conversion between Vals and Scala data types

  28. class Renderer extends BaseCharRenderer[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

  29. class ScopedExprTransform extends ExprTransform

    Tree transformer that keeps track of the bindings in the static scope.

  30. class Settings extends AnyRef

    Settings for the interpreter.

    Settings for the interpreter. This is a subset of Config which is used in the inner layers of the interpreters and shared between all platforms.

  31. class StaticError extends Error
  32. class StaticOptimizer extends ScopedExprTransform

    StaticOptimizer performs necessary transformations for the evaluator (assigning ValScope indices) plus additional optimizations (post-order) and static checking (pre-order).

  33. sealed abstract class Val extends Lazy

    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.

  34. final class ValScope extends AnyVal

    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.

  35. class ValVisitor extends JsVisitor[Val, Val]

    Parse JSON directly into a literal Val

  36. class YamlRenderer extends BaseCharRenderer[StringWriter]

Value Members

  1. object ArrayOps

    Array operations which are missing in Scala 2.12

  2. object BaseRenderer
  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 Importer
  9. object Materializer extends Materializer
  10. 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.

  11. object Platform
  12. object PrettyNamed
  13. object PrettyYamlRenderer
  14. object ReadWriter
  15. object RenderUtils
  16. object ScopedExprTransform
  17. object Settings
  18. object SjsonnetMain
    Annotations
    @JSExportTopLevel( "SjsonnetMain" )
  19. object StaticError extends Serializable
  20. 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

  21. object Util
  22. object Val
  23. object ValScope
  24. object Version
  25. object YamlRenderer

Ungrouped