示例#1
0
 public override void VisitAssignedExpression(ExpressionSyntax expression)
 {
     if (expression is IdentifierNameSyntax identifierName &&
         Identifiers.Contains(identifierName.Identifier.ValueText))
     {
         IsMatch = true;
     }
 }
示例#2
0
        /// <summary>
        /// Compare definitions stored in SsaState with actual ones
        /// </summary>
        public void ValidateDefinitions(Action <string> error)
        {
            var dc         = new SsaDefinitionsCollector();
            var actualDefs = new Dictionary <Identifier, Statement>();

            foreach (var stm in Procedure.Statements)
            {
                var definitions = dc.CollectDefinitions(stm);
                foreach (var defId in definitions)
                {
                    if (actualDefs.TryGetValue(defId, out var def))
                    {
                        error(string.Format(
                                  "{0}: multiple definitions for {1} ({2} and {3})",
                                  Procedure.Name,
                                  defId,
                                  stm,
                                  def));
                    }
                    else
                    {
                        actualDefs.Add(defId, stm);
                    }
                }
            }
            foreach (var sid in Identifiers)
            {
                if (!actualDefs.TryGetValue(sid.Identifier, out var actualDef))
                {
                    actualDef = null;
                }
                if (sid.DefStatement != actualDef)
                {
                    error(string.Format(
                              "{0}: incorrect definition for {1}({2}). Should be {3}",
                              Procedure.Name,
                              sid.Identifier,
                              sid.DefStatement?.ToString() ?? "<null>",
                              actualDef?.ToString() ?? "<null>"));
                }
            }
            foreach (var defId in actualDefs.Keys)
            {
                if (!Identifiers.Contains(defId) &&
                    actualDefs.ContainsKey(defId))
                {
                    error(string.Format(
                              "{0}: there is no {1}({2}) in the ssa identifiers",
                              Procedure.Name,
                              defId,
                              actualDefs[defId]?.ToString() ?? "<null>"));
                }
            }
        }
示例#3
0
        /// <summary>
        /// 获取多个用户的信息
        /// </summary>
        /// <param name="Identifiers"></param>
        /// <returns></returns>
        public List <ResponseConversationRoomMemberDTO> GetChannelUsersInfo(string ChannelID, params int[] Identifiers)
        {
            var result = conversationRoomRepository.GetChannelUsersInfo(ChannelID);

            if (Identifiers.Length > 0)
            {
                return(result.Where(a => Identifiers.Contains(a.identifier)).ToList());
            }
            else
            {
                return(result);
            }
        }
示例#4
0
 public override void VisitPrefixUnaryExpression(PrefixUnaryExpressionSyntax node)
 {
     if (node.Kind() == SyntaxKind.AddressOfExpression &&
         node.Operand is IdentifierNameSyntax identifierName)
     {
         if (Identifiers.Contains(identifierName.Identifier.ValueText))
         {
             IsMatch = true;
         }
     }
     else
     {
         base.VisitPrefixUnaryExpression(node);
     }
 }