Grammar: remove the dead CommandNode.hint_mode field
HintMode became per-node (Node::Hinted) in the node-attached refactor; the per-command hint_mode field was never the mechanism and is now read by nothing. Removed the field and its 20 `None` initialisers.
This commit is contained in:
+10
-30
@@ -192,87 +192,67 @@ pub static QUIT: CommandNode = CommandNode {
|
|||||||
shape: EMPTY_SEQ,
|
shape: EMPTY_SEQ,
|
||||||
ast_builder: build_quit,
|
ast_builder: build_quit,
|
||||||
help_id: Some("app.quit"),
|
help_id: Some("app.quit"),
|
||||||
usage_ids: &["parse.usage.quit"],
|
usage_ids: &["parse.usage.quit"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static HELP: CommandNode = CommandNode {
|
pub static HELP: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("help"),
|
entry: Word::keyword("help"),
|
||||||
shape: EMPTY_SEQ,
|
shape: EMPTY_SEQ,
|
||||||
ast_builder: build_help,
|
ast_builder: build_help,
|
||||||
help_id: Some("app.help"),
|
help_id: Some("app.help"),
|
||||||
usage_ids: &["parse.usage.help"],
|
usage_ids: &["parse.usage.help"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static REBUILD: CommandNode = CommandNode {
|
pub static REBUILD: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("rebuild"),
|
entry: Word::keyword("rebuild"),
|
||||||
shape: EMPTY_SEQ,
|
shape: EMPTY_SEQ,
|
||||||
ast_builder: build_rebuild,
|
ast_builder: build_rebuild,
|
||||||
help_id: Some("app.rebuild"),
|
help_id: Some("app.rebuild"),
|
||||||
usage_ids: &["parse.usage.rebuild"],
|
usage_ids: &["parse.usage.rebuild"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static SAVE: CommandNode = CommandNode {
|
pub static SAVE: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("save"),
|
entry: Word::keyword("save"),
|
||||||
shape: SAVE_AS_OPT,
|
shape: SAVE_AS_OPT,
|
||||||
ast_builder: build_save,
|
ast_builder: build_save,
|
||||||
help_id: Some("app.save"),
|
help_id: Some("app.save"),
|
||||||
usage_ids: &["parse.usage.save"],
|
usage_ids: &["parse.usage.save"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static NEW: CommandNode = CommandNode {
|
pub static NEW: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("new"),
|
entry: Word::keyword("new"),
|
||||||
shape: EMPTY_SEQ,
|
shape: EMPTY_SEQ,
|
||||||
ast_builder: build_new,
|
ast_builder: build_new,
|
||||||
help_id: Some("app.new"),
|
help_id: Some("app.new"),
|
||||||
usage_ids: &["parse.usage.new"],
|
usage_ids: &["parse.usage.new"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static LOAD: CommandNode = CommandNode {
|
pub static LOAD: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("load"),
|
entry: Word::keyword("load"),
|
||||||
shape: EMPTY_SEQ,
|
shape: EMPTY_SEQ,
|
||||||
ast_builder: build_load,
|
ast_builder: build_load,
|
||||||
help_id: Some("app.load"),
|
help_id: Some("app.load"),
|
||||||
usage_ids: &["parse.usage.load"],
|
usage_ids: &["parse.usage.load"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static EXPORT: CommandNode = CommandNode {
|
pub static EXPORT: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("export"),
|
entry: Word::keyword("export"),
|
||||||
shape: EXPORT_PATH_OPT,
|
shape: EXPORT_PATH_OPT,
|
||||||
ast_builder: build_export,
|
ast_builder: build_export,
|
||||||
help_id: Some("app.export"),
|
help_id: Some("app.export"),
|
||||||
usage_ids: &["parse.usage.export"],
|
usage_ids: &["parse.usage.export"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static IMPORT: CommandNode = CommandNode {
|
pub static IMPORT: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("import"),
|
entry: Word::keyword("import"),
|
||||||
shape: IMPORT_BODY_OPT,
|
shape: IMPORT_BODY_OPT,
|
||||||
ast_builder: build_import,
|
ast_builder: build_import,
|
||||||
help_id: Some("app.import"),
|
help_id: Some("app.import"),
|
||||||
usage_ids: &["parse.usage.import"],
|
usage_ids: &["parse.usage.import"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static MODE: CommandNode = CommandNode {
|
pub static MODE: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("mode"),
|
entry: Word::keyword("mode"),
|
||||||
shape: MODE_VALUE,
|
shape: MODE_VALUE,
|
||||||
ast_builder: build_mode,
|
ast_builder: build_mode,
|
||||||
help_id: Some("app.mode"),
|
help_id: Some("app.mode"),
|
||||||
usage_ids: &["parse.usage.mode"],
|
usage_ids: &["parse.usage.mode"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static MESSAGES: CommandNode = CommandNode {
|
pub static MESSAGES: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("messages"),
|
entry: Word::keyword("messages"),
|
||||||
shape: MESSAGES_VALUE_OPT,
|
shape: MESSAGES_VALUE_OPT,
|
||||||
ast_builder: build_messages,
|
ast_builder: build_messages,
|
||||||
help_id: Some("app.messages"),
|
help_id: Some("app.messages"),
|
||||||
usage_ids: &["parse.usage.messages"],
|
usage_ids: &["parse.usage.messages"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|||||||
+5
-15
@@ -653,42 +653,32 @@ pub static SHOW: CommandNode = CommandNode {
|
|||||||
shape: SHOW_SHAPE,
|
shape: SHOW_SHAPE,
|
||||||
ast_builder: build_show,
|
ast_builder: build_show,
|
||||||
help_id: Some("data.show"),
|
help_id: Some("data.show"),
|
||||||
usage_ids: &["parse.usage.show_data", "parse.usage.show_table"],
|
usage_ids: &["parse.usage.show_data", "parse.usage.show_table"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static INSERT: CommandNode = CommandNode {
|
pub static INSERT: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("insert"),
|
entry: Word::keyword("insert"),
|
||||||
shape: INSERT_SHAPE,
|
shape: INSERT_SHAPE,
|
||||||
ast_builder: build_insert,
|
ast_builder: build_insert,
|
||||||
help_id: Some("data.insert"),
|
help_id: Some("data.insert"),
|
||||||
usage_ids: &["parse.usage.insert"],
|
usage_ids: &["parse.usage.insert"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static UPDATE: CommandNode = CommandNode {
|
pub static UPDATE: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("update"),
|
entry: Word::keyword("update"),
|
||||||
shape: UPDATE_SHAPE,
|
shape: UPDATE_SHAPE,
|
||||||
ast_builder: build_update,
|
ast_builder: build_update,
|
||||||
help_id: Some("data.update"),
|
help_id: Some("data.update"),
|
||||||
usage_ids: &["parse.usage.update"],
|
usage_ids: &["parse.usage.update"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static DELETE: CommandNode = CommandNode {
|
pub static DELETE: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("delete"),
|
entry: Word::keyword("delete"),
|
||||||
shape: DELETE_SHAPE,
|
shape: DELETE_SHAPE,
|
||||||
ast_builder: build_delete,
|
ast_builder: build_delete,
|
||||||
help_id: Some("data.delete"),
|
help_id: Some("data.delete"),
|
||||||
usage_ids: &["parse.usage.delete"],
|
usage_ids: &["parse.usage.delete"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static REPLAY: CommandNode = CommandNode {
|
pub static REPLAY: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("replay"),
|
entry: Word::keyword("replay"),
|
||||||
shape: REPLAY_PATH,
|
shape: REPLAY_PATH,
|
||||||
ast_builder: build_replay,
|
ast_builder: build_replay,
|
||||||
help_id: Some("data.replay"),
|
help_id: Some("data.replay"),
|
||||||
usage_ids: &["parse.usage.replay"],
|
usage_ids: &["parse.usage.replay"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|||||||
+5
-15
@@ -638,36 +638,28 @@ pub static DROP: CommandNode = CommandNode {
|
|||||||
"parse.usage.drop_table",
|
"parse.usage.drop_table",
|
||||||
"parse.usage.drop_column",
|
"parse.usage.drop_column",
|
||||||
"parse.usage.drop_relationship",
|
"parse.usage.drop_relationship",
|
||||||
],
|
],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static ADD: CommandNode = CommandNode {
|
pub static ADD: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("add"),
|
entry: Word::keyword("add"),
|
||||||
shape: ADD_SHAPE,
|
shape: ADD_SHAPE,
|
||||||
ast_builder: build_add,
|
ast_builder: build_add,
|
||||||
help_id: Some("ddl.add"),
|
help_id: Some("ddl.add"),
|
||||||
usage_ids: &["parse.usage.add_column", "parse.usage.add_relationship"],
|
usage_ids: &["parse.usage.add_column", "parse.usage.add_relationship"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static RENAME: CommandNode = CommandNode {
|
pub static RENAME: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("rename"),
|
entry: Word::keyword("rename"),
|
||||||
shape: RENAME_COLUMN,
|
shape: RENAME_COLUMN,
|
||||||
ast_builder: build_rename_column,
|
ast_builder: build_rename_column,
|
||||||
help_id: Some("ddl.rename"),
|
help_id: Some("ddl.rename"),
|
||||||
usage_ids: &["parse.usage.rename_column"],
|
usage_ids: &["parse.usage.rename_column"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static CHANGE: CommandNode = CommandNode {
|
pub static CHANGE: CommandNode = CommandNode {
|
||||||
entry: Word::keyword("change"),
|
entry: Word::keyword("change"),
|
||||||
shape: CHANGE_COLUMN,
|
shape: CHANGE_COLUMN,
|
||||||
ast_builder: build_change_column,
|
ast_builder: build_change_column,
|
||||||
help_id: Some("ddl.change"),
|
help_id: Some("ddl.change"),
|
||||||
usage_ids: &["parse.usage.change_column"],
|
usage_ids: &["parse.usage.change_column"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
// =================================================================
|
// =================================================================
|
||||||
// create_table — `create table <Name> [with pk [<col>:<type>[, ...]]]`
|
// create_table — `create table <Name> [with pk [<col>:<type>[, ...]]]`
|
||||||
@@ -799,6 +791,4 @@ pub static CREATE: CommandNode = CommandNode {
|
|||||||
shape: CREATE_TABLE,
|
shape: CREATE_TABLE,
|
||||||
ast_builder: build_create_table,
|
ast_builder: build_create_table,
|
||||||
help_id: Some("ddl.create"),
|
help_id: Some("ddl.create"),
|
||||||
usage_ids: &["parse.usage.create_table"],
|
usage_ids: &["parse.usage.create_table"],};
|
||||||
hint_mode: None,
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -364,8 +364,6 @@ pub struct CommandNode {
|
|||||||
/// carry every variant so the user sees the full family on a
|
/// carry every variant so the user sees the full family on a
|
||||||
/// generic-entry-word failure.
|
/// generic-entry-word failure.
|
||||||
pub usage_ids: &'static [&'static str],
|
pub usage_ids: &'static [&'static str],
|
||||||
#[allow(dead_code)]
|
|
||||||
pub hint_mode: Option<HintMode>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Look up the usage catalog keys for the entry word at the start
|
/// Look up the usage catalog keys for the entry word at the start
|
||||||
|
|||||||
Reference in New Issue
Block a user