KT-482 Support nested comments: comments nest properly, but strings are not accounted for inside comments

#KT-482 In progress
This commit is contained in:
Andrey Breslav
2012-03-21 15:51:48 +01:00
parent 01679d315d
commit 3a73a96e06
21 changed files with 749 additions and 491 deletions
@@ -0,0 +1 @@
/*
@@ -0,0 +1,4 @@
JetFile: BlockCommentAtBeginningOfFile1.jet
PsiComment(BLOCK_COMMENT)('/*')
NAMESPACE_HEADER
<empty list>
@@ -0,0 +1,2 @@
/*
/*
@@ -0,0 +1,4 @@
JetFile: BlockCommentAtBeginningOfFile2.jet
PsiComment(BLOCK_COMMENT)('/*\n/*')
NAMESPACE_HEADER
<empty list>
@@ -0,0 +1,3 @@
/*
fooo
@@ -0,0 +1,4 @@
JetFile: BlockCommentAtBeginningOfFile3.jet
PsiComment(BLOCK_COMMENT)('/*\n\nfooo')
NAMESPACE_HEADER
<empty list>
@@ -0,0 +1,5 @@
/*
/*foo*/
asdfas
@@ -0,0 +1,4 @@
JetFile: BlockCommentAtBeginningOfFile4.jet
PsiComment(BLOCK_COMMENT)('/*\n\n/*foo*/\n\nasdfas')
NAMESPACE_HEADER
<empty list>
@@ -0,0 +1 @@
/**
@@ -0,0 +1,4 @@
JetFile: DocCommentAtBeginningOfFile1.jet
PsiComment(DOC_COMMENT)('/**')
NAMESPACE_HEADER
<empty list>
@@ -0,0 +1,2 @@
/**
/**
@@ -0,0 +1,4 @@
JetFile: DocCommentAtBeginningOfFile2.jet
PsiComment(DOC_COMMENT)('/**\n/**')
NAMESPACE_HEADER
<empty list>
@@ -0,0 +1,3 @@
/**
fooo
@@ -0,0 +1,4 @@
JetFile: DocCommentAtBeginningOfFile3.jet
PsiComment(DOC_COMMENT)('/**\n\nfooo')
NAMESPACE_HEADER
<empty list>
@@ -0,0 +1,5 @@
/**
/**foo*/
asdfas
@@ -0,0 +1,4 @@
JetFile: DocCommentAtBeginningOfFile4.jet
PsiComment(DOC_COMMENT)('/**\n\n/**foo*/\n\nasdfas')
NAMESPACE_HEADER
<empty list>
+19
View File
@@ -0,0 +1,19 @@
fun doo() {
/*/b
// */
b
/**/
b
/* */
b
/*/**/*/
b
/***/
b
/**/***/*/
b
/** /**
*/***/
b
}
+34
View File
@@ -0,0 +1,34 @@
JetFile: NestedComments.jet
NAMESPACE_HEADER
<empty list>
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('doo')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n')
PsiComment(BLOCK_COMMENT)('/*/b\n// */')
PsiWhiteSpace('\n')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n')
PsiComment(DOC_COMMENT)('/**/\nb\n/* */\nb\n/*/**/*/\nb\n/***/\nb\n/**/***/')
PsiErrorElement:Expecting an element
PsiElement(MUL)('*')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(DIV)('/')
PsiWhiteSpace('\n')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n')
PsiComment(DOC_COMMENT)('/** /**\n\n*/***/')
PsiWhiteSpace('\n')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')