-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added comment unit test data refs #17
- Loading branch information
Showing
3 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
grammar-kotlin-parser-test/src/commonMain/resources/testdata/Issue17.kt.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* multiline comment | ||
*/ | ||
package example | ||
|
||
/** | ||
* A group of *members*. | ||
* | ||
* This class has no useful logic; it's just a documentation example. | ||
* | ||
* @param T the type of a member in this group. | ||
* @property name the name of this group. | ||
* @constructor Creates an empty group. | ||
*/ | ||
class Group<T>(val name: String) { | ||
/** | ||
* Adds a [member] to this group. | ||
* @return the new size of the group. | ||
*/ | ||
fun add(member: T): Int { | ||
// single line comments | ||
// ... | ||
} | ||
} |
113 changes: 113 additions & 0 deletions
113
grammar-kotlin-parser-test/src/commonMain/resources/testdata/Issue17.raw.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
kotlinFile | ||
DelimitedComment >>>/*\n * multiline comment\n */<<< (COMMENT) | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
packageHeader | ||
PACKAGE >>>package<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
identifier | ||
simpleIdentifier | ||
Identifier >>>example<<< (DEFAULT_TOKEN_CHANNEL) | ||
semi | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
DelimitedComment >>>/**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @param T the type of a member in this group.\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */<<< (COMMENT) | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
importList | ||
topLevelObject | ||
declaration | ||
classDeclaration | ||
CLASS >>>class<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
simpleIdentifier | ||
Identifier >>>Group<<< (DEFAULT_TOKEN_CHANNEL) | ||
typeParameters | ||
LANGLE >>><<<< (DEFAULT_TOKEN_CHANNEL) | ||
typeParameter | ||
simpleIdentifier | ||
Identifier >>>T<<< (DEFAULT_TOKEN_CHANNEL) | ||
RANGLE >>>><<< (DEFAULT_TOKEN_CHANNEL) | ||
primaryConstructor | ||
classParameters | ||
LPAREN >>>(<<< (DEFAULT_TOKEN_CHANNEL) | ||
classParameter | ||
VAL >>>val<<< (DEFAULT_TOKEN_CHANNEL) | ||
Inside_WS >>> <<< (HIDDEN) | ||
simpleIdentifier | ||
Identifier >>>name<<< (DEFAULT_TOKEN_CHANNEL) | ||
COLON >>>:<<< (DEFAULT_TOKEN_CHANNEL) | ||
Inside_WS >>> <<< (HIDDEN) | ||
type | ||
typeReference | ||
userType | ||
simpleUserType | ||
simpleIdentifier | ||
Identifier >>>String<<< (DEFAULT_TOKEN_CHANNEL) | ||
RPAREN >>>)<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
classBody | ||
LCURL >>>{<<< (DEFAULT_TOKEN_CHANNEL) | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
DelimitedComment >>>/**\n * Adds a [member] to this group.\n * @return the new size of the group.\n */<<< (COMMENT) | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
classMemberDeclarations | ||
classMemberDeclaration | ||
declaration | ||
functionDeclaration | ||
FUN >>>fun<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
simpleIdentifier | ||
Identifier >>>add<<< (DEFAULT_TOKEN_CHANNEL) | ||
functionValueParameters | ||
LPAREN >>>(<<< (DEFAULT_TOKEN_CHANNEL) | ||
functionValueParameter | ||
parameter | ||
simpleIdentifier | ||
Identifier >>>member<<< (DEFAULT_TOKEN_CHANNEL) | ||
COLON >>>:<<< (DEFAULT_TOKEN_CHANNEL) | ||
Inside_WS >>> <<< (HIDDEN) | ||
type | ||
typeReference | ||
userType | ||
simpleUserType | ||
simpleIdentifier | ||
Identifier >>>T<<< (DEFAULT_TOKEN_CHANNEL) | ||
RPAREN >>>)<<< (DEFAULT_TOKEN_CHANNEL) | ||
COLON >>>:<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
type | ||
typeReference | ||
userType | ||
simpleUserType | ||
simpleIdentifier | ||
Identifier >>>Int<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
functionBody | ||
block | ||
LCURL >>>{<<< (DEFAULT_TOKEN_CHANNEL) | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
LineComment >>>// single line comments<<< (COMMENT) | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
LineComment >>>// ...<<< (COMMENT) | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
WS >>> <<< (HIDDEN) | ||
WS >>> <<< (HIDDEN) | ||
statements | ||
RCURL >>>}<<< (DEFAULT_TOKEN_CHANNEL) | ||
semis | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
RCURL >>>}<<< (DEFAULT_TOKEN_CHANNEL) | ||
semis | ||
NL >>>\n<<< (DEFAULT_TOKEN_CHANNEL) | ||
EOF >>><EOF><<< (DEFAULT_TOKEN_CHANNEL) |
10 changes: 10 additions & 0 deletions
10
grammar-kotlin-parser-test/src/commonMain/resources/testdata/Issue17.summary.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PackageHeader(example) | ||
importList | ||
KlassDeclaration(class Group) | ||
KlassDeclaration(constructor) | ||
KlassDeclaration(val name String) | ||
KlassTypeParameter | ||
KlassIdentifier(T) | ||
classBody | ||
KlassDeclaration(fun add Int) | ||
KlassDeclaration(parameter member T) |