Skip to content

Commit 8a89574

Browse files
committed
Ruby: Move language specific code out of FileSystem.qll (at least for now).
1 parent d4414da commit 8a89574

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

ruby/ql/lib/codeql/files/FileSystem.qll

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
private import codeql.Locations
44
private import codeql.util.FileSystem
5-
private import codeql.ruby.Diagnostics
65

76
private module Input implements InputSig {
87
abstract class ContainerBase extends @container {
@@ -35,20 +34,3 @@ class File extends Container, Impl::File {
3534
/** Holds if this file was extracted from ordinary source code. */
3635
predicate fromSource() { any() }
3736
}
38-
39-
/**
40-
* A successfully extracted file, that is, a file that was extracted and
41-
* contains no extraction errors or warnings.
42-
*/
43-
class SuccessfullyExtractedFile extends File {
44-
SuccessfullyExtractedFile() {
45-
not exists(Diagnostic d |
46-
d.getLocation().getFile() = this and
47-
(
48-
d instanceof ExtractionError
49-
or
50-
d instanceof ExtractionWarning
51-
)
52-
)
53-
}
54-
}

ruby/ql/lib/codeql/ruby/AST.qll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ private import ast.internal.Scope
1818
private import ast.internal.Synthesis
1919
private import ast.internal.TreeSitter
2020
private import Customizations
21+
private import Diagnostics
2122

2223
cached
2324
private module Cached {
@@ -166,3 +167,20 @@ class RubyFile extends File {
166167
/** Gets the number of lines of comments in this file. */
167168
int getNumberOfLinesOfComments() { result = count(int line | this.line(line, true)) }
168169
}
170+
171+
/**
172+
* A successfully extracted file, that is, a file that was extracted and
173+
* contains no extraction errors or warnings.
174+
*/
175+
class SuccessfullyExtractedFile extends RubyFile {
176+
SuccessfullyExtractedFile() {
177+
not exists(Diagnostic d |
178+
d.getLocation().getFile() = this and
179+
(
180+
d instanceof ExtractionError
181+
or
182+
d instanceof ExtractionWarning
183+
)
184+
)
185+
}
186+
}

0 commit comments

Comments
 (0)