1// This file describes structure of jsonnet source code2// It is also used to generate files in src/generated34// Token names ending with `!` are considered meta, and handled specifically56SourceFile = Expr78ExprBinary =9 lhs:LhsExpr10 BinaryOperator11 rhs:Expr12ExprUnary =13 UnaryOperator14 rhs:Expr15ExprSlice =16 Expr17 SliceDesc18ExprIndex =19 Expr20 '.'21 index:Name22ExprIndexExpr =23 base:LhsExpr24 '['25 index:Expr26 ']'27ExprApply =28 Expr29 ArgsDesc30 'tailstrict'?31ExprObjExtend =32 LhsExpr33 Expr34ExprParened =35 '('36 Expr37 ')'3839ExprLiteral =40 Literal41ExprIntrinsicThisFile =42 '$intrinsicThisFile'43ExprIntrinsicId =44 '$intrinsicId'45ExprIntrinsic =46 '$intrinsic'47 '('48 name:Name49 ')'50ExprString =51 String52ExprNumber =53 Number54ExprArray =55 '['56 (Expr (',' Expr)* ','?)?57 ']'58ExprObject =59 '{'60 ObjBody61 '}'62ExprArrayComp =63 '['64 Expr65 ','?66 CompSpec*67 ']'6869ExprImport =70 ImportKind String7172ImportKind =73 'importstr'74| 'importbin'75| 'import'7677ExprVar =78 name:Name79ExprLocal =80 'local'81 (Bind (',' Bind)* ','?)82 ';'83 Expr8485ExprIfThenElse =86 'if'87 cond:Expr88 'then'89 then:TrueExpr90 ('else' else_:FalseExpr)?9192ExprFunction =93 'function'94 '('95 ParamsDesc96 ')'97 Expr98ExprAssert =99 Assertion100 ';'101 Expr102ExprError =103 'error'104 Expr105106Expr =107 ExprBinary108| ExprUnary109| ExprSlice110| ExprIndex111| ExprIndexExpr112| ExprApply113| ExprObjExtend114| ExprParened115| ExprIntrinsicThisFile116| ExprIntrinsicId117| ExprIntrinsic118| ExprString119| ExprNumber120| ExprLiteral121| ExprArray122| ExprObject123| ExprArrayComp124| ExprImport125| ExprVar126| ExprLocal127| ExprIfThenElse128| ExprFunction129| ExprAssert130| ExprError131132BinaryOperator =133 '||' | '&&'134| '|' | '^' | '&'135| '==' | '!=' | '<' | '>' | '<=' | '>=' | 'in'136| '<<' | '>>'137| '+' | '-'138| '*' | '/' | '%'139| 'ERROR_NO_OPERATOR!'140141UnaryOperator =142 '-' | '!' | '~'143144SliceDescEnd=Expr145SliceDescStep=Expr146SliceDesc =147 '['148 from:Expr?149 ':'150 (151 end:SliceDescEnd?152 (153 ':'154 step:SliceDescStep?155 )?156 )?157 ']'158159Name =160 'LIT_IDENT!'161162ArgsDesc =163 '('164 (Arg (',' Arg)* ','?)?165 ')'166Arg =167 (name:Name '=')? Expr168169ObjBodyComp =170 pre:ObjLocalPostComma*171 '['172 key:LhsExpr173 ']'174 '+'?175 ':'176 value:Expr177 post:ObjLocalPreComma*178 CompSpec*179ObjBodyMemberList =180 (Member (',' Member)* ','?)?181ObjBody =182 ObjBodyComp183| ObjBodyMemberList184185ObjLocalPostComma =186 ObjLocal187 ','188ObjLocalPreComma =189 ','190 ObjLocal191192MemberBindStmt = ObjLocal193MemberAssertStmt = Assertion194MemberField = Field195Member =196 MemberBindStmt197| MemberAssertStmt198| MemberField199200ObjLocal =201 'local'202 Bind203204FieldNormal =205 FieldName206 '+'?207 Visibility208 Expr209FieldMethod =210 FieldName211 ParamsDesc212 Visibility213 Expr214Field =215 FieldNormal216| FieldMethod217218FieldNameFixed =219 id:Name220| String221FieldNameDynamic =222 '['223 Expr224 ']'225FieldName =226 FieldNameFixed227| FieldNameDynamic228229Visibility =230 ':::'231| '::'232| ':'233234Literal =235 'null'236| 'true'237| 'false'238| 'self'239| '$'240| 'super'241242String =243 'LIT_STRING_DOUBLE!'244| 'LIT_STRING_SINGLE!'245| 'LIT_STRING_DOUBLE_VERBATIM!'246| 'LIT_STRING_SINGLE_VERBATIM!'247| 'LIT_STRING_BLOCK!'248249Number =250 'LIT_FLOAT!'251| 'META_FORCE_ENUM!'252253ForSpec =254 'for'255 bind:Name256 'in'257 Expr258IfSpec =259 'if'260 Expr261CompSpec =262 ForSpec263| IfSpec264265BindDestruct =266 into:Destruct267 '='268 value:Expr269BindFunction =270 name:Name271 params:ParamsDesc272 '='273 value:Expr274Bind =275 BindDestruct276| BindFunction277278ParamsDesc =279 '('280 (Param (',' Param)* ','?)?281 ')'282Param =283 Destruct284 (285 '='286 Expr287 )?288289Assertion =290 'assert'291 condition:LhsExpr292 (293 ':'294 message:Expr295 )?296297DestructFull =298 Name299DestructSkip =300 '?'301DestructArray =302 '['303 (304 DestructArrayPart305 (',' DestructArrayPart)*306 ','?307 )?308 ']'309DestructObject =310 '{'311 (312 DestructObjectField313 (',' DestructObjectField)*314 ','?315 )?316 DestructRest?317 ','?318 '}'319Destruct =320 DestructFull321| DestructSkip322| DestructArray323| DestructObject324325DestructArrayElement =326 Destruct327DestructArrayPart =328 DestructArrayElement329| DestructRest330331DestructRest =332 '...'333 into:Name?334335DestructObjectField =336 field:Name337 (338 ':'339 Destruct340 )?341 (342 '='343 Expr344 )?345346// Aliases used to resolve node type conflicts347TrueExpr=Expr348FalseExpr=Expr349LhsExpr=Expr