diff options
author | Orestis Floros <orestisflo@gmail.com> | 2020-05-14 00:37:52 +0200 |
---|---|---|
committer | Orestis Floros <orestisflo@gmail.com> | 2020-05-14 00:40:09 +0200 |
commit | fb2677f5f489bc0ed1adbda5c17abad4057f1445 (patch) | |
tree | 0f75f92b25f4c001a8e95b41fa5bb5d2be5c06c4 /parser-specs | |
parent | 9eb2458b557f42c28d1cee8ef24911b2c4439432 (diff) | |
download | i3-fb2677f5f489bc0ed1adbda5c17abad4057f1445.tar.gz i3-fb2677f5f489bc0ed1adbda5c17abad4057f1445.zip |
cmd_bar: Fix regression with invalid modes
This is another regression from #4014: multiple arrows in a row mean
optional values. Re-introduce new states to force matching & proper
parser errors.
Diffstat (limited to 'parser-specs')
-rw-r--r-- | parser-specs/commands.spec | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/parser-specs/commands.spec b/parser-specs/commands.spec index 22fa4523..de25bdeb 100644 --- a/parser-specs/commands.spec +++ b/parser-specs/commands.spec @@ -454,23 +454,27 @@ state TITLE_FORMAT: # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>] state BAR: - bar_type = 'hidden_state' + 'hidden_state' -> BAR_HIDDEN_STATE - bar_type = 'mode' + 'mode' -> BAR_MODE state BAR_HIDDEN_STATE: - bar_hidden_state = 'hide', 'show', 'toggle' - -> + bar_value = 'hide', 'show', 'toggle' + -> BAR_HIDDEN_STATE_ID + +state BAR_HIDDEN_STATE_ID: bar_id = word -> end - -> call cmd_bar_hidden_state($bar_hidden_state, $bar_id) + -> call cmd_bar_mode($bar_value, $bar_id) state BAR_MODE: bar_value = 'dock', 'hide', 'invisible', 'toggle' - -> + -> BAR_MODE_ID + +state BAR_MODE_ID: bar_id = word -> end - -> call cmd_bar_mode($bar_value, $bar_id) + -> call cmd_bar_hidden_state($bar_value, $bar_id) |