Remove file column from tokeninfo tables.

This commit is contained in:
Nick Rolfe
2021-09-20 21:25:42 +01:00
parent 6f059638d2
commit 6a17dfd228
5 changed files with 7 additions and 17 deletions

View File

@@ -422,7 +422,6 @@ impl Visitor<'_> {
vec![
Arg::Label(id),
Arg::Int(*kind_id),
Arg::Label(self.file_label),
sliced_source_arg(self.source, node),
Arg::Label(loc),
],

View File

@@ -305,13 +305,6 @@ fn create_tokeninfo<'a>(name: &'a str, type_name: &'a str) -> dbscheme::Table<'a
ql_type: ql::Type::Int,
ql_type_is_ref: true,
},
dbscheme::Column {
unique: false,
db_type: dbscheme::DbColumnType::Int,
name: "file",
ql_type: ql::Type::AtType("file"),
ql_type_is_ref: true,
},
dbscheme::Column {
unique: false,
db_type: dbscheme::DbColumnType::String,

View File

@@ -119,14 +119,14 @@ pub fn create_ast_node_class<'a>(ast_node: &'a str, ast_node_parent: &'a str) ->
}
pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Class<'a> {
let tokeninfo_arity = 5;
let tokeninfo_arity = 4;
let get_value = ql::Predicate {
qldoc: Some(String::from("Gets the value of this token.")),
name: "getValue",
overridden: false,
return_type: Some(ql::Type::String),
formal_parameters: vec![],
body: create_get_field_expr_for_column_storage("result", tokeninfo, 2, tokeninfo_arity),
body: create_get_field_expr_for_column_storage("result", tokeninfo, 1, tokeninfo_arity),
};
let get_location = ql::Predicate {
qldoc: Some(String::from("Gets the location of this token.")),
@@ -134,7 +134,7 @@ pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Cl
overridden: true,
return_type: Some(ql::Type::Normal("Location")),
formal_parameters: vec![],
body: create_get_field_expr_for_column_storage("result", tokeninfo, 3, tokeninfo_arity),
body: create_get_field_expr_for_column_storage("result", tokeninfo, 2, tokeninfo_arity),
};
let to_string = ql::Predicate {
qldoc: Some(String::from(

View File

@@ -34,10 +34,10 @@ module Ruby {
/** A token. */
class Token extends @ruby_token, AstNode {
/** Gets the value of this token. */
string getValue() { ruby_tokeninfo(this, _, _, result, _) }
string getValue() { ruby_tokeninfo(this, _, result, _) }
/** Gets the location of this token. */
override Location getLocation() { ruby_tokeninfo(this, _, _, _, result) }
override Location getLocation() { ruby_tokeninfo(this, _, _, result) }
/** Gets a string representation of this element. */
override string toString() { result = getValue() }
@@ -1875,10 +1875,10 @@ module Erb {
/** A token. */
class Token extends @erb_token, AstNode {
/** Gets the value of this token. */
string getValue() { erb_tokeninfo(this, _, _, result, _) }
string getValue() { erb_tokeninfo(this, _, result, _) }
/** Gets the location of this token. */
override Location getLocation() { erb_tokeninfo(this, _, _, _, result) }
override Location getLocation() { erb_tokeninfo(this, _, _, result) }
/** Gets a string representation of this element. */
override string toString() { result = getValue() }

View File

@@ -1205,7 +1205,6 @@ ruby_yield_def(
ruby_tokeninfo(
unique int id: @ruby_token,
int kind: int ref,
int file: @file ref,
string value: string ref,
int loc: @location ref
);
@@ -1292,7 +1291,6 @@ erb_template_def(
erb_tokeninfo(
unique int id: @erb_token,
int kind: int ref,
int file: @file ref,
string value: string ref,
int loc: @location ref
);