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.
This commit is contained in:
Orestis Floros 2020-05-14 00:37:52 +02:00
parent 9eb2458b55
commit fb2677f5f4
No known key found for this signature in database
GPG Key ID: A09DBD7D3222C1C3

View File

@ -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_id = word
->
end
-> call cmd_bar_hidden_state($bar_hidden_state, $bar_id)
bar_value = 'hide', 'show', 'toggle'
-> BAR_HIDDEN_STATE_ID
state BAR_MODE:
bar_value = 'dock', 'hide', 'invisible', 'toggle'
->
state BAR_HIDDEN_STATE_ID:
bar_id = word
->
end
-> 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_hidden_state($bar_value, $bar_id)