Parse errors are thosue caught by MudOS when it is 'compiling'
your room/object/weapon/whatever it is that you made.

Below are the common parse errors and how to solve them.

Thanks to Snoop for the log of errors to use :)


The next few errors are all generic parse errors, and can have Many differant causes, here are the most common.
1 inherit ROOM; 2 3 void setup() 4 { 5 set_brief("workroom"); 6 set_long("Zifnab's workroom") 7 } ERROR: ## ------- /wiz/zifnab/workroom.c:7 ## parse error ## } ## ^ CAUSE: missing ; on line 6 FIX: add the missing ; on line 6
1 inherit ROOM; 2 3 void setup() 4 { 5 set_brief("workroom"); 6 set_long("Zifnab's workroom") 7 set_exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); 8 } ERROR: ## ------- /wiz/zifnab/workroom.c:7 ## parse error ## set_exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); ## ^ CAUSE: missing ; on line 6 FIX: add the missing ; on line 6
1 inherit ROOM; 2 3 void setup() 4 { 5 set_brief("workroom"); 6 set_long("Zifnab's workroom"); 7 set_exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); ERROR: ## ------- /wiz/zifnab/workroom.c:8 ## parse error CAUSE: Notice the line number for this error, it is line 8, one line more than is actually in our file. This is caused by a missing } FIX: Add the closing } after line 7
1 inherit ROOM; 2 3 void setup() 4 { 5 set_brief("workroom"); 6 set_long("Zifnab's workroom"); 7 set_exits( ([ "adv" , "/domains/city/advguild/adv" ]) ); 8 } ERROR: ## ------- /wiz/zifnab/workroom.c:7 ## parse error ## set_exits( ([ "adv" , "/domains/city/advguild/adv" ]) ); ## ^ CAUSE: This error is caused by a , in the exit string instead of a : FIX: Change the , in line 7 to a :
The above 3 examples are all very generic, the only message you get is 'parse error'. Most errors of this nature are due to left off brackets, ", commas, ; etc. Lets move on to some more specific types of errors.
1 inherit ROOM; 2 3 void setup() 4 { 5 set_brief("workroom"); 6 set_long("Zifnab's workroom"); 7 set_exits( ([ "adv" : "/domains/city/advguild/adv ]) ); 8 } ERROR: ## ------- /wiz/zifnab/workroom.c:9 ## End of file in string at the end of the file ## ------- /wiz/zifnab/workroom.c:9 ## parse error at the end of the file CAUSE: You will notice that we actually received 2 error messages on this one both for the same line. This error message seems a little cryptic however, what it is saying is that you started a string with ", and no closing " was found and the end of the file was reached. FIX: Find the string that is missing the closing ". In this case it is line 7 that is missing a " on the end of the path for the exit.
1 inherit ROOM; 2 3 void setup() 4 { 5 set_brief("workroom"); 6 set_long("Zifnab's workroom); 7 set_exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); 8 } ERROR: ## ------- /wiz/zifnab/workroom.c:7 ## parse error ## set_exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); ## ^ ## ------- /wiz/zifnab/workroom.c:9 ## End of file in string at the end of the file CAUSE: We again received 2 error messages, though this time its slightly differant, the cause is the same, somewhere there is a string in the file that does not have a terminating ". FIX: Add a " on line 6 after workroom
1 inherit ROOM; 2 3 setup() 4 { 5 set_brief("workroom"); 6 set_long("Zifnab's workroom"); 7 set_exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); 8 } ERROR: ## ------- /wiz/zifnab/workroom.c:3 ## "#pragma strict_types" requires type of function ## setup() ## ^ CAUSE: Functions require a return type to be specified. FIX: void setup() on line 3 (add void), this tells the driver that you will not be returning anything.
1 inherit ROOM; 2 3 void setup() 4 { 5 set_brief("workroom"); 6 set_long("Zifnab's workroom"); 7 set exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); 8 } ERROR: ## ------- /wiz/zifnab/workroom.c:7 ## Undefined variable 'set' ## set exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); ## ^ ## ------- /wiz/zifnab/workroom.c:7 ## parse error ## set exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); ## ^ CAUSE: The driver thinks you have tried to use a variable before defining that variable. Notice the space between set and exits. FIX: Add the missing _ between set and exits.
The following code doesn't make any sense, and you wouldn't do this but it serves to show the error
1 inherit ROOM; 2 3 void setup() 4 { 5 string str = "zifnab"; 6 set_brief("workroom"); 7 set_long("Zifnab's workroom"); 8 set_exits( ([ "adv" : "/domains/city/advguild/adv" ]) ); 9 10 11 filter_array( bodies(), (: $1->query_userid() == str :) ); 12 } ERROR: ## ------- /wiz/zifnab/workroom.c:11 ## Illegal to use local variable in functional. ## filter_array( bodies(), (: $1->query_userid() == str :) ); ## ^ CAUSE: Using a local defined variable inside of a function pointer in this case str is defined on line 5, and used in the function pointer on line 11 FIX: change line 11 to use $(str) instead of str in the function pointer
-