Commit 009b57fe authored by Custom2043's avatar Custom2043
Browse files

Add any token

parent 4bcd84ee
No preview for this file type
...@@ -71,11 +71,11 @@ public class Parser ...@@ -71,11 +71,11 @@ public class Parser
Token t; Token t;
ParserMemory memory = ParserMemory.setLastResult(index, line); ParserMemory memory = ParserMemory.setLastResult(index, line);
mark.currentToken = memory.getToken(); Token currentToken = memory.getToken();
if (memory.getToken() != null) if (memory.getToken() != null)
{ {
//System.out.println("Found : "+mark.token+" at : "+index+" while building "+builder); //System.out.println("Found : "+mark.token+" at : "+index+" while building "+builder);
index = mark.currentToken.getStart() + mark.currentToken.getLength(); index = currentToken.getStart() + currentToken.getLength();
mark(); mark();
} }
...@@ -83,10 +83,10 @@ public class Parser ...@@ -83,10 +83,10 @@ public class Parser
if (lineBuilder.getLine() > memory.getLine()) if (lineBuilder.getLine() > memory.getLine())
if (line == -1 || (lineBuilder.getLine() < line) if (line == -1 || (lineBuilder.getLine() < line)
|| !excluded && lineBuilder.getLine() == line) || !excluded && lineBuilder.getLine() == line)
if ((t = buildToken(lineBuilder, mark.currentToken)) != null) if ((t = buildToken(lineBuilder, currentToken)) != null)
{ {
mark.currentToken = t; currentToken = t;
ParserMemory.addResult(mark.currentToken.getStart(), new ParserMemory(mark.currentToken, lineBuilder.getLine())); ParserMemory.addResult(currentToken.getStart(), new ParserMemory(currentToken, lineBuilder.getLine()));
} }
else if (lineBuilder.getLine() == line && !excluded) else if (lineBuilder.getLine() == line && !excluded)
{ {
...@@ -94,7 +94,7 @@ public class Parser ...@@ -94,7 +94,7 @@ public class Parser
//return null; //return null;
} }
return mark.currentToken; return currentToken;
} }
/** /**
...@@ -247,7 +247,6 @@ public class Parser ...@@ -247,7 +247,6 @@ public class Parser
private static class Mark private static class Mark
{ {
private int markIndex = index; private int markIndex = index;
private Token currentToken = null;
private LinkedList<Integer> submarks = new LinkedList<>(); private LinkedList<Integer> submarks = new LinkedList<>();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment