Browse code

- documenting the script syntax of the variable declaration - printing an error message if the variable cannot be declared

Miklos Tirpak authored on 24/01/2008 15:57:31
Showing 2 changed files
... ...
@@ -1110,16 +1110,24 @@ assign_stm:
1110 1110
 	;
1111 1111
 cfg_var:
1112 1112
 	ID DOT ID EQUAL NUMBER {
1113
-		cfg_declare_int($1, $3, $5, NULL);
1113
+		if (cfg_declare_int($1, $3, $5, NULL)) {
1114
+			yyerror("variable cannot be declared");
1115
+		}
1114 1116
 	}
1115 1117
 	| ID DOT ID EQUAL STRING {
1116
-		cfg_declare_str($1, $3, $5, NULL);
1118
+		if (cfg_declare_str($1, $3, $5, NULL)) {
1119
+			yyerror("variable cannot be declared");
1120
+		}
1117 1121
 	}
1118 1122
 	| ID DOT ID EQUAL NUMBER CFG_DESCRIPTION STRING {
1119
-		cfg_declare_int($1, $3, $5, $7);
1123
+		if (cfg_declare_int($1, $3, $5, $7)) {
1124
+			yyerror("variable cannot be declared");
1125
+		}
1120 1126
 	}
1121 1127
 	| ID DOT ID EQUAL STRING CFG_DESCRIPTION STRING {
1122
-		cfg_declare_str($1, $3, $5, $7);
1128
+		if (cfg_declare_str($1, $3, $5, $7)) {
1129
+			yyerror("variable cannot be declared");
1130
+		}
1123 1131
 	}
1124 1132
 	| ID DOT ID EQUAL error { yyerror("number or string expected"); }
1125 1133
 	;
... ...
@@ -338,9 +338,13 @@ declare any config variable, because other modules and the core may need the
338 338
 up-to-date config.
339 339
 
340 340
 
341
-6. Accessing the configuration values in the script
341
+6. Configuration values in the script
342 342
 ===============================================================================
343 343
 
344
+New configuration values can be declared in the script, the syntax is:
345
+
346
+<group_name>.<var_name> = <value> [descr <description>]
347
+
344 348
 The values can be accessed via select calls:
345 349
 
346 350
 @cfg_get.<group_name>.<var_name>