Commit 4bcd84ee authored by Custom2043's avatar Custom2043
Browse files

Add any char

parent 49f37624
......@@ -28,7 +28,7 @@ ignore = {Space|Jump}
SearchName = id:Identifier ":"
LineHeader = [trans:transientToken] id:Identifier equals
TokenSearchToken = ([trans:transientToken] id:Identifier)|string:StringToken
TokenSearchToken = ([trans:transientToken] id:Identifier)|string:StringToken|any:"*"
ArraySearchToken = [{minSize:digit} "-"] arrayOpen [orToken left:SearchToken] {searches:SearchToken} [right:SearchToken orToken] arrayClose ["-" {maxSize:digit}]
OptionalSearchToken = optionOpen {searches:SearchToken} optionClose
BracketSearchToken = exprOpen {searches:SearchToken} exprClose
......
......@@ -63,15 +63,10 @@ public class Parser
* @param tokenBuilder the builder to reach or null to read all lines</br>
* @return the token built or null if the fonction has failed
*/
static Token readUntil(int line, boolean excluded)//TokenBuilder tokenBuilder)
static Token readUntil(int line, boolean excluded)
{
//System.out.println("Searching for : "+tokenBuilder+" from index : "+index);
/*int line = tokenBuilder == null ? -1 : tokenBuilder.getLine();
boolean excluded = tokenBuilder == null ? false : tokenBuilder.isTransient();*/
//if (trans)
//line --;
int oldIndex = index;
Token t;
......@@ -96,7 +91,7 @@ public class Parser
else if (lineBuilder.getLine() == line && !excluded)
{
index = oldIndex;
return null;
//return null;
}
return mark.currentToken;
......
......@@ -28,6 +28,9 @@ public class TokenSearch extends Search
*/
public Result isTokenCorrect(Token token)
{
if (this.builder == null)
return new Result(this, token);
if (this.builder instanceof ParserStringBuilder)
{
if (token == null)
......@@ -52,7 +55,7 @@ public class TokenSearch extends Search
Result temp;
if (!hasCurrent)
{
if (this.fromThisLine)
if (this.fromThisLine || this.builder == null)
current = Parser.readUntil(this.getDeclarationBuilder().getLine(), true);
else
current = Parser.readUntil(this.builder.getLine(), this.builder.isTransient());
......
......@@ -28,7 +28,7 @@ ignore = {Space|Jump}
SearchName = id:Identifier ":"
LineHeader = [trans:transientToken] id:Identifier equals
TokenSearchToken = ([trans:transientToken] id:Identifier)|string:StringToken
TokenSearchToken = ([trans:transientToken] id:Identifier)|string:StringToken|any:"*"
ArraySearchToken = [{minSize:digit} "-"] arrayOpen [orToken left:SearchToken] {searches:SearchToken} [right:SearchToken orToken] arrayClose ["-" {maxSize:digit}]
OptionalSearchToken = optionOpen {searches:SearchToken} optionClose
BracketSearchToken = exprOpen {searches:SearchToken} exprClose
......@@ -38,4 +38,4 @@ OrSearchToken = 2-{searches:#SearchToken orToken|}
Line = header:LineHeader {searchTokens:SearchToken}
anyChar = '*'
anyChar = '*'
\ No newline at end of file
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