From 79a4e304888f2ddaf84be34ff138cc571d057e38 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 13 Feb 2010 15:27:43 +0100 Subject: [PATCH] parser: enable verbose error messages, add aliases to tokens --- src/cfgparse.y | 53 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/cfgparse.y b/src/cfgparse.y index 6b458e2c..1ce75724 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -161,6 +161,7 @@ void parse_file(const char *f) { %} %expect 1 +%error-verbose %union { int number; @@ -170,36 +171,36 @@ void parse_file(const char *f) { struct Binding *binding; } -%token NUMBER -%token WORD -%token STR -%token STR_NG -%token HEX +%token NUMBER "" +%token WORD "" +%token STR "" +%token STR_NG "" +%token HEX "" %token TOKBIND %token TOKTERMINAL -%token TOKCOMMENT -%token TOKFONT -%token TOKBINDSYM -%token MODIFIER -%token TOKCONTROL -%token TOKSHIFT -%token WHITESPACE -%token TOKFLOATING_MODIFIER -%token QUOTEDSTRING -%token TOKWORKSPACE -%token TOKSCREEN -%token TOKASSIGN +%token TOKCOMMENT "" +%token TOKFONT "font" +%token TOKBINDSYM "bindsym" +%token MODIFIER "" +%token TOKCONTROL "control" +%token TOKSHIFT "shift" +%token WHITESPACE "" +%token TOKFLOATING_MODIFIER "floating_modifier" +%token QUOTEDSTRING "" +%token TOKWORKSPACE "workspace" +%token TOKSCREEN "screen" +%token TOKASSIGN "assign" %token TOKSET -%token TOKIPCSOCKET -%token TOKEXEC +%token TOKIPCSOCKET "ipc_socket" +%token TOKEXEC "exec" %token TOKCOLOR -%token TOKARROW -%token TOKMODE -%token TOKNEWCONTAINER -%token TOKNEWWINDOW -%token TOKFOCUSFOLLOWSMOUSE -%token TOKCONTAINERMODE -%token TOKSTACKLIMIT +%token TOKARROW "→" +%token TOKMODE "mode" +%token TOKNEWCONTAINER "new_container" +%token TOKNEWWINDOW "new_window" +%token TOKFOCUSFOLLOWSMOUSE "focus_follows_mouse" +%token TOKCONTAINERMODE "default/stacking/tabbed" +%token TOKSTACKLIMIT "stack-limit" %% -- 2.39.5