DefinitionTree { definitions: [ TypeAlias( TypeAliasDefinition { type: Keyword { value: "type", position: 1, }, name: TemplatedIdentifier { name: Identifier { position: 6, value: "scalar", }, templates: None, }, equals: 13, type_definition: Union( [ String( Keyword { value: "string", position: 15, }, ), SignedInteger( Default( Keyword { value: "int", position: 24, }, ), ), FloatingPoint( Default( Keyword { value: "float", position: 30, }, ), ), Boolean( Keyword { value: "bool", position: 38, }, ), ], ), semicolon: 42, }, ), Function( FunctionDefinition { comments: CommentGroup { comments: [], }, attributes: [], function: Keyword { value: "function", position: 45, }, name: Identifier { position: 54, value: "scalar_to_string", }, templates: None, parameters: FunctionLikeParameterListDefinition { comments: CommentGroup { comments: [], }, left_parenthesis: 70, parameters: CommaSeparated { inner: [ FunctionLikeParameterDefinition { comments: CommentGroup { comments: [], }, attributes: [], type_definition: Identifier( TemplatedIdentifier { name: Identifier { position: 71, value: "scalar", }, templates: None, }, ), ellipsis: None, variable: Variable { position: 78, name: "$value", }, default: None, }, ], commas: [], }, right_parenthesis: 84, }, return_type: FunctionLikeReturnTypeDefinition { colon: 85, type_definition: String( Keyword { value: "string", position: 87, }, ), }, body: BlockStatement { comments: CommentGroup { comments: [], }, left_brace: 94, statements: [ If( IfStatement { comments: CommentGroup { comments: [], }, if: Keyword { value: "if", position: 100, }, conditions: CommaSeparated { inner: [ TypeOperation( Is { comments: CommentGroup { comments: [], }, left: Variable( Variable { position: 103, name: "$value", }, ), is: Keyword { value: "is", position: 110, }, right: String( Keyword { value: "string", position: 113, }, ), }, ), ], commas: [], }, block: BlockStatement { comments: CommentGroup { comments: [], }, left_brace: 120, statements: [ Return( Implicit { comments: CommentGroup { comments: [], }, expression: Variable( Variable { position: 130, name: "$value", }, ), }, ), ], right_brace: 141, }, elseifs: [], else: Some( IfElseStatement { comments: CommentGroup { comments: [], }, else: Keyword { value: "else", position: 143, }, block: If( IfStatement { comments: CommentGroup { comments: [], }, if: Keyword { value: "if", position: 148, }, conditions: CommaSeparated { inner: [ LogicalOperation( Or { comments: CommentGroup { comments: [], }, left: TypeOperation( Is { comments: CommentGroup { comments: [], }, left: Variable( Variable { position: 151, name: "$value", }, ), is: Keyword { value: "is", position: 158, }, right: SignedInteger( Default( Keyword { value: "int", position: 161, }, ), ), }, ), double_pipe: 165, right: TypeOperation( Is { comments: CommentGroup { comments: [], }, left: Variable( Variable { position: 168, name: "$value", }, ), is: Keyword { value: "is", position: 175, }, right: FloatingPoint( Default( Keyword { value: "float", position: 178, }, ), ), }, ), }, ), ], commas: [], }, block: BlockStatement { comments: CommentGroup { comments: [], }, left_brace: 184, statements: [ If( IfStatement { comments: CommentGroup { comments: [], }, if: Keyword { value: "if", position: 194, }, conditions: CommaSeparated { inner: [ TypeOperation( Is { comments: CommentGroup { comments: [], }, left: Variable( Variable { position: 197, name: "$value", }, ), is: Keyword { value: "is", position: 204, }, right: SignedInteger( Default( Keyword { value: "int", position: 207, }, ), ), }, ), ], commas: [], }, block: BlockStatement { comments: CommentGroup { comments: [], }, left_brace: 211, statements: [ Return( Implicit { comments: CommentGroup { comments: [], }, expression: FunctionOperation( Call { comments: CommentGroup { comments: [], }, function: Identifier( Identifier { position: 225, value: "Str\format", }, ), generics: None, arguments: ArgumentListExpression { comments: CommentGroup { comments: [], }, left_parenthesis: 235, arguments: CommaSeparated { inner: [ Value { comments: CommentGroup { comments: [], }, value: Literal( String( LiteralString { comments: CommentGroup { comments: [], }, value: ""%d"", position: 236, }, ), ), }, Value { comments: CommentGroup { comments: [], }, value: Variable( Variable { position: 242, name: "$value", }, ), }, ], commas: [ 240, ], }, right_parenthesis: 248, }, }, ), }, ), ], right_brace: 258, }, elseifs: [], else: Some( IfElseStatement { comments: CommentGroup { comments: [], }, else: Keyword { value: "else", position: 260, }, block: Block( BlockStatement { comments: CommentGroup { comments: [], }, left_brace: 265, statements: [ Return( Implicit { comments: CommentGroup { comments: [], }, expression: FunctionOperation( Call { comments: CommentGroup { comments: [], }, function: Identifier( Identifier { position: 279, value: "Str\format", }, ), generics: None, arguments: ArgumentListExpression { comments: CommentGroup { comments: [], }, left_parenthesis: 289, arguments: CommaSeparated { inner: [ Value { comments: CommentGroup { comments: [], }, value: Literal( String( LiteralString { comments: CommentGroup { comments: [], }, value: ""%.2f"", position: 290, }, ), ), }, Value { comments: CommentGroup { comments: [], }, value: Variable( Variable { position: 298, name: "$value", }, ), }, ], commas: [ 296, ], }, right_parenthesis: 304, }, }, ), }, ), ], right_brace: 314, }, ), }, ), }, ), ], right_brace: 320, }, elseifs: [], else: None, }, ), }, ), }, ), Return( Implicit { comments: CommentGroup { comments: [], }, expression: TernaryOperation( Ternary { comments: CommentGroup { comments: [], }, condition: Variable( Variable { position: 327, name: "$value", }, ), question: 334, if_true: Literal( String( LiteralString { comments: CommentGroup { comments: [], }, value: ""true"", position: 336, }, ), ), colon: 343, if_false: Literal( String( LiteralString { comments: CommentGroup { comments: [], }, value: ""false"", position: 345, }, ), ), }, ), }, ), ], right_brace: 353, }, }, ), Function( FunctionDefinition { comments: CommentGroup { comments: [], }, attributes: [], function: Keyword { value: "function", position: 356, }, name: Identifier { position: 365, value: "is_scalar", }, templates: None, parameters: FunctionLikeParameterListDefinition { comments: CommentGroup { comments: [], }, left_parenthesis: 374, parameters: CommaSeparated { inner: [ FunctionLikeParameterDefinition { comments: CommentGroup { comments: [], }, attributes: [], type_definition: Mixed( Keyword { value: "mixed", position: 375, }, ), ellipsis: None, variable: Variable { position: 381, name: "$value", }, default: None, }, ], commas: [], }, right_parenthesis: 387, }, return_type: FunctionLikeReturnTypeDefinition { colon: 388, type_definition: Boolean( Keyword { value: "bool", position: 390, }, ), }, body: BlockStatement { comments: CommentGroup { comments: [], }, left_brace: 395, statements: [ Return( Implicit { comments: CommentGroup { comments: [], }, expression: TypeOperation( Is { comments: CommentGroup { comments: [], }, left: Variable( Variable { position: 401, name: "$value", }, ), is: Keyword { value: "is", position: 408, }, right: Identifier( TemplatedIdentifier { name: Identifier { position: 411, value: "scalar", }, templates: None, }, ), }, ), }, ), ], right_brace: 418, }, }, ), Function( FunctionDefinition { comments: CommentGroup { comments: [], }, attributes: [], function: Keyword { value: "function", position: 421, }, name: Identifier { position: 430, value: "as_scalar", }, templates: None, parameters: FunctionLikeParameterListDefinition { comments: CommentGroup { comments: [], }, left_parenthesis: 439, parameters: CommaSeparated { inner: [ FunctionLikeParameterDefinition { comments: CommentGroup { comments: [], }, attributes: [], type_definition: Mixed( Keyword { value: "mixed", position: 440, }, ), ellipsis: None, variable: Variable { position: 446, name: "$value", }, default: None, }, ], commas: [], }, right_parenthesis: 452, }, return_type: FunctionLikeReturnTypeDefinition { colon: 453, type_definition: Identifier( TemplatedIdentifier { name: Identifier { position: 455, value: "scalar", }, templates: None, }, ), }, body: BlockStatement { comments: CommentGroup { comments: [], }, left_brace: 462, statements: [ Return( Implicit { comments: CommentGroup { comments: [], }, expression: TypeOperation( As { comments: CommentGroup { comments: [], }, left: Variable( Variable { position: 468, name: "$value", }, ), as: Keyword { value: "as", position: 475, }, right: Identifier( TemplatedIdentifier { name: Identifier { position: 478, value: "scalar", }, templates: None, }, ), }, ), }, ), ], right_brace: 485, }, }, ), ], eof: 488, }