mirror of
https://github.com/github/codeql.git
synced 2026-02-19 08:23:45 +01:00
Don't generate the QL File class
This commit is contained in:
@@ -130,48 +130,6 @@ fn create_none_predicate(
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates the hard-coded `File` class.
|
||||
fn create_file_class() -> ql::Class {
|
||||
let get_absolute_path = ql::Predicate {
|
||||
name: "getAbsolutePath".to_owned(),
|
||||
overridden: false,
|
||||
return_type: Some(ql::Type::String),
|
||||
formal_parameters: vec![],
|
||||
//override string getAbsolutePath() { files(underlyingElement(this), result, _, _, _) }
|
||||
body: ql::Expression::Pred(
|
||||
"files".to_owned(),
|
||||
vec![
|
||||
ql::Expression::Var("this".to_owned()),
|
||||
ql::Expression::Var("result".to_owned()),
|
||||
ql::Expression::Var("_".to_owned()),
|
||||
ql::Expression::Var("_".to_owned()),
|
||||
ql::Expression::Var("_".to_owned()),
|
||||
],
|
||||
),
|
||||
};
|
||||
let to_string = ql::Predicate {
|
||||
name: "toString".to_owned(),
|
||||
overridden: false,
|
||||
return_type: Some(ql::Type::String),
|
||||
formal_parameters: vec![],
|
||||
body: ql::Expression::Equals(
|
||||
Box::new(ql::Expression::Var("result".to_owned())),
|
||||
Box::new(ql::Expression::Dot(
|
||||
Box::new(ql::Expression::Var("this".to_owned())),
|
||||
"getAbsolutePath".to_owned(),
|
||||
vec![],
|
||||
)),
|
||||
),
|
||||
};
|
||||
ql::Class {
|
||||
name: "File".to_owned(),
|
||||
is_abstract: false,
|
||||
supertypes: vec![ql::Type::AtType("file".to_owned())],
|
||||
characteristic_predicate: None,
|
||||
predicates: vec![get_absolute_path, to_string],
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates the special `Location` class to wrap the location table.
|
||||
fn create_location_class() -> ql::Class {
|
||||
let to_string = ql::Predicate {
|
||||
@@ -499,11 +457,7 @@ fn create_field_getters(
|
||||
/// Converts the given node types into CodeQL classes wrapping the dbscheme.
|
||||
pub fn convert_nodes(nodes: &Vec<node_types::Entry>) -> Vec<ql::Class> {
|
||||
let supertype_map = create_supertype_map(nodes);
|
||||
let mut classes: Vec<ql::Class> = vec![
|
||||
create_file_class(),
|
||||
create_location_class(),
|
||||
create_top_class(),
|
||||
];
|
||||
let mut classes: Vec<ql::Class> = vec![create_location_class(), create_top_class()];
|
||||
|
||||
for node in nodes {
|
||||
match &node {
|
||||
|
||||
Reference in New Issue
Block a user