Commit 359b0e9e authored by Custom2043's avatar Custom2043
Browse files

Fix any and none ParserCharacter

parent 0e2d62e3
No preview for this file type
quote = "\""
singleQuote = "\'"
backslash = "\\"
anyCharToken = "\*"
#NumberChar = "0" (base:"b" {value:'0-1'})|(base:"x" {value:'0-9|A-F'})|(base:"d" {value:digit})
#SingleChar = (backslash backslash:("b"|"r"|"t"|"n"|backslash|anyCharToken|quote|singleQuote)) | anyChar | anyCharToken
#SingleChar = (backslash backslash:("b"|"r"|"t"|"n"|backslash|quote|singleQuote)) | anyChar
CharacterToken = singleQuote [notToken:notToken] {|orToken character1:(NumberChar|SingleChar) ["-" character2:(NumberChar|SingleChar)]} singleQuote
StringToken = (quote {charTokens:(CharacterToken | SingleChar)} quote) | singleChar:CharacterToken
......@@ -39,4 +38,4 @@ OrSearchToken = 2-{searches:#SearchToken orToken|}
Line = header:LineHeader {namedSearches:SearchToken}
anyChar = "*"
anyChar = '*'
......@@ -7,7 +7,7 @@ public class ParserString extends Token
public static final ParserStringBuilder quote = new ParserStringBuilder(false, 0, 0),
singleQuote = new ParserStringBuilder(false, 1, 1),
backslash = new ParserStringBuilder(false, 2, 2),
anyCharToken = new ParserStringBuilder(false, 3, 3),
anyCharToken = new ParserStringBuilder(true, 3, 3),
trans0 = new ParserStringBuilder(true, 4, 4),
trans1 = new ParserStringBuilder(true, 4, 5),
trans2 = new ParserStringBuilder(true, 4, 6),
......
......@@ -14,7 +14,6 @@ public abstract class Token
ParserString.quote,
ParserString.singleQuote,
ParserString.backslash,
ParserString.anyCharToken,
ParserString.orToken,
CharacterToken.builder,
StringToken.builder,
......
......@@ -52,6 +52,9 @@ public class CharacterToken extends Token
public ParserCharacter toParserCharacter()
{
if (this.character1.length == 1 && this.character1[0].total.equals("*") && this.character2[0] == null)
return this.notToken == null ? ParserCharacter.any : ParserCharacter.none;
char[] start = new char[this.character1.length], end = new char[this.character1.length];
for (int i=0;i<start.length;i++)
{
......
......@@ -48,8 +48,8 @@ public class SingleChar extends Token
)
),
new OrSearch(
new TokenSearch(ParserString.anyChar),
new TokenSearch(ParserString.anyCharToken)
new TokenSearch(ParserString.anyChar)
//new TokenSearch(ParserString.anyCharToken)
)
)
};
......
Supports Markdown
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