public override void VisitEqual(ASTEqual 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); } _lastWalkedType = typeof(bool); }
protected override bool Visit(ASTEqual 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); }
protected override bool Visit(ASTDot node) => EmitBinary <CDot>(node); // TODO, different for pointers protected override bool Visit(ASTEqual node) => EmitBinary <CEqualEqual>(node);
public override void VisitEqual(ASTEqual n) { TypeCheckEquality(n); }
public bool Visit(ASTEqual node) { throw new NotImplementedException(); }
protected abstract bool Visit(ASTEqual node);