protected override bool Visit(ASTNotEqual node) { if (!Visit(node.Left, node.Right)) { return(false); } var left = node.Left.TypeInfo; var right = node.Right.TypeInfo; if (!left.Equals(right)) { Error(node.Position, $"Cannot compare {left} and {right}"); return(false); } node.TypeInfo = Cache.GetBoolean(); return(true); }
public override void VisitNotEqual(ASTNotEqual n) { SetupOperands(n); //string equality, good times if (_lastWalkedType == typeof(String)) { _gen.Emit(OpCodes.Call, typeof(String).GetMethod("Equals", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(string), typeof(string) }, null)); } else { _gen.Emit(OpCodes.Ceq); } //compare it with 0 to negate _gen.Emit(OpCodes.Ldc_I4_0); _gen.Emit(OpCodes.Ceq); _lastWalkedType = typeof(bool); }
protected override bool Visit(ASTNotEqual node) => EmitBinary <CNotEqual>(node);
public override void VisitNotEqual(ASTNotEqual n) { TypeCheckEquality(n); }
public bool Visit(ASTNotEqual node) { throw new NotImplementedException(); }
protected abstract bool Visit(ASTNotEqual node);