inline Location into the shared implementation of InlineExpectationsTest

This commit is contained in:
erik-krogh
2022-12-22 11:09:43 +01:00
parent 08e9d3391f
commit b3dd50bc36
9 changed files with 172 additions and 164 deletions

View File

@@ -3,20 +3,18 @@
* See `shared/util/codeql/util/test/InlineExpectationsTest.qll`
*/
private import codeql.ruby.AST as R
private import codeql.util.test.InlineExpectationsTest
private import codeql.ruby.ast.internal.TreeSitter
private module Impl implements InlineExpectationsTestSig {
private import codeql.ruby.ast.internal.TreeSitter
/**
* A class representing line comments in Ruby.
*/
private class ExpectationComment extends Ruby::Comment {
string getContents() { result = this.getValue().suffix(1) }
/**
* A class representing line comments in Ruby.
*/
class ExpectationComment extends Ruby::Comment {
string getContents() { result = this.getValue().suffix(1) }
predicate hasLocationInfo(string file, int line, int column, int endLine, int endColumn) {
this.getLocation().hasLocationInfo(file, line, column, endLine, endColumn)
}
class Location = R::Location;
}
import Make<Impl>
import Make<ExpectationComment>