KDoc link parsing rewrite.

Support qualified names immediately after tag (@see or @param). Detect whether a tag is followed by a reference immediately while lexing, remove TEXT_OR_LINK token type. Remove duplicate nested KDocLink nodes from the PSI structure.
This commit is contained in:
Dmitry Jemerov
2015-02-06 12:48:20 +01:00
parent cc5edc332d
commit 70cf3e9c60
21 changed files with 250 additions and 205 deletions
@@ -7,51 +7,48 @@ JetFile: MarkdownLinkWithError.kt
KDOC_SECTION
PsiElement(KDOC_LEADING_ASTERISK)('*')
PsiElement(KDOC_TEXT)(' ')
KDOC_LINK
KDOC_MARKDOWN_LINK
PsiElement(LBRACKET)('[')
KDOC_MARKDOWN_LINK
PsiElement(LBRACKET)('[')
KDOC_NAME
KDOC_NAME
KDOC_NAME
KDOC_NAME
PsiElement(IDENTIFIER)('A')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('B')
PsiElement(IDENTIFIER)('A')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('C')
PsiErrorElement:Closing bracket expected
<empty list>
PsiElement(RANGE)('..')
PsiElement(IDENTIFIER)('B')
PsiElement(DOT)('.')
PsiElement(RBRACKET)(']')
PsiElement(IDENTIFIER)('C')
PsiErrorElement:Closing bracket expected
<empty list>
PsiElement(RANGE)('..')
PsiElement(DOT)('.')
PsiElement(RBRACKET)(']')
PsiWhiteSpace('\n ')
PsiElement(KDOC_LEADING_ASTERISK)('*')
PsiElement(KDOC_TEXT)(' [....]')
PsiWhiteSpace('\n ')
PsiElement(KDOC_LEADING_ASTERISK)('*')
PsiElement(KDOC_TEXT)(' ')
KDOC_LINK
KDOC_MARKDOWN_LINK
PsiElement(LBRACKET)('[')
KDOC_NAME
PsiElement(IDENTIFIER)('A')
PsiErrorElement:Closing bracket expected
<empty list>
PsiElement(RANGE)('..')
PsiElement(IDENTIFIER)('B')
PsiElement(RANGE)('..')
PsiElement(IDENTIFIER)('C')
PsiElement(RBRACKET)(']')
KDOC_MARKDOWN_LINK
PsiElement(LBRACKET)('[')
KDOC_NAME
PsiElement(IDENTIFIER)('A')
PsiErrorElement:Closing bracket expected
<empty list>
PsiElement(RANGE)('..')
PsiElement(IDENTIFIER)('B')
PsiElement(RANGE)('..')
PsiElement(IDENTIFIER)('C')
PsiElement(RBRACKET)(']')
PsiWhiteSpace('\n ')
PsiElement(KDOC_LEADING_ASTERISK)('*')
PsiElement(KDOC_TEXT)(' ')
KDOC_LINK
KDOC_MARKDOWN_LINK
PsiElement(LBRACKET)('[')
KDOC_NAME
PsiElement(IDENTIFIER)('A')
PsiElement(DOT)('.')
PsiErrorElement:Identifier expected
<empty list>
PsiElement(RBRACKET)(']')
KDOC_MARKDOWN_LINK
PsiElement(LBRACKET)('[')
KDOC_NAME
PsiElement(IDENTIFIER)('A')
PsiElement(DOT)('.')
PsiErrorElement:Identifier expected
<empty list>
PsiElement(RBRACKET)(']')
PsiWhiteSpace('\n ')
PsiElement(KDOC_END)('*/')