Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1ab1a8
commit 4714fb9
Showing
4 changed files
with
39 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/com/denizenscript/denizencore/tags/ParseableTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.denizenscript.denizencore.tags; | ||
|
||
|
||
import com.denizenscript.denizencore.objects.ObjectTag; | ||
import com.denizenscript.denizencore.objects.core.ElementTag; | ||
|
||
import java.util.List; | ||
|
||
public class ParseableTag { | ||
|
||
public ElementTag rawElement; | ||
|
||
public List<TagManager.ParseableTagPiece> pieces; | ||
|
||
public TagManager.ParseableTagPiece singleTag; | ||
|
||
public boolean hasTag; | ||
|
||
public final ObjectTag parse(TagContext context) { | ||
if (rawElement != null) { | ||
return rawElement; | ||
} | ||
else if (singleTag != null) { | ||
return TagManager.readSingleTagObject(singleTag, context); | ||
} | ||
return TagManager.parseChainObject(pieces, context); | ||
} | ||
|
||
public ParseableTag() { | ||
} | ||
|
||
public ParseableTag(String text) { | ||
rawElement = new ElementTag(text, true); | ||
rawElement.isRawInput = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters