From 375d426dd0e87173c668b9abea0f5f958ebc3989 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 15 Jan 2015 11:35:17 +0100 Subject: [PATCH] check for premature end of scripts more consistently --- components/compiler/scanner.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/components/compiler/scanner.cpp b/components/compiler/scanner.cpp index 14ab99c21..83d435962 100644 --- a/components/compiler/scanner.cpp +++ b/components/compiler/scanner.cpp @@ -387,10 +387,9 @@ namespace Compiler if (get (c)) { /// \todo hack to allow a space in comparison operators (add option to disable) - if (c==' ') - get (c); - - if (c=='=') + if (c==' ' && !get (c)) + special = S_cmpEQ; + else if (c=='=') special = S_cmpEQ; else { @@ -471,10 +470,9 @@ namespace Compiler if (get (c)) { /// \todo hack to allow a space in comparison operators (add option to disable) - if (c==' ') - get (c); - - if (c=='=') + if (c==' ' && !get (c)) + special = S_cmpLT; + else if (c=='=') { special = S_cmpLE; @@ -495,10 +493,9 @@ namespace Compiler if (get (c)) { /// \todo hack to allow a space in comparison operators (add option to disable) - if (c==' ') - get (c); - - if (c=='=') + if (c==' ' && !get (c)) + special = S_cmpGT; + else if (c=='=') { special = S_cmpGE;