aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CommentLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/CommentLexer.cpp')
-rw-r--r--lib/AST/CommentLexer.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/AST/CommentLexer.cpp b/lib/AST/CommentLexer.cpp
index 55cd409a9c..1f4955d1cf 100644
--- a/lib/AST/CommentLexer.cpp
+++ b/lib/AST/CommentLexer.cpp
@@ -509,7 +509,7 @@ void Lexer::setupAndLexHTMLOpenTag(Token &T) {
const char C = *BufferPtr;
if (BufferPtr != CommentEnd &&
- (C == '>' || isHTMLIdentifierStartingCharacter(C)))
+ (C == '>' || C == '/' || isHTMLIdentifierStartingCharacter(C)))
State = LS_HTMLOpenTag;
}
@@ -546,6 +546,18 @@ void Lexer::lexHTMLOpenTag(Token &T) {
formTokenWithChars(T, TokenPtr, tok::html_greater);
State = LS_Normal;
return;
+ case '/':
+ TokenPtr++;
+ if (TokenPtr != CommentEnd && *TokenPtr == '>') {
+ TokenPtr++;
+ formTokenWithChars(T, TokenPtr, tok::html_slash_greater);
+ } else {
+ StringRef Text(BufferPtr, TokenPtr - BufferPtr);
+ formTokenWithChars(T, TokenPtr, tok::text);
+ T.setText(Text);
+ }
+ State = LS_Normal;
+ return;
}
}