File tree Expand file tree Collapse file tree
ruby/ql/lib/utils/test/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,22 +12,26 @@ module Impl implements InlineExpectationsTestSig {
1212 * A class representing comments that may contain inline expectations (Ruby line comments and ERB comments).
1313 */
1414 class ExpectationComment extends TAnyComment {
15+ Ruby:: Comment asRubyComment ( ) { this = RubyComment ( result ) }
16+
17+ R:: ErbComment asErbComment ( ) { this = ErbComment ( result ) }
18+
1519 string toString ( ) {
16- result = any ( Ruby :: Comment c | this = RubyComment ( c ) ) .toString ( )
20+ result = this . asRubyComment ( ) .toString ( )
1721 or
18- result = any ( R :: ErbComment c | this = ErbComment ( c ) ) .toString ( )
22+ result = this . asErbComment ( ) .toString ( )
1923 }
2024
2125 Location getLocation ( ) {
22- result = any ( Ruby :: Comment c | this = RubyComment ( c ) ) .getLocation ( )
26+ result = this . asRubyComment ( ) .getLocation ( )
2327 or
24- result = any ( R :: ErbComment c | this = ErbComment ( c ) ) .getLocation ( )
28+ result = this . asErbComment ( ) .getLocation ( )
2529 }
2630
2731 string getContents ( ) {
28- result = any ( Ruby :: Comment c | this = RubyComment ( c ) ) .getValue ( ) .suffix ( 1 )
32+ result = this . asRubyComment ( ) .getValue ( ) .suffix ( 1 )
2933 or
30- result = any ( R :: ErbComment c | this = ErbComment ( c ) ) .getValue ( ) .suffix ( 1 )
34+ result = this . asErbComment ( ) .getValue ( ) .suffix ( 1 )
3135 }
3236 }
3337
You can’t perform that action at this time.
0 commit comments