Commit afd136e9 authored by Custom2043's avatar Custom2043
Browse files

fix++

parent a6e30a36
...@@ -7,13 +7,7 @@ import java.util.List; ...@@ -7,13 +7,7 @@ import java.util.List;
import parser.ParserString; import parser.ParserString;
import parser.Token; import parser.Token;
import tokens.ArraySearchToken; import tokens.*;
import tokens.Line;
import tokens.MultipleSearchToken;
import tokens.OrSearchToken;
import tokens.SearchToken;
import tokens.Space;
import tokens.TokenSearchToken;
public class Compiler public class Compiler
{ {
...@@ -63,10 +57,7 @@ public class Compiler ...@@ -63,10 +57,7 @@ public class Compiler
{ {
if (t instanceof ParserString && ((ParserString)t).index == ParserString.anyChar.getIndex()) if (t instanceof ParserString && ((ParserString)t).index == ParserString.anyChar.getIndex())
report(new Info(InfoModel.invalidChar, t)); report(new Info(InfoModel.invalidChar, t));
else if (!(t instanceof Line || t instanceof Space || t instanceof LineJump)) else if (t instanceof Line)
report(new Info(InfoModel.syntaxError, t));
else
{ {
for (Line l : lines) for (Line l : lines)
if (!l.header.id.getName().equals("ignore") && l.header.id.getName().equals(((Line)t).header.id.getName())) if (!l.header.id.getName().equals("ignore") && l.header.id.getName().equals(((Line)t).header.id.getName()))
...@@ -85,6 +76,8 @@ public class Compiler ...@@ -85,6 +76,8 @@ public class Compiler
lines.add((Line)t); lines.add((Line)t);
} }
else if (!(t instanceof Space || t instanceof Jump))
report(new Info(InfoModel.syntaxError, t));
enabled = t instanceof Line; enabled = t instanceof Line;
} }
......
...@@ -36,7 +36,6 @@ public class TokenBuilder extends Builder ...@@ -36,7 +36,6 @@ public class TokenBuilder extends Builder
else else
{ {
List<Search> s = addIgnores(this.ignore, this.searches); List<Search> s = addIgnores(this.ignore, this.searches);
//s.add(this.ignore.getRealSearch());
this.searchesWithIgnore = s.toArray(new Search[s.size()]); this.searchesWithIgnore = s.toArray(new Search[s.size()]);
} }
} }
......
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