EOLs are treated properly in the presence of comments and multiple whitespace tokens

This commit is contained in:
Andrey Breslav
2011-01-02 17:00:52 +03:00
parent cd38e28e15
commit 3f82192a7c
4 changed files with 120 additions and 6 deletions
+19
View File
@@ -0,0 +1,19 @@
fun foo() {
a
+ b
a
/** */+ b
a
/* */+ b
a /*
*/ + b
a
/*
*/ + b
a /**
*/ + b
a //
+ b
a //
+ b
}
+84
View File
@@ -0,0 +1,84 @@
JetFile: EOLsInComments.jet
NAMESPACE
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('foo')
TYPE_PARAMETER_LIST
<empty list>
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n ')
PsiComment(DOC_COMMENT)('/** */')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n ')
PsiComment(BLOCK_COMMENT)('/* */')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiComment(BLOCK_COMMENT)('/*\n */')
PsiWhiteSpace(' ')
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n ')
PsiComment(BLOCK_COMMENT)('/*\n */')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiComment(DOC_COMMENT)('/**\n */')
PsiWhiteSpace(' ')
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiComment(EOL_COMMENT)('//')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiComment(EOL_COMMENT)('//')
PsiWhiteSpace('\n')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')