-#line 2 "commands_parser.c"
+#undef I3__FILE__
+#define I3__FILE__ "commands_parser.c"
/*
* vim:ts=4:sw=4:expandtab
*
* input parser-specs/commands.spec.
******************************************************************************/
-#include "GENERATED_enums.h"
+#include "GENERATED_commands_enums.h"
typedef struct token {
char *name;
int n;
} cmdp_token_ptr;
-#include "GENERATED_tokens.h"
+#include "GENERATED_commands_tokens.h"
/*******************************************************************************
* The (small) stack where identified literals are stored during the parsing
static struct CommandResult subcommand_output;
static struct CommandResult command_output;
-#include "GENERATED_call.h"
+#include "GENERATED_commands_call.h"
static void next_state(const cmdp_token *token) {
}
}
-/* TODO: Return parsing errors via JSON. */
struct CommandResult *parse_command(const char *input) {
DLOG("COMMAND: *%s*\n", input);
state = INITIAL;
y(map_open);
ystr("success");
y(bool, false);
+ /* We set parse_error to true to distinguish this from other
+ * errors. i3-nagbar is spawned upon keypresses only for parser
+ * errors. */
+ ystr("parse_error");
+ y(bool, true);
ystr("error");
ystr(errormessage);
ystr("input");