Example #1
0
        /// <inheritdoc/>
        public override SyntaxNode VisitTransition(UvssTransitionSyntax node)
        {
            var unchanged = true;

            var newTransitionKeyword = (SyntaxToken)Visit(node.TransitionKeyword);

            if (newTransitionKeyword != node.TransitionKeyword)
            {
                unchanged = false;
            }

            var newArgumentList = (UvssTransitionArgumentListSyntax)Visit(node.ArgumentList);

            if (newArgumentList != node.ArgumentList)
            {
                unchanged = false;
            }

            var newColonToken = (SyntaxToken)Visit(node.ColonToken);

            if (newColonToken != node.ColonToken)
            {
                unchanged = false;
            }

            var value = (UvssPropertyValueSyntax)Visit(node.Value);

            if (value != node.Value)
            {
                unchanged = false;
            }

            var newQualifierToken = (SyntaxToken)Visit(node.QualifierToken);

            if (newQualifierToken != node.QualifierToken)
            {
                unchanged = false;
            }

            var newSemiColonToken = (SyntaxToken)Visit(node.SemiColonToken);

            if (newSemiColonToken != node.SemiColonToken)
            {
                unchanged = false;
            }

            return(unchanged ? node : new UvssTransitionSyntax(
                       newTransitionKeyword,
                       newArgumentList,
                       newColonToken,
                       value,
                       newQualifierToken,
                       newSemiColonToken));
        }
        /// <summary>
        /// Compiles a <see cref="UvssRule"/> from the specified syntax node.
        /// </summary>
        private static UvssRule CompileTransition(UvssTransitionSyntax node, CultureInfo culture)
        {
            var arguments   = new List <String>(node.ArgumentList.ArgumentIdentifiers.Select(x => x.Text));
            var name        = "transition";
            var value       = node.Value.Value;
            var isImportant = node.QualifierToken?.Kind == SyntaxKind.ImportantKeyword;

            return(new UvssRule(
                       new UvssRuleArgumentsCollection(arguments),
                       null,
                       name,
                       value,
                       isImportant));
        }
 /// <summary>
 /// Visits the specified transition node.
 /// </summary>
 /// <param name="node">The node to visit.</param>
 /// <returns>A node which should replace the visited node, or a reference to the visited node
 /// itself if no changes were made.</returns>
 public virtual SyntaxNode VisitTransition(UvssTransitionSyntax node)
 {
     return(VisitSyntaxNode(node));
 }