From: James Turner Date: Tue, 23 Jul 2013 20:51:47 +0000 (+0100) Subject: Initialise token precedence rule. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d45a0161cf0920d307ebf48cdfb68a7ca90ad193;p=simgear.git Initialise token precedence rule. Thanks to Philosopher for the catch. --- diff --git a/simgear/nasal/lex.c b/simgear/nasal/lex.c index 89c3c407..b0dcf5f3 100644 --- a/simgear/nasal/lex.c +++ b/simgear/nasal/lex.c @@ -134,7 +134,8 @@ static void newToken(struct Parser* p, int pos, int type, tok->prev = last; tok->children = 0; tok->lastChild = 0; - + tok->rule = 0; + // Context sensitivity hack: a "-" following a binary operator of // equal or higher precedence must be a unary negation. Needed to // get precedence right in the parser for expressiong like "a * -2"