object Parser
Parses Jsonnet source code String
s 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.
- Alphabetic
- By Inheritance
- Parser
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def args[_](implicit arg0: P[Any]): P[Args]
- def arr[_](implicit arg0: P[Any]): P[Expr]
- def arrBody[_](implicit arg0: P[Any]): P[Expr]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assertExpr[_](index: Int)(implicit arg0: P[Any]): P[Expr]
- def assertStmt[_](implicit arg0: P[Any]): P[AssertStmt]
- def binaryop[_](implicit arg0: P[Any]): P[String]
- def bind[_](implicit arg0: P[Any]): P[Bind]
- def break[_](implicit arg0: P[Any]): P[Unit]
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
- def compSuffix[_](implicit arg0: P[Any]): P[Left[(ForSpec, Seq[CompSpec]), Nothing]]
- def compspec[_](implicit arg0: P[Any]): P[Seq[CompSpec]]
- def constructString(index: Int, lines: Seq[String]): Str
- def document[_](implicit arg0: P[Any]): P[(Expr, Map[String, Int])]
- def doubleString[_](implicit arg0: P[Any]): P[Seq[String]]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def error[_](index: Int)(implicit arg0: P[Any]): P[Expr.Error]
- def escape[_](implicit arg0: P[Any]): P[String]
- def escape0[_](implicit arg0: P[Any]): P[String]
- def escape1[_](implicit arg0: P[Any]): P[String]
- def expr[_](implicit arg0: P[Any]): P[Expr]
- def expr1[_](implicit arg0: P[Any]): P[Expr]
- def expr2[_](implicit arg0: P[Any]): P[Expr]
- def exprSuffix2[_](implicit arg0: P[Any]): P[(Expr) ⇒ Expr]
- def field[_](implicit arg0: P[Any]): P[Field]
- def fieldKeySep[_](implicit arg0: P[Any]): P[Visibility]
- def fieldname[_](implicit arg0: P[Any]): P[Product with Serializable with FieldName]
- def forspec[_](implicit arg0: P[Any]): P[ForSpec]
- def function[_](index: Int)(implicit arg0: P[Any]): P[Expr]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def id[_](implicit arg0: P[Any]): P[String]
- def idStartChar(c: Char): Boolean
- def ifElse[_](index: Int)(implicit arg0: P[Any]): P[Expr]
- def ifspec[_](implicit arg0: P[Any]): P[IfSpec]
- def import[_](index: Int)(implicit arg0: P[Any]): P[Import]
- def importStr[_](index: Int)(implicit arg0: P[Any]): P[ImportStr]
-
def
indexFor[_](name: String)(implicit arg0: P[Any]): Int
We assign local identifier names to integer offsets into a local variable array at parse time, to avoid having to make a separate pass over the AST to replace them.
We assign local identifier names to integer offsets into a local variable array at parse time, to avoid having to make a separate pass over the AST to replace them. This is sub-optimal, since we do not keep track of the fact that identifiers in unrelated scopes could share slots in the array, but it's good enough for now since the number of local variables in a particular file tends to be pretty small.
We do not bother releasing a slot when backtracking after a parse fails, because this parser uses cuts to aggressively prevent backtracking.
The Jsonnet standard library
std
always lives at slot 0. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val keywords: Set[String]
- def literalDoubleString[_](implicit arg0: P[Any]): P[Seq[String]]
- def literalSingleString[_](implicit arg0: P[Any]): P[Seq[String]]
- def local[_](implicit arg0: P[Any]): P[Expr]
- def localExpr[_](implicit arg0: P[Any]): P[Expr]
- def member[_](implicit arg0: P[Any]): P[Member]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def number[_](implicit arg0: P[Any]): P[Num]
- def obj[_](implicit arg0: P[Any]): P[Expr]
- def objinside[_](implicit arg0: P[Any]): P[ObjBody]
- def objlocal[_](implicit arg0: P[Any]): P[BindStmt]
- def params[_](implicit arg0: P[Any]): P[Params]
- def parened[_](implicit arg0: P[Any]): P[Parened]
- val precedence: Map[String, Int]
- val precedenceTable: Seq[Seq[String]]
- def singleString[_](implicit arg0: P[Any]): P[Seq[String]]
- def string[_](implicit arg0: P[Any]): P[String]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def tripleBarBlank[_](implicit arg0: P[Any]): P[String]
- def tripleBarBlankHead[_](implicit arg0: P[Any]): P[String]
- def tripleBarString[_](implicit arg0: P[Any]): P[Seq[String]]
- def tripleBarStringBody[_](w: String)(implicit arg0: P[Any]): P[Seq[String]]
- def tripleBarStringHead[_](implicit arg0: P[Any]): P[(Seq[String], String, String)]
- def tripleBarStringLines[_](implicit arg0: P[Any]): P[Seq[String]]
- def unaryOpExpr[_](index: Int, op: Char)(implicit arg0: P[Any]): P[UnaryOp]
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )