diff --git a/src/org/nwapw/abacus/lexing/pattern/Pattern.java b/src/org/nwapw/abacus/lexing/pattern/Pattern.java index 860e036..4d40d77 100644 --- a/src/org/nwapw/abacus/lexing/pattern/Pattern.java +++ b/src/org/nwapw/abacus/lexing/pattern/Pattern.java @@ -111,6 +111,7 @@ public class Pattern { orChain.push(fullChain); currentChain = null; fullChain = new PatternChain<>(); + if(++index >= source.length()) return null; } else if(currentChar == '('){ if(currentChain != null) { fullChain.append(currentChain);