private void WriteLoadPrefix(MjoFlags flags, IColoredWriter writer) { WritePunctuation(flags.InvertMode() switch { MjoInvertMode.Numeric => "-", MjoInvertMode.Boolean => "!", MjoInvertMode.Bitwise => "~", _ => "" }, writer);
public Assignment(Expression value, uint hash, MjoFlags flags, MjoType type, BinaryOperation operation) { Value = value; Hash = hash; Flags = flags; Type = type; Operation = operation; }
private void WriteIdentifier(uint hash, MjoFlags flags, IColoredWriter writer) { writer.ForegroundColor = ConsoleColor.Red; char scope = flags.Scope() switch { MjoScope.Persistent => '#', MjoScope.SaveFile => '@', MjoScope.Thread => '%', MjoScope.Local => '_', _ => throw new ArgumentOutOfRangeException() }; string type = flags.Type() switch { MjoType.Int => "", MjoType.Float => "%", MjoType.String => "$", MjoType.IntArray => "#", MjoType.FloatArray => "%#", MjoType.StringArray => "$#", MjoType.Unknown => "?", _ => throw new ArgumentOutOfRangeException() }; writer.Write($"{scope}{{{hash:x8}}}{type}"); }
public static MjoModifier Modifier(this MjoFlags flags) => (MjoModifier)((ushort)flags & (ushort)MjoFlagMask.Modifier);
public static MjoInvertMode InvertMode(this MjoFlags flags) => (MjoInvertMode)(((ushort)flags & (ushort)MjoFlagMask.Invert) >> 3);
public static MjoScope Scope(this MjoFlags flags) => (MjoScope)(((ushort)flags & (ushort)MjoFlagMask.Scope) >> 5);
public static MjoType Type(this MjoFlags flags) => (MjoType)(((ushort)flags & (ushort)MjoFlagMask.Type) >> 8);
public static int Dimension(this MjoFlags flags) => ((ushort)flags & (ushort)MjoFlagMask.Dim) >> 11;
public Identifier(uint hash, MjoFlags flags) { Hash = hash; Flags = flags; }
public ArrayAssignment(Expression value, Expression[] indices, uint hash, MjoFlags flags, MjoType type, BinaryOperation operation) : base(value, hash, flags, type, operation) { Indices = indices; }
public ArrayAccess(uint hash, MjoFlags flags, Expression[] indices) { Hash = hash; Flags = flags; Indices = indices; }