public static void GenerateCode(LiteralArrayGet literal, GeneratorContext builder) { foreach (Expression element in literal.Elements) { builder.AddCode(element); } builder.AddOp(new ArrayValue(literal.Elements.Count), literal.StartToken); }
private Color GetColor(SprakExpression item) { return(item switch { Block block => GetColor(block.Header), Command _ => Colors.Blue, FunctionCall _ => Colors.Orange, FunctionHeader _ => Colors.Blue, IfHeader _ => Colors.DarkRed, LiteralArrayGet _ => Colors.Yellow, LiteralGet _ => Colors.Yellow, LoopHeader _ => Colors.Red, MainHeader _ => Colors.Orange, OperatorCall _ => Colors.Green, Return _ => Colors.Blue, VariableAssignment _ => Colors.Orange, VariableReference _ => Colors.Yellow, _ => Colors.Black });