From c7a5d15e7a2e55962e0cb66747f75378728086e9 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 23 Jul 2013 09:44:53 +0100 Subject: [PATCH] Bug 585, assignment to multiple l-values. Disambiguate multiple-values from function invocation. Will merge to release branch after testing. --- simgear/nasal/codegen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simgear/nasal/codegen.c b/simgear/nasal/codegen.c index d8b701b6..fa2ddc22 100644 --- a/simgear/nasal/codegen.c +++ b/simgear/nasal/codegen.c @@ -550,7 +550,10 @@ static void genAssign(struct Parser* p, struct Token* t) if(parListLen(lv) || (lv->type == TOK_VAR && parListLen(RIGHT(lv)))) { if(lv->type == TOK_VAR) { lv = RIGHT(lv); var = 1; } len = parListLen(lv); - if(rv->type == TOK_LPAR) { + // http://code.google.com/p/flightgear-bugs/issues/detail?id=585 + // TOK_LPAR can mean multi-value assignment or function call, + // disambigaute by checking the rule of the token + if(rv->type == TOK_LPAR && rv->rule != PREC_SUFFIX) { if(len != parListLen(rv)) naParseError(p, "bad assignment count", rv->line); genCommaList(p, LEFT(rv)); -- 2.39.5