File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
java/ql/test/TestUtilities Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,19 @@ import java
4
4
* A class representing line comments in Java, which is simply Javadoc restricted
5
5
* to EOL comments, with an extra accessor used by the InlineExpectations core code
6
6
*/
7
- class ExpectationComment extends Javadoc {
8
- ExpectationComment ( ) { isEolComment ( this ) }
9
-
7
+ abstract class ExpectationComment extends Top {
10
8
/** Gets the contents of the given comment, _without_ the preceding comment marker (`//`). */
11
- string getContents ( ) { result = this .getChild ( 0 ) .toString ( ) }
9
+ abstract string getContents ( ) ;
10
+ }
11
+
12
+ private class JavadocExpectationComment extends Javadoc , ExpectationComment {
13
+ JavadocExpectationComment ( ) { isEolComment ( this ) }
14
+
15
+ override string getContents ( ) { result = this .getChild ( 0 ) .toString ( ) }
16
+ }
17
+
18
+ private class KtExpectationComment extends KtComment , ExpectationComment {
19
+ override string getContents ( ) {
20
+ result = this .getText ( ) .regexpCapture ( "(?://|/\\*)(.*)(?:\\*/)?" , 1 )
21
+ }
12
22
}
You can’t perform that action at this time.
0 commit comments