From 18e8d6d786d52500dee7263f13af40595040c4a4 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 15 May 2003 02:23:32 +0000 Subject: [PATCH] Allow zero or more actions in an action list, rather than requiring one or more actions in the list. This makes constructs like: attach 10 { // echo "Driver $device_name attached" }; to be accepted by the parser. It will be treated as if the user had entered: // attach 10 { // echo "Driver $device_name attached" // }; (eg totally ignored). Approved by: re@ (rwatson) --- sbin/devd/parse.y | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/devd/parse.y b/sbin/devd/parse.y index 4a8f4dd5b75d..cfc93138d24e 100644 --- a/sbin/devd/parse.y +++ b/sbin/devd/parse.y @@ -100,16 +100,19 @@ set_option attach_block : ATTACH NUMBER BEGINBLOCK match_or_action_list ENDBLOCK SEMICOLON { add_attach($2, $4); } + | ATTACH NUMBER BEGINBLOCK ENDBLOCK SEMICOLON ; detach_block : DETACH NUMBER BEGINBLOCK match_or_action_list ENDBLOCK SEMICOLON { add_detach($2, $4); } + | DETACH NUMBER BEGINBLOCK ENDBLOCK SEMICOLON ; nomatch_block : NOMATCH NUMBER BEGINBLOCK match_or_action_list ENDBLOCK SEMICOLON { add_nomatch($2, $4); } + | NOMATCH NUMBER BEGINBLOCK ENDBLOCK SEMICOLON ; match_or_action_list