From 749136bf3394df4498eb1f672313124b3365c1cc Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 12 Feb 2014 20:23:47 +0100 Subject: [PATCH] ignore attempts to set non-existing variables --- components/compiler/lineparser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index e435b936c..495e7e25e 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -219,6 +219,14 @@ namespace Compiler bool LineParser::parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner) { + if (mState==SetPotentialMemberVarState && keyword==Scanner::K_to) + { + getErrorHandler().warning ("unknown variable (ignoring set instruction)", loc); + SkipParser skip (getErrorHandler(), getContext()); + scanner.scan (skip); + return false; + } + if (mState==SetState) { // allow keywords to be used as variable names when assigning a value to a variable.