From 13ddf545d973ecb910973d22399a3a6c01339be8 Mon Sep 17 00:00:00 2001
From: Stuffed <stuffedgames@gmail.com>
Date: Thu, 4 May 2017 23:53:06 +0900
Subject: [PATCH] Add check for <<set foo == 4>>

---
 sanityCheck | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sanityCheck b/sanityCheck
index 1563ed06ad6..45705bc8e15 100755
--- a/sanityCheck
+++ b/sanityCheck
@@ -21,7 +21,7 @@ GREP="git grep -n --color"
 $GREP "<</[^>]*>[^>]" -- 'src/*'  | myprint "MissingClosingAngleBracket"
 $GREP "<<[^>()]*>[^()<>"$'\r]*\r'"\?$" -- 'src/*' | myprint "MissingClosingAngleBracket"
 # Check for missing left angle bracket: </if>>
-$GREP "[^<]</[^<>]*>>" -- 'src/*' | myprint "MissingOpeningAngleBracket2"
+$GREP "\([^<]\|^\)</\?\(if\|else\|case\)" -- 'src/*' | myprint "MissingOpeningAngleBracket2"
 # Check for accidental assignment.  e.g.:   <<if $foo = "hello">>
 $GREP "<<[ ]*if[^>=]*[^><\!=]=[^=][^>]*>>" -- 'src/*' | myprint "AccidentalAssignmentInIf"
 # Check for missing ".  e.g.:   <<if $foo = "hello>>
@@ -63,6 +63,8 @@ $GREP "=to" -- 'src/*' | myprint "EqualAndTo"
 $GREP -e "[$]slaves[.]"  --and --not -e '[$]slaves[.]\(length\|random\|map\|filter\|deleteAt\|push\)' -- 'src/*' | myprint "MissingSlavesIndex"
 # Try to check for accidentally mixing slaves[] and activeSlave.  This can have a lot of false matches, but has caught a lot of bugs so it's worth the pain
 $GREP -e "activeSlave[.]" --and -e "slaves\[..\?\][.]" --and --not -e '[.]ID' --and --not -e 'slaves\[..\?\][.]\(slaveName\|actualAge\|relation\|assignment\|age\|devotion\|trust\|vagina\)' -- 'src/*' | myprint "MaybeAccidentalMixingOfSlavesAndActiveSlave"
+# Check, e.g.  <<set foo == 4>>
+$GREP "<<set[^{>=]*==" -- 'src/*' | myprint "DoubleEqualsInSet"
 
 # Check that we do not have any variables that we use only once.   e.g.     $onlyUsedOnce
 (
-- 
GitLab