From: Dale Weiler Date: Sat, 14 Apr 2012 07:08:15 +0000 (-0400) Subject: Vector test X-Git-Tag: 0.1-rc1~670 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ebe77805eb38e16b43cef6cdec13fa1bf7548f7a;p=xonotic%2Fgmqcc.git Vector test --- diff --git a/parse.c b/parse.c index 3555035..d2c9063 100644 --- a/parse.c +++ b/parse.c @@ -355,7 +355,7 @@ int parse_tree(struct lex_file *file) { } \ if (NAME != 'z') { \ if (token != ',' && token != ' ') { \ - error(ERROR_PARSE, "%s:%d invalid constant initializer element %c for vector (missing spaces, or comma delimited list?)\n", NAME, file->name, file->line); \ + error(ERROR_PARSE, "%s:%d invalid constant initializer element %c for vector (missing spaces, or comma delimited list?)\n", file->name, file->line, NAME); \ } \ } else if (token != '}') { \ error(ERROR_PARSE, "%s:%d Expected `}` on end of constant initialization for vector\n", file->name, file->line); \ @@ -393,7 +393,6 @@ int parse_tree(struct lex_file *file) { case TOKEN_ENTITY: case TOKEN_FLOAT: - if (!isdigit(token)) error(ERROR_PARSE, "%s:%d Expected numeric constant for float constant\n"); break; diff --git a/test/vector.qc b/test/vector.qc new file mode 100644 index 0000000..d74e481 --- /dev/null +++ b/test/vector.qc @@ -0,0 +1,6 @@ +vector vec1 = { -0, +0, 0 }; +vector vec2 = { .0, .0, .0 }; +vector vec3 = { -.0, +.0, +0.1 }; +vector vec4 = { 1.1, 2.2, 3.3 }; +vector vec5 = { 2., 3., 4. }; +vector vec6 = { -2., +3., -4. };