mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Add simple support for tags in YAML I/O
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -81,6 +81,16 @@ bool Input::setCurrentDocument() {
|
||||
void Input::nextDocument() {
|
||||
++DocIterator;
|
||||
}
|
||||
|
||||
bool Input::mapTag(StringRef Tag, bool Default) {
|
||||
StringRef foundTag = CurrentNode->_node->getVerbatimTag();
|
||||
if (foundTag.empty()) {
|
||||
// If no tag found and 'Tag' is the default, say it was found.
|
||||
return Default;
|
||||
}
|
||||
// Return true iff found tag matches supplied tag.
|
||||
return Tag.equals(foundTag);
|
||||
}
|
||||
|
||||
void Input::beginMapping() {
|
||||
if (EC)
|
||||
@@ -381,6 +391,14 @@ void Output::beginMapping() {
|
||||
NeedsNewLine = true;
|
||||
}
|
||||
|
||||
bool Output::mapTag(StringRef Tag, bool Use) {
|
||||
if (Use) {
|
||||
this->output(" ");
|
||||
this->output(Tag);
|
||||
}
|
||||
return Use;
|
||||
}
|
||||
|
||||
void Output::endMapping() {
|
||||
StateStack.pop_back();
|
||||
}
|
||||
|
Reference in New Issue
Block a user