Esempio n. 1
0
 public override void OnBinaryExpression(BinaryExpression node)
 {
     base.OnBinaryExpression(node);
     BinaryOperatorType type = node.get_Operator();
     if (((type == 0x1f) || (type == 30)) && (this.IsBoolean(node.get_Left()) && this.IsBoolean(node.get_Right())))
     {
         string[] strArray = (node.get_Operator() != 0x1f) ? new string[] { "||", "|" } : new string[] { "&&", "&" };
         string expectedOperator = strArray[0];
         string actualOperator = strArray[1];
         this.get_Warnings().Add(UnityScriptWarnings.BitwiseOperatorWithBooleanOperands(node.get_LexicalInfo(), expectedOperator, actualOperator));
     }
 }
 public void ApplyImplicitArrayConversion(BinaryExpression node)
 {
     IType expressionType = this.GetExpressionType(node.get_Left());
     if (expressionType.get_IsArray())
     {
         IType type2 = this.GetExpressionType(node.get_Right());
         if (type2 == this.UnityScriptLangArray())
         {
             node.set_Right(this.get_CodeBuilder().CreateCast(expressionType, this.get_CodeBuilder().CreateMethodInvocation(node.get_Right(), this.ResolveMethod(type2, "ToBuiltin"), this.get_CodeBuilder().CreateTypeofExpression(expressionType.get_ElementType()))));
         }
     }
 }