public bool Equals(TypeDeclarationIdentity other)
            {
                var thisDecl  = _decl;
                var otherDecl = other._decl;

                // same as itself
                if ((object)thisDecl == otherDecl)
                {
                    return(true);
                }

                // arity, kind, name must match
                if ((thisDecl._arity != otherDecl._arity) ||
                    (thisDecl._kind != otherDecl._kind) ||
#if XSHARP
                    (XSharpString.Compare(thisDecl.name, otherDecl.name) != 0))
#else
                    (thisDecl.name != otherDecl.name))
#endif
                {
                    return(false);
                }

                if (thisDecl._kind == DeclarationKind.Enum || thisDecl._kind == DeclarationKind.Delegate)
                {
                    // oh, so close, but enums and delegates cannot be partial
                    return(false);
                }

                return(true);
            }
 private XppClassInfo FindClassInfo(string name)
 {
     foreach (var info in _classes)
     {
         if (XSharpString.Compare(info.Name, name) == 0)
         {
             return(info);
         }
     }
     return(null);
 }
        private void implementConstructor([NotNull] XP.IXPPEntityContext context)
        {
            var idName    = context.ShortName;
            var classCtor = XSharpString.Compare(idName, XSharpIntrinsicNames.InitClassMethod) == 0;
            // find method in the declarations and find the visibility
            var mods = decodeXppMemberModifiers(context.Info.Visibility, classCtor, classCtor ? null : context.Mods?._Tokens);

            if (mods.Any((int)SyntaxKind.StaticKeyword))
            {
                context.Data.HasClipperCallingConvention = false;
            }
            var ctor = createConstructor(context, mods, context.Atts, context.Parameters, context.Statements, (XSharpParserRuleContext)context);

            if (ctor != null)
            {
                context.Put(ctor);
            }
            else
            {
                context.Statements = null;
            }
        }
Example #4
0
 public bool Equals(String x, String y)
 {
     return(XSharpString.Compare(x, y) == 0);
 }