summaryrefslogtreecommitdiff
path: root/lily/parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'lily/parser.y')
-rw-r--r--lily/parser.y20
1 files changed, 18 insertions, 2 deletions
diff --git a/lily/parser.y b/lily/parser.y
index fd81c4f08f..7af1f3325d 100644
--- a/lily/parser.y
+++ b/lily/parser.y
@@ -1,6 +1,7 @@
%{ // -*-Fundamental-*-
#include <iostream.h>
+#define MUDELA_VERSION "0.0.50"
#include "script-def.hh"
#include "symtable.hh"
@@ -138,6 +139,7 @@ yylex(YYSTYPE *s, void * v_l)
%token TITLE
%token UNITSPACE
%token WIDTH
+%token VERSION
/* escaped */
%token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
@@ -211,9 +213,23 @@ mudela: /* empty */
}
| mudela add_declaration { }
| mudela error
+ | mudela check_version { }
| mudela add_notenames { }
;
+check_version:
+ VERSION STRING ';' {
+ if (*$2 != MUDELA_VERSION) {
+ if (THIS->ignore_version_b_) {
+ THIS->here_input().error("Incorrect mudela version");
+ } else {
+ THIS->fatal_error_i_ = 1;
+ THIS->parser_error("Incorrect mudela version");
+ }
+ }
+ }
+ ;
+
add_notenames:
NOTENAMES '{' notenames_body '}'
;
@@ -788,8 +804,8 @@ script_definition:
;
script_body:
- STRING int int int {
- $$ = new Script_def(*$1,$2, $3,$4);
+ STRING int int int int {
+ $$ = new Script_def(*$1,$2, $3,$4,$5);
delete $1;
}
;