--- linuxsampler/trunk/src/scriptvm/parser.y 2016/05/16 18:05:52 2910 +++ linuxsampler/trunk/src/scriptvm/parser.y 2016/05/16 20:27:33 2911 @@ -44,7 +44,7 @@ %type script eventhandlers %type eventhandler -%type statements +%type statements body %type statement assignment %type functioncall %type args @@ -72,31 +72,39 @@ } eventhandler: - ON NOTE statements END ON { + ON NOTE body END ON { if (context->onNote) PARSE_ERR(@2, "Redeclaration of 'note' event handler."); context->onNote = new OnNote($3); $$ = context->onNote; } - | ON INIT statements END ON { + | ON INIT body END ON { if (context->onInit) PARSE_ERR(@2, "Redeclaration of 'init' event handler."); context->onInit = new OnInit($3); $$ = context->onInit; } - | ON RELEASE statements END ON { + | ON RELEASE body END ON { if (context->onRelease) PARSE_ERR(@2, "Redeclaration of 'release' event handler."); context->onRelease = new OnRelease($3); $$ = context->onRelease; } - | ON CONTROLLER statements END ON { + | ON CONTROLLER body END ON { if (context->onController) PARSE_ERR(@2, "Redeclaration of 'controller' event handler."); context->onController = new OnController($3); $$ = context->onController; } +body: + /* epsilon (empty argument) */ { + $$ = new Statements(); + } + | statements { + $$ = $1; + } + statements: statement { $$ = new Statements();