File tree Expand file tree Collapse file tree 4 files changed +21
-0
lines changed
test/utils-tests/modelgenerator Expand file tree Collapse file tree 4 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ private import rust as R
2+ private import codeql.mad.test.InlineMadTest
3+
4+ private module InlineMadTestLang implements InlineMadTestLangSig {
5+ class Callable = R:: Function ;
6+
7+ string getComment ( R:: Function callable ) {
8+ exists ( R:: Comment comment |
9+ result = comment .getCommentText ( ) and
10+ comment .getLocation ( ) .getFile ( ) = callable .getLocation ( ) .getFile ( ) and
11+ // When a function is preceded by comments its start line is the line of
12+ // the first comment. Hence all relevant comments are found by including
13+ // comments from the start line and up to the line with the function
14+ // name.
15+ callable .getLocation ( ) .getStartLine ( ) <= comment .getLocation ( ) .getStartLine ( ) and
16+ comment .getLocation ( ) .getStartLine ( ) <= callable .getName ( ) .getLocation ( ) .getStartLine ( )
17+ )
18+ }
19+ }
20+
21+ import InlineMadTestImpl< InlineMadTestLang >
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments