X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=parser.c;h=3c29399d203f1ff5fc55caafda7b3eee11984e18;hp=ea9e000590cdef71d2f9f667744697c0cd8783e1;hb=64661f54ea4b13657301a975db10aeff6245610f;hpb=69252071ba7de94acba4c994ed8c537d03bd937a diff --git a/parser.c b/parser.c index ea9e000..3c29399 100644 --- a/parser.c +++ b/parser.c @@ -762,6 +762,22 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy) } break; + case opid2('>', '<'): + if (NotSameType(TYPE_VECTOR)) { + ast_type_to_string(exprs[0], ty1, sizeof(ty1)); + ast_type_to_string(exprs[1], ty2, sizeof(ty2)); + compile_error(ctx, "invalid types used in cross product: %s and %s", + ty1, ty2); + return false; + } + + if (!(out = fold_op(parser->fold, op, exprs))) { + compile_error(ctx, "cross product for non-constant vectors unimplemented"); + return false; + } + + break; + case opid3('<','=','>'): /* -1, 0, or 1 */ if (NotSameType(TYPE_FLOAT)) { ast_type_to_string(exprs[0], ty1, sizeof(ty1));