Bugfix: Fix parsing symbols which contain numbers, like F1 or 1 for bindsym (Thanks Rasi)

This commit is contained in:
Michael Stapelberg
2009-09-29 11:32:57 +02:00
parent 095de9eaab
commit ff0e9bb954
2 changed files with 17 additions and 4 deletions

View File

@ -250,12 +250,12 @@ bind:
;
bindsym:
binding_modifiers WORD WHITESPACE command
binding_modifiers word_or_number WHITESPACE command
{
printf("\tFound symbolic mod%d with key %s and command %s\n", $<number>1, $2, $<string>4);
printf("\tFound symbolic mod%d with key %s and command %s\n", $<number>1, $<string>2, $<string>4);
Binding *new = scalloc(sizeof(Binding));
new->symbol = sstrdup($2);
new->symbol = sstrdup($<string>2);
new->mods = $<number>1;
new->command = sstrdup($<string>4);
@ -263,6 +263,14 @@ bindsym:
}
;
word_or_number:
WORD
| NUMBER
{
asprintf(&$<string>$, "%d", $1);
}
;
mode:
TOKMODE WHITESPACE QUOTEDSTRING WHITESPACE '{' modelines '}'
{