Example #1
0
 private void DeclareConstant(Type constType, string name, Expression value)
 {
     Ast.Constant con;
     if (constType.IsArray)
     {
         var nai = value.Expect <NewArrayExpression> (ExpressionType.NewArrayInit);
         con = Ast.Const(constType.GetElementType(), name, nai.Expressions.Count, Expr(value));
     }
     else
     {
         con = Ast.Const(constType, name, Expr(value));
     }
     _currentScope.CodeOut(GlslAst.DeclConst(con));
     _constants.Add(name, con);
 }