Change the names of parser result structs

Change the name of structs CommandResult and ConfigResult to
CommandResultIR and ConfigResultIR to show they are an intermediate
representation used during parsing.
This commit is contained in:
Tony Crisci
2014-05-18 00:44:19 -04:00
committed by Michael Stapelberg
parent dda9a7f6e0
commit 45fa4b7d23
11 changed files with 24 additions and 27 deletions

View File

@ -45,7 +45,7 @@ void run_assignments(i3Window *window) {
DLOG("execute command %s\n", current->dest.command);
char *full_command;
sasprintf(&full_command, "[id=\"%d\"] %s", window->id, current->dest.command);
struct CommandResult *command_output = parse_command(full_command);
struct CommandResultIR *command_output = parse_command(full_command);
free(full_command);
if (command_output->needs_tree_render)

View File

@ -95,7 +95,7 @@ static Output *get_output_of_con(Con *con) {
* and return true, signaling that no further workspace switching should occur in the calling function.
*
*/
static bool maybe_back_and_forth(struct CommandResult *cmd_output, char *name) {
static bool maybe_back_and_forth(struct CommandResultIR *cmd_output, char *name) {
Con *ws = con_get_workspace(focused);
/* If we switched to a different workspace, do nothing */

View File

@ -179,8 +179,8 @@ static cmdp_state state;
#ifndef TEST_PARSER
static Match current_match;
#endif
static struct CommandResult subcommand_output;
static struct CommandResult command_output;
static struct CommandResultIR subcommand_output;
static struct CommandResultIR command_output;
#include "GENERATED_command_call.h"
@ -205,7 +205,7 @@ static void next_state(const cmdp_token *token) {
}
}
struct CommandResult *parse_command(const char *input) {
struct CommandResultIR *parse_command(const char *input) {
DLOG("COMMAND: *%s*\n", input);
state = INITIAL;

View File

@ -232,8 +232,8 @@ static void clear_criteria(void *unused_criteria) {
static cmdp_state state;
static Match current_match;
static struct ConfigResult subcommand_output;
static struct ConfigResult command_output;
static struct ConfigResultIR subcommand_output;
static struct ConfigResultIR command_output;
/* A list which contains the states that lead to the current state, e.g.
* INITIAL, WORKSPACE_LAYOUT.
@ -304,7 +304,7 @@ static char *single_line(const char *start) {
return result;
}
struct ConfigResult *parse_config(const char *input, struct context *context) {
struct ConfigResultIR *parse_config(const char *input, struct context *context) {
/* Dump the entire config file into the debug log. We cannot just use
* DLOG("%s", input); because one log message must not exceed 4 KiB. */
const char *dumpwalk = input;
@ -1000,7 +1000,7 @@ void parse_file(const char *f) {
context = scalloc(sizeof(struct context));
context->filename = f;
struct ConfigResult *config_output = parse_config(new, context);
struct ConfigResultIR *config_output = parse_config(new, context);
yajl_gen_free(config_output->json_gen);
check_for_duplicate_bindings(context);

View File

@ -117,7 +117,7 @@ IPC_HANDLER(command) {
char *command = scalloc(message_size + 1);
strncpy(command, (const char*)message, message_size);
LOG("IPC: received: *%s*\n", command);
struct CommandResult *command_output = parse_command((const char*)command);
struct CommandResultIR *command_output = parse_command((const char*)command);
free(command);
if (command_output->needs_tree_render)

View File

@ -73,7 +73,7 @@ void handle_key_press(xcb_key_press_event_t *event) {
return;
char *command_copy = sstrdup(bind->command);
struct CommandResult *command_output = parse_command(command_copy);
struct CommandResultIR *command_output = parse_command(command_copy);
free(command_copy);
if (command_output->needs_tree_render)