public SwitchOperation(CompiledMethod method,BracketFragment switching,BracketFragment body):base(method){ Body=body; if(switching.ChildCount()!=1){ switching.Error("Too many entries inside this switches brackets. Should be e.g. switch(name){ .. }"); } // Compile the switching frag: CompiledFragment variableFrag=switching.FirstChild.Compile(method); // Get the active value - this should be a variable object: object activeValue=variableFrag.ActiveValue(); // Try and apply it: Switching=activeValue as Variable; if(Switching==null){ switching.Error("Can only switch variables."); } }
public SwitchOperation(CompiledMethod method, BracketFragment switching, BracketFragment body) : base(method) { Body = body; if (switching.ChildCount() != 1) { switching.Error("Too many entries inside this switches brackets. Should be e.g. switch(name){ .. }"); } // Compile the switching frag: CompiledFragment variableFrag = switching.FirstChild.Compile(method); // Get the active value - this should be a variable object: object activeValue = variableFrag.ActiveValue(); // Try and apply it: Switching = activeValue as Variable; if (Switching == null) { switching.Error("Can only switch variables."); } }