From 0313876d88f9eb55c8ed43a9b79787ec17866b05 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 13 Feb 2014 08:49:40 +0100 Subject: [PATCH] allow leaving out if in a top-level if-statement --- components/compiler/scriptparser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/compiler/scriptparser.cpp b/components/compiler/scriptparser.cpp index 1b613595a..f34313969 100644 --- a/components/compiler/scriptparser.cpp +++ b/components/compiler/scriptparser.cpp @@ -71,6 +71,12 @@ namespace Compiler if (code==Scanner::S_newline) // empty line return true; + if (code==Scanner::S_open) /// \todo Option to switch this off + { + scanner.putbackSpecial (code, loc); + return parseKeyword (Scanner::K_if, loc, scanner); + } + mLineParser.reset(); if (mLineParser.parseSpecial (code, loc, scanner)) scanner.scan (mLineParser);