mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
This commit is contained in:
parent
2e27c5d9c3
commit
d076252dff
6 changed files with 74 additions and 104 deletions
|
@ -191,6 +191,36 @@ namespace YAML
|
|||
return pToken;
|
||||
}
|
||||
|
||||
// AnchorToken
|
||||
template <> AnchorToken *Scanner::ScanToken(AnchorToken *pToken)
|
||||
{
|
||||
// insert a potential simple key
|
||||
if(m_simpleKeyAllowed)
|
||||
InsertSimpleKey();
|
||||
m_simpleKeyAllowed = false;
|
||||
|
||||
// eat the indicator
|
||||
char indicator = GetChar();
|
||||
pToken->alias = (indicator == Keys::Alias);
|
||||
|
||||
// now eat the content
|
||||
std::string tag;
|
||||
while(Exp::AlphaNumeric.Matches(INPUT))
|
||||
tag += GetChar();
|
||||
|
||||
// we need to have read SOMETHING!
|
||||
if(tag.empty())
|
||||
throw AnchorNotFound();
|
||||
|
||||
// and needs to end correctly
|
||||
if(INPUT.peek() != EOF && !Exp::AnchorEnd.Matches(INPUT))
|
||||
throw IllegalCharacterInAnchor();
|
||||
|
||||
// and we're done
|
||||
pToken->value = tag;
|
||||
return pToken;
|
||||
}
|
||||
|
||||
// PlainScalarToken
|
||||
// . We scan these in passes of two steps each: First, grab all non-whitespace
|
||||
// characters we can, and then grab all whitespace characters we can.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue