diff --git a/src/map/script.c b/src/map/script.c index 93418bd018..2b313b896a 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -921,7 +921,7 @@ const char* skip_space(const char* p) } /// Skips a word. -/// A word consists of undercores and/or alfanumeric characters, +/// A word consists of undercores and/or alphanumeric characters, /// and valid variable prefixes/postfixes. static const char* skip_word(const char* p) @@ -964,7 +964,7 @@ int add_word(const char* p) // Check for a word len = skip_word(p) - p; if( len == 0 ) - disp_error_message("script:add_word: invalid word. A word consists of undercores and/or alfanumeric characters, and valid variable prefixes/postfixes.", p); + disp_error_message("script:add_word: invalid word. A word consists of undercores and/or alphanumeric characters, and valid variable prefixes/postfixes.", p); // Duplicate the word word = (char*)aMalloc(len+1); @@ -1000,7 +1000,7 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom) add_scriptl(func); arg = buildin_func[str_data[buildin_callsub_ref].val].arg; if( *arg == 0 ) - disp_error_message("parse_callfunc: callsub has no arguments, please review it's definition",p); + disp_error_message("parse_callfunc: callsub has no arguments, please review its definition",p); if( *arg != '*' ) ++arg; // count func as argument } else { @@ -1241,7 +1241,7 @@ const char* parse_simpleexpr(const char *p) p=skip_space(p); if(*p==';' || *p==',') - disp_error_message("parse_simpleexpr: unexpected expr end",p); + disp_error_message("parse_simpleexpr: unexpected end of expression",p); if(*p=='('){ if( (i=syntax.curly_count-1) >= 0 && syntax.curly[i].type == TYPE_ARGLIST ) ++syntax.curly[i].count; @@ -1257,7 +1257,7 @@ const char* parse_simpleexpr(const char *p) syntax.curly[i].flag = ARGLIST_NO_PAREN; } if( *p != ')' ) - disp_error_message("parse_simpleexpr: unmatch ')'",p); + disp_error_message("parse_simpleexpr: unmatched ')'",p); ++p; } else if(ISDIGIT(*p) || ((*p=='-' || *p=='+') && ISDIGIT(p[1]))){ char *np; @@ -1323,7 +1323,7 @@ const char* parse_simpleexpr(const char *p) p=parse_subexpr(p+1,-1); p=skip_space(p); if( *p != ']' ) - disp_error_message("parse_simpleexpr: unmatch ']'",p); + disp_error_message("parse_simpleexpr: unmatched ']'",p); ++p; add_scriptc(C_FUNC); }else @@ -1384,7 +1384,7 @@ const char* parse_subexpr(const char* p,int limit) p=parse_subexpr(p,-1); p=skip_space(p); if( *(p++) != ':') - disp_error_message("parse_subexpr: need ':'", p-1); + disp_error_message("parse_subexpr: expected ':'", p-1); p=parse_subexpr(p,-1); } else { p=parse_subexpr(p,opl); @@ -1404,7 +1404,7 @@ const char* parse_expr(const char *p) switch(*p){ case ')': case ';': case ':': case '[': case ']': case '}': - disp_error_message("parse_expr: unexpected char",p); + disp_error_message("parse_expr: unexpected character",p); } p=parse_subexpr(p,-1); return p; @@ -1455,10 +1455,10 @@ const char* parse_line(const char* p) if(parse_syntax_for_flag) { if( *p != ')' ) - disp_error_message("parse_line: need ')'",p); + disp_error_message("parse_line: expected ')'",p); } else { if( *p != ';' ) - disp_error_message("parse_line: need ';'",p); + disp_error_message("parse_line: expected ';'",p); } //Binding decision for if(), for(), while() @@ -1562,7 +1562,7 @@ const char* parse_syntax(const char* p) } p = skip_space(p2); if(*p != ';') - disp_error_message("parse_syntax: need ';'",p); + disp_error_message("parse_syntax: expected ';'",p); // Closing decision if, for , while p = parse_syntax_close(p + 1); return p; @@ -1595,7 +1595,7 @@ const char* parse_syntax(const char* p) //Decision statement switch p = skip_space(p2); if(p == p2) { - disp_error_message("parse_syntax: expect space ' '",p); + disp_error_message("parse_syntax: expected a space ' '",p); } // check whether case label is integer or not v = strtol(p,&np,0); @@ -1605,14 +1605,14 @@ const char* parse_syntax(const char* p) memcpy(label,p,v); label[v]='\0'; if( !script_get_constant(label, &v) ) - disp_error_message("parse_syntax: 'case' label not integer",p); + disp_error_message("parse_syntax: 'case' label is not an integer",p); p = skip_word(p); } else { //Numeric value if((*p == '-' || *p == '+') && ISDIGIT(p[1])) // pre-skip because '-' can not skip_word p++; p = skip_word(p); if(np != p) - disp_error_message("parse_syntax: 'case' label not integer",np); + disp_error_message("parse_syntax: 'case' label is not an integer",np); } p = skip_space(p); if(*p != ':') @@ -1670,7 +1670,7 @@ const char* parse_syntax(const char* p) } p = skip_space(p2); if(*p != ';') - disp_error_message("parse_syntax: need ';'",p); + disp_error_message("parse_syntax: expected ';'",p); //Closing decision if, for , while p = parse_syntax_close(p + 1); return p; @@ -1691,7 +1691,7 @@ const char* parse_syntax(const char* p) // Put the label location p = skip_space(p2); if(*p != ':') { - disp_error_message("parse_syntax: need ':'",p); + disp_error_message("parse_syntax: expected ':'",p); } sprintf(label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); l=add_str(label); @@ -1744,7 +1744,7 @@ const char* parse_syntax(const char* p) p=skip_space(p2); if(*p != '(') - disp_error_message("parse_syntax: need '('",p); + disp_error_message("parse_syntax: expected '('",p); p++; // Execute the initialization statement @@ -1772,7 +1772,7 @@ const char* parse_syntax(const char* p) add_scriptc(C_FUNC); } if(*p != ';') - disp_error_message("parse_syntax: need ';'",p); + disp_error_message("parse_syntax: expected ';'",p); p++; // Skip to the beginning of the loop @@ -1914,7 +1914,7 @@ const char* parse_syntax(const char* p) p=parse_expr(p); p=skip_space(p); if(*p != '{') { - disp_error_message("parse_syntax: need '{'",p); + disp_error_message("parse_syntax: expected '{'",p); } add_scriptc(C_FUNC); return p + 1; @@ -2053,7 +2053,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag) p = skip_space(p); p2 = skip_word(p); if(p2 - p != 5 || strncasecmp(p,"while",5)) - disp_error_message("parse_syntax: need 'while'",p); + disp_error_message("parse_syntax: expected 'while'",p); p = skip_space(p2); if(*p != '(') { @@ -2083,7 +2083,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag) set_label(l,script_pos,p); p = skip_space(p); if(*p != ';') { - disp_error_message("parse_syntax: need ';'",p); + disp_error_message("parse_syntax: expected ';'",p); return p+1; } p++; @@ -14500,7 +14500,7 @@ BUILDIN_FUNC(setnpcdisplay) class_ = conv_num(st,data); else { - ShowError("script:setnpcdisplay: expected a string or number\n"); + ShowError("script:setnpcdisplay: expected string or number\n"); script_reportdata(data); return 1; }