public Type( Type BaseClass, CodeBlock Code ) : this(BaseClass, Code.Value) { }
public Type( CodeBlock Code ) : base(Code.Value) { Identifiers = new Scope(); Type = CodeBlockType.Type; }
public Loop(CodeBlock Condition, CodeBlock Block) : base(Block.Value) { condition = Condition; Type = CodeBlockType.Loop; }
public override Value Operate( Value First, Value Second ) { if ( First is Reference ) First = ( First as Reference ).ReferencingValue; if ( Second is Reference ) Second = ( Second as Reference ).ReferencingValue; if ( First is Boolean ) First = new CodeBlock( new[] { First as Token }.ToList() ); if ( First is Expression ) First = new CodeBlock( First as Expression ); if ( First is CodeBlock && Second is CodeBlock ) { return new Loop( First as CodeBlock, Second as CodeBlock ); } throw new Exception( "Operands must be code blocks" ); }
public Value CompileTimeOperate( Value First, Value Second ) { if ( First is Expression ) First = new CodeBlock( First as Expression ); if ( First is CodeBlock && Second is CodeBlock ) { return new Loop( First as CodeBlock, Second as CodeBlock ); } return NoValue.Value; }
public Function(List Arguments, CodeBlock Code, Scope Scope) : this(Arguments.GetValues().ConvertAll(X => X as String), Code.Value, Scope) { }