Class BoxStructLiteral

All Implemented Interfaces:
IBoxLiteral, BoxVisitable

public class BoxStructLiteral extends BoxExpression implements IBoxLiteral
A struct literal comes in two forms, ordered and unordered (default). The unordered struct uses curly braces `{}` like a JSON object. The ordered struct, uses square brackets `[]` like an array literal. The difference is structs use a comma-delimited list of key/value pairs. Note, key/value pairs ANYWHERE in Boxlang can either be specified as ` foo=bar` OR `foo : bar`. This goes for strut literals, function parameters, or class/UDF metadata.
  • Constructor Details

    • BoxStructLiteral

      public BoxStructLiteral(BoxStructType type, List<BoxExpression> values, Position position, String sourceText)
      Creates the AST node for Struct Literals
      Parameters:
      values - initialization values
      position - position of the statement in the source code
      sourceText - source code that originated the Node
  • Method Details