mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
Vector test
This commit is contained in:
parent
76a6ad2d96
commit
ebe77805eb
2 changed files with 7 additions and 2 deletions
3
parse.c
3
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;
|
||||
|
|
6
test/vector.qc
Normal file
6
test/vector.qc
Normal file
|
@ -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. };
|
Loading…
Reference in a new issue