Esempio n. 1
0
        public override ElementSyntaxBase With(
            NameToken name = null,
            IImmutableList <AttributeSyntaxBase> attributes = null,
            IImmutableList <NodeSyntax> nodes = null,
            bool?isEmpty = null)
        {
            name       = name ?? Name;
            nodes      = nodes ?? Nodes;
            attributes = attributes ?? Attributes;

            if ((isEmpty ?? false) && nodes.Count == 0)
            {
                return(EmptyElementSyntax.Create(
                           StartTag.LessThan,
                           Name,
                           attributes,
                           SlashToken.Default,
                           EndTag.GreaterThan));
            }

            if (name.Equals(Name) &&
                (attributes.Equals(Attributes) || attributes.SequenceEqual(Attributes)) &&
                (nodes.Equals(Nodes) || nodes.SequenceEqual(Nodes)))
            {
                return(this);
            }

            return(Create(
                       StartTag.With(name, attributes),
                       nodes,
                       EndTag.With(EndTag.Name.With(name.Text))));
        }
Esempio n. 2
0
 public static ElementStartTagSyntax Create(
     LessThanToken lessThan,
     NameToken name,
     IImmutableList <AttributeSyntaxBase> attributes,
     GreaterThanToken greaterThan)
 {
     return(new ElementStartTagSyntax(lessThan, name, attributes, greaterThan));
 }
 public override ElementSyntaxBase With(
     NameToken name = null,
     IImmutableList <AttributeSyntaxBase> attributes = null,
     IImmutableList <NodeSyntax> nodes = null,
     bool?isEmpty = null)
 {
     throw new NotImplementedException("Can't turn JavaScript tag into anything else");
 }
Esempio n. 4
0
 public static ElementEndTagSyntax Create(
     LessThanToken lessThan,
     SlashToken slash,
     NameToken name,
     GreaterThanToken greaterThan)
 {
     return(new ElementEndTagSyntax(lessThan, slash, name, greaterThan));
 }
Esempio n. 5
0
 public static AttributeSyntax Create(NameToken name, EqualsToken eq, AttributeLiteralToken literal)
 {
     if (eq.Equals(EqualsToken.Default))
     {
         return(new AttributeSyntaxWithDefaultEqToken(name, literal));
     }
     return(new AttributeSyntaxWithCustomEqToken(name, eq, literal));
 }
Esempio n. 6
0
        public ElementEndTagSyntax With(NameToken name)
        {
            if (name == null || name.Equals(Name))
            {
                return(this);
            }

            return(new ElementEndTagSyntax(LessThan, Slash, name, GreaterThan));
        }
Esempio n. 7
0
 public static EmptyElementSyntax Create(
     LessThanToken lessThan,
     NameToken name,
     IImmutableList <AttributeSyntaxBase> attributes,
     SlashToken slash,
     GreaterThanToken greaterThan)
 {
     return(new EmptyElementSyntax(lessThan, name, attributes, slash, greaterThan));
 }
Esempio n. 8
0
 public ElementStartTagSyntax With(NameToken name = null, IImmutableList <AttributeSyntaxBase> attributes = null)
 {
     name       = name ?? Name;
     attributes = attributes ?? Attributes;
     if (attributes.Equals(Attributes) && name.Equals(Name))
     {
         return(this);
     }
     return(Create(LessThan, name, attributes, GreaterThan));
 }
Esempio n. 9
0
 ElementStartTagSyntax(
     LessThanToken lessThan,
     NameToken name,
     IImmutableList <AttributeSyntaxBase> attributes,
     GreaterThanToken greaterThan)
 {
     LessThan    = lessThan;
     Name        = name;
     Attributes  = attributes;
     GreaterThan = greaterThan;
 }
Esempio n. 10
0
 EmptyElementSyntax(
     LessThanToken lessThan,
     NameToken name,
     IImmutableList <AttributeSyntaxBase> attributes,
     SlashToken slash,
     GreaterThanToken greaterThan)
 {
     LessThan    = lessThan ?? throw new ArgumentNullException(nameof(lessThan));
     Name        = name ?? throw new ArgumentNullException(nameof(name));
     Attributes  = attributes ?? throw new ArgumentNullException(nameof(attributes));
     Slash       = slash ?? throw new ArgumentNullException(nameof(slash));
     GreaterThan = greaterThan ?? throw new ArgumentNullException(nameof(greaterThan));
 }
Esempio n. 11
0
 ImplicitAttributeSyntax(NameToken name) : base(name)
 {
 }
Esempio n. 12
0
 public static ImplicitAttributeSyntax Create(NameToken name)
 {
     return(new ImplicitAttributeSyntax(name));
 }
Esempio n. 13
0
 protected AttributeSyntaxBase(NameToken name)
 {
     Name = name ?? throw new ArgumentNullException(nameof(name));
 }
Esempio n. 14
0
 AttributeSyntax(NameToken name, AttributeLiteralToken literal) : base(name)
 {
     Literal = literal;
 }
Esempio n. 15
0
 public AttributeSyntaxWithCustomEqToken(NameToken name, EqualsToken eq, AttributeLiteralToken literal) : base(
         name,
         literal)
 {
     Eq = eq;
 }
Esempio n. 16
0
 public AttributeSyntaxWithDefaultEqToken(NameToken name, AttributeLiteralToken literal) : base(name, literal)
 {
 }
Esempio n. 17
0
 protected virtual SyntaxToken VisitName(NameToken token)
 {
     return(token);
 }
Esempio n. 18
0
 public abstract ElementSyntaxBase With(
     NameToken name = null,
     IImmutableList <AttributeSyntaxBase> attributes = null,
     IImmutableList <NodeSyntax> nodes = null,
     bool?isEmpty = null);