Skip to content

Commit 5fb61b0

Browse files
authored
Merge pull request #17606 from hvitved/rust/variables
2 parents 6af5afc + 91e26d0 commit 5fb61b0

25 files changed

+1100
-143
lines changed

rust/ql/.generated.list

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/.gitattributes

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* This module provides classes related to variables.
3+
*/
4+
5+
private import internal.VariableImpl
6+
7+
final class Variable = Impl::Variable;
8+
9+
final class VariableAccess = Impl::VariableAccess;

rust/ql/lib/codeql/rust/elements/internal/CommentImpl.qll

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `Comment`.
43
*
@@ -12,12 +11,20 @@ private import codeql.rust.elements.internal.generated.Comment
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* A comment. For example:
1717
* ```rust
1818
* // this is a comment
1919
* /// This is a doc comment
2020
* ```
2121
*/
22-
class Comment extends Generated::Comment { }
22+
class Comment extends Generated::Comment {
23+
/**
24+
* Gets the text of this comment, excluding the comment marker.
25+
*/
26+
string getCommentText() {
27+
exists(string s | s = this.getText() | result = s.regexpCapture("///?\\s*(.*)", 1))
28+
}
29+
}
2330
}

rust/ql/lib/codeql/rust/elements/internal/IdentPatImpl.qll

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `IdentPat`.
43
*
@@ -12,6 +11,7 @@ private import codeql.rust.elements.internal.generated.IdentPat
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* A binding pattern. For example:
1717
* ```rust
@@ -27,5 +27,7 @@ module Impl {
2727
* };
2828
* ```
2929
*/
30-
class IdentPat extends Generated::IdentPat { }
30+
class IdentPat extends Generated::IdentPat {
31+
override string toString() { result = this.getName().getText() }
32+
}
3133
}

0 commit comments

Comments
 (0)