From d45a0161cf0920d307ebf48cdfb68a7ca90ad193 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 23 Jul 2013 21:51:47 +0100 Subject: [PATCH] Initialise token precedence rule. Thanks to Philosopher for the catch. --- simgear/nasal/lex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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" -- 2.39.5