Skip to content

Commit 6a17dfd

Browse files
committed
Remove file column from tokeninfo tables.
1 parent 6f05963 commit 6a17dfd

File tree

5 files changed

+7
-17
lines changed

5 files changed

+7
-17
lines changed

extractor/src/extractor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ impl Visitor<'_> {
422422
vec![
423423
Arg::Label(id),
424424
Arg::Int(*kind_id),
425-
Arg::Label(self.file_label),
426425
sliced_source_arg(self.source, node),
427426
Arg::Label(loc),
428427
],

generator/src/main.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,6 @@ fn create_tokeninfo<'a>(name: &'a str, type_name: &'a str) -> dbscheme::Table<'a
305305
ql_type: ql::Type::Int,
306306
ql_type_is_ref: true,
307307
},
308-
dbscheme::Column {
309-
unique: false,
310-
db_type: dbscheme::DbColumnType::Int,
311-
name: "file",
312-
ql_type: ql::Type::AtType("file"),
313-
ql_type_is_ref: true,
314-
},
315308
dbscheme::Column {
316309
unique: false,
317310
db_type: dbscheme::DbColumnType::String,

generator/src/ql_gen.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,22 @@ pub fn create_ast_node_class<'a>(ast_node: &'a str, ast_node_parent: &'a str) ->
119119
}
120120

121121
pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Class<'a> {
122-
let tokeninfo_arity = 5;
122+
let tokeninfo_arity = 4;
123123
let get_value = ql::Predicate {
124124
qldoc: Some(String::from("Gets the value of this token.")),
125125
name: "getValue",
126126
overridden: false,
127127
return_type: Some(ql::Type::String),
128128
formal_parameters: vec![],
129-
body: create_get_field_expr_for_column_storage("result", tokeninfo, 2, tokeninfo_arity),
129+
body: create_get_field_expr_for_column_storage("result", tokeninfo, 1, tokeninfo_arity),
130130
};
131131
let get_location = ql::Predicate {
132132
qldoc: Some(String::from("Gets the location of this token.")),
133133
name: "getLocation",
134134
overridden: true,
135135
return_type: Some(ql::Type::Normal("Location")),
136136
formal_parameters: vec![],
137-
body: create_get_field_expr_for_column_storage("result", tokeninfo, 3, tokeninfo_arity),
137+
body: create_get_field_expr_for_column_storage("result", tokeninfo, 2, tokeninfo_arity),
138138
};
139139
let to_string = ql::Predicate {
140140
qldoc: Some(String::from(

ql/lib/codeql/ruby/ast/internal/TreeSitter.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ module Ruby {
3434
/** A token. */
3535
class Token extends @ruby_token, AstNode {
3636
/** Gets the value of this token. */
37-
string getValue() { ruby_tokeninfo(this, _, _, result, _) }
37+
string getValue() { ruby_tokeninfo(this, _, result, _) }
3838

3939
/** Gets the location of this token. */
40-
override Location getLocation() { ruby_tokeninfo(this, _, _, _, result) }
40+
override Location getLocation() { ruby_tokeninfo(this, _, _, result) }
4141

4242
/** Gets a string representation of this element. */
4343
override string toString() { result = getValue() }
@@ -1875,10 +1875,10 @@ module Erb {
18751875
/** A token. */
18761876
class Token extends @erb_token, AstNode {
18771877
/** Gets the value of this token. */
1878-
string getValue() { erb_tokeninfo(this, _, _, result, _) }
1878+
string getValue() { erb_tokeninfo(this, _, result, _) }
18791879

18801880
/** Gets the location of this token. */
1881-
override Location getLocation() { erb_tokeninfo(this, _, _, _, result) }
1881+
override Location getLocation() { erb_tokeninfo(this, _, _, result) }
18821882

18831883
/** Gets a string representation of this element. */
18841884
override string toString() { result = getValue() }

ql/lib/ruby.dbscheme

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,6 @@ ruby_yield_def(
12051205
ruby_tokeninfo(
12061206
unique int id: @ruby_token,
12071207
int kind: int ref,
1208-
int file: @file ref,
12091208
string value: string ref,
12101209
int loc: @location ref
12111210
);
@@ -1292,7 +1291,6 @@ erb_template_def(
12921291
erb_tokeninfo(
12931292
unique int id: @erb_token,
12941293
int kind: int ref,
1295-
int file: @file ref,
12961294
string value: string ref,
12971295
int loc: @location ref
12981296
);

0 commit comments

Comments
 (0)