internal Green(XmlNameSyntax.Green nameNode, SyntaxToken.Green equalsSyntax, XmlNodeSyntax.Green valueNode) : base(SyntaxKind.XmlAttribute) { this.SlotCount = 3; this.nameNode = nameNode; AdjustWidth(nameNode); this.equalsSyntax = equalsSyntax; AdjustWidth(equalsSyntax); this.valueNode = valueNode; AdjustWidth(valueNode); }
internal Green(XmlNameSyntax.Green nameNode, SyntaxToken.Green equalsSyntax, XmlNodeSyntax.Green valueNode, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations) : base(SyntaxKind.XmlAttribute, diagnostics, annotations) { this.SlotCount = 3; this.nameNode = nameNode; AdjustWidth(nameNode); this.equalsSyntax = equalsSyntax; AdjustWidth(equalsSyntax); this.valueNode = valueNode; AdjustWidth(valueNode); }
internal Green(SyntaxToken.Green lessThanToken, XmlNameSyntax.Green name, SyntaxToken.Green slashGreaterThanToken) : base(SyntaxKind.XmlElementEndTag) { this.SlotCount = 3; this.lessThanToken = lessThanToken; AdjustWidth(lessThanToken); this.name = name; AdjustWidth(name); this.slashGreaterThanToken = slashGreaterThanToken; AdjustWidth(slashGreaterThanToken); }
internal Green(SyntaxToken.Green lessThanToken, XmlNameSyntax.Green name, SyntaxToken.Green slashGreaterThanToken, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations) : base(SyntaxKind.XmlElementEndTag, diagnostics, annotations) { this.SlotCount = 3; this.lessThanToken = lessThanToken; AdjustWidth(lessThanToken); this.name = name; AdjustWidth(name); this.slashGreaterThanToken = slashGreaterThanToken; AdjustWidth(slashGreaterThanToken); }
internal Green(PunctuationSyntax.Green lessThanToken, XmlNameSyntax.Green name, GreenNode attributes, PunctuationSyntax.Green slashGreaterThanToken) : base(SyntaxKind.XmlEmptyElement) { this.SlotCount = 4; this.lessThanToken = lessThanToken; AdjustWidth(lessThanToken); this.name = name; AdjustWidth(name); this.attributes = attributes; AdjustWidth(attributes); this.slashGreaterThanToken = slashGreaterThanToken; AdjustWidth(slashGreaterThanToken); }
internal Green(PunctuationSyntax.Green lessThanToken, XmlNameSyntax.Green name, GreenNode attributes, PunctuationSyntax.Green slashGreaterThanToken, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations) : base(SyntaxKind.XmlEmptyElement, diagnostics, annotations) { this.SlotCount = 4; this.lessThanToken = lessThanToken; AdjustWidth(lessThanToken); this.name = name; AdjustWidth(name); this.attributes = attributes; AdjustWidth(attributes); this.slashGreaterThanToken = slashGreaterThanToken; AdjustWidth(slashGreaterThanToken); }
internal static int MatchEndElement(this List <XmlContext> @this, XmlNameSyntax.Green name) { Debug.Assert(name == null || name.Kind == SyntaxKind.XmlName); var last = @this.Count - 1; if (name == null) { return(last); } var i = last; while (i >= 0) { var context = @this[i]; var nameExpr = context.StartElement.NameNode; if (nameExpr.Kind == SyntaxKind.XmlName) { var startName = ((XmlNameSyntax.Green)nameExpr); if (startName.LocalName.Text == name.LocalName.Text) { var startPrefix = startName.Prefix; var endPrefix = name.Prefix; if (startPrefix == endPrefix) { break; } if (startPrefix != null && endPrefix != null) { if (startPrefix.Name.Text == endPrefix.Name.Text) { break; } } } } i -= 1; } return(i); }