Repository: sjbarag/brs (js)

Issue:
Parse error for upper case #ELSE IF and #END IF
![image](https://user-images.githubusercontent.com/2544493/80802532-937f7c80-8b7d-11ea-9746-974e6da8d76d.png)

![image](https://user-images.githubusercontent.com/2544493/80802540-967a6d00-8b7d-11ea-989e-bd2b441f4d4c.png)


Pull request description:
Fix lex issue with `#ELSE IF` and `#END IF`
Fixes #403 

Patch:
diff --git a/src/lexer/Lexer.ts b/src/lexer/Lexer.ts
index c302a35..88b0de2 100644
--- a/src/lexer/Lexer.ts
+++ b/src/lexer/Lexer.ts
@@ -692,7 +692,7 @@ export class Lexer {
                     advance();
                 } // read the next word
 
-                let twoWords = source.slice(start, current);
+                let twoWords = source.slice(start, current).toLowerCase();
                 switch (twoWords.replace(/ {2,}/g, " ")) {
                     case "#else if":
                         addToken(Lexeme.HashElseIf);


Test patch:
diff --git a/test/lexer/Lexer.test.js b/test/lexer/Lexer.test.js
index b4d290c..cb9fcd2 100644
--- a/test/lexer/Lexer.test.js
+++ b/test/lexer/Lexer.test.js
@@ -341,8 +341,16 @@ describe("lexer", () => {
         });
 
         it("reads conditional directives", () => {
-            let { tokens } = Lexer.scan("#if #else if #elseif #else #end if #endif");
+            let { tokens } = Lexer.scan(
+                "#if #else if #elseif #else #end if #endif #IF #ELSE IF #ELSEIF #ELSE #END IF #ENDIF"
+            );
             expect(tokens.map(t => t.kind)).toEqual([
+                Lexeme.HashIf,
+                Lexeme.HashElseIf,
+                Lexeme.HashElseIf,
+                Lexeme.HashElse,
+                Lexeme.HashEndIf,
+                Lexeme.HashEndIf,
                 Lexeme.HashIf,
                 Lexeme.HashElseIf,
                 Lexeme.HashElseIf,