Files
kotlin-fork/compiler/testData/psi/EnumShortNoCommas.txt
T
Mikhail Glukhikh 1a312140e9 New enum syntax: Short constructor syntax introduced for entries, optional commas between entries, semicolon after entries. #KT-7605 Fixed.
Grammar changed accordingly.
Semicolons prohibited after an entry except the last one.
Only one initializer is allowed per entry.
EnumReferenceExpression AST node introduced.
Some tests fixed, a pair of new tests written. Kotlin code inside project fixed.
Formatter and intendation tests fixed accordingly.
Stub version is incremented.
2015-05-15 16:13:32 +03:00

85 lines
2.7 KiB
Plaintext

JetFile: EnumShortNoCommas.kt
PACKAGE_DIRECTIVE
<empty list>
CLASS
PsiComment(EOL_COMMENT)('// NB: this test uses deprecated syntax')
PsiWhiteSpace('\n')
PsiComment(EOL_COMMENT)('// Delete it when this syntax is no longer supported')
PsiWhiteSpace('\n')
MODIFIER_LIST
PsiElement(enum)('enum')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Color')
PRIMARY_CONSTRUCTOR
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('rgb')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
CLASS_BODY
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
ENUM_ENTRY
OBJECT_DECLARATION_NAME
PsiElement(IDENTIFIER)('RED')
INITIALIZER_LIST
DELEGATOR_SUPER_CALL
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION
<empty list>
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('0xFF000')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
ENUM_ENTRY
OBJECT_DECLARATION_NAME
PsiElement(IDENTIFIER)('GREEN')
INITIALIZER_LIST
DELEGATOR_SUPER_CALL
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION
<empty list>
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('0x00FF00')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
ENUM_ENTRY
OBJECT_DECLARATION_NAME
PsiElement(IDENTIFIER)('BLUE')
INITIALIZER_LIST
DELEGATOR_SUPER_CALL
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION
<empty list>
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('0x0000FF')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')