Permalink
Browse files

BugFix: Fix escaped characters in file options ending the file options

- Any escaped character other than '\>' would be recognised as FILE_OPTIONS_END ('>') due to a missing break.
- Code rewrite so it no longer relies on a while(true) where it does not have to.
  • Loading branch information...
Pieter12345 committed Jun 7, 2018
1 parent 9483569 commit e10990ece0e0e9a2e79175a5b43a66fbcfbdfd2f
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/com/laytonsmith/core/MethodScriptCompiler.java
@@ -177,6 +177,7 @@ public static TokenStream lex(String script, File file, boolean inPureMScript, b
i++;
continue;
}
break;
}
case '>': {
if(saveAllTokens) {
@@ -934,15 +935,14 @@ public static TokenStream lex(String script, File file, boolean inPureMScript, b
continue outerLoop;
}
case NEWLINE: {
while(true) {
if(!it.hasNext()) {
break outerLoop;
} else if((token = it.next()).type == TType.NEWLINE) {
while(it.hasNext()) {
if((token = it.next()).type == TType.NEWLINE) {
it.remove(); // Remove duplicate newlines.
} else {
continue outerLoop;
}
}
break outerLoop;
}
default: {
if(!it.hasNext()) {

0 comments on commit e10990e

Please sign in to comment.