Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CodeQL language support #604

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@
"line_comment": ["*"],
"extensions": ["cob", "cbl", "ccp", "cobol", "cpy"]
},
"CodeQL": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
"quotes": [["\\\"", "\\\""]],
"extensions": ["ql", "qll"]
},
"CoffeeScript": {
"line_comment": ["#"],
"multi_line_comments": [["###", "###"]],
Expand Down
40 changes: 40 additions & 0 deletions tests/data/codeql.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//! 40 lines 17 code 15 comments 8 blanks

/**
* @name fu
* @description bar
*
* Rerum similique consequatur non dolor sit. Autem doloribus sed in sint
* ratione sit voluptates at. Nihil ut fugiat ab ut aliquid consequatur sunt
* ullam. Adipisci voluptatem hic dicta.
*/

// asdf

import cpp
private import test.foo.bar.baz

/**
* Another comment.
*/
class C extends Expr {
C () {
// single comment
not this.test() and
not this.what()
}

private predicate what() {
/* TODO */
this.isAbstract()
}

predicate test() { this = "what" }
}

from Function f
where
f.getName() = "function" and /* inline comment */
f.getArgument(0).asExpr() instanceof FooBar
select f, "function"