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)))); }
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"); }
public static ElementEndTagSyntax Create( LessThanToken lessThan, SlashToken slash, NameToken name, GreaterThanToken greaterThan) { return(new ElementEndTagSyntax(lessThan, slash, name, greaterThan)); }
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)); }
public ElementEndTagSyntax With(NameToken name) { if (name == null || name.Equals(Name)) { return(this); } return(new ElementEndTagSyntax(LessThan, Slash, name, GreaterThan)); }
public static EmptyElementSyntax Create( LessThanToken lessThan, NameToken name, IImmutableList <AttributeSyntaxBase> attributes, SlashToken slash, GreaterThanToken greaterThan) { return(new EmptyElementSyntax(lessThan, name, attributes, slash, greaterThan)); }
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)); }
ElementStartTagSyntax( LessThanToken lessThan, NameToken name, IImmutableList <AttributeSyntaxBase> attributes, GreaterThanToken greaterThan) { LessThan = lessThan; Name = name; Attributes = attributes; GreaterThan = greaterThan; }
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)); }
ImplicitAttributeSyntax(NameToken name) : base(name) { }
public static ImplicitAttributeSyntax Create(NameToken name) { return(new ImplicitAttributeSyntax(name)); }
protected AttributeSyntaxBase(NameToken name) { Name = name ?? throw new ArgumentNullException(nameof(name)); }
AttributeSyntax(NameToken name, AttributeLiteralToken literal) : base(name) { Literal = literal; }
public AttributeSyntaxWithCustomEqToken(NameToken name, EqualsToken eq, AttributeLiteralToken literal) : base( name, literal) { Eq = eq; }
public AttributeSyntaxWithDefaultEqToken(NameToken name, AttributeLiteralToken literal) : base(name, literal) { }
protected virtual SyntaxToken VisitName(NameToken token) { return(token); }
public abstract ElementSyntaxBase With( NameToken name = null, IImmutableList <AttributeSyntaxBase> attributes = null, IImmutableList <NodeSyntax> nodes = null, bool?isEmpty = null);