Removed the (unused) 'required' flag from simple keys (the parser should take care of this, not the scanner).

This commit is contained in:
beder
2008-07-08 18:34:26 +00:00
parent 5d5651861d
commit 84bcdda342
3 changed files with 17 additions and 7 deletions

View File

@@ -45,7 +45,6 @@ namespace YAML
void Invalidate(); void Invalidate();
int pos, line, column, flowLevel; int pos, line, column, flowLevel;
bool required;
Token *pMapStart, *pKey; Token *pMapStart, *pKey;
}; };

View File

@@ -6,7 +6,7 @@
namespace YAML namespace YAML
{ {
Scanner::SimpleKey::SimpleKey(int pos_, int line_, int column_, int flowLevel_) Scanner::SimpleKey::SimpleKey(int pos_, int line_, int column_, int flowLevel_)
: pos(pos_), line(line_), column(column_), flowLevel(flowLevel_), required(false), pMapStart(0), pKey(0) : pos(pos_), line(line_), column(column_), flowLevel(flowLevel_), pMapStart(0), pKey(0)
{ {
} }
@@ -20,9 +20,6 @@ namespace YAML
void Scanner::SimpleKey::Invalidate() void Scanner::SimpleKey::Invalidate()
{ {
if(required)
throw ParserException(line, column, "required simple key not found");
if(pMapStart) if(pMapStart)
pMapStart->status = TS_INVALID; pMapStart->status = TS_INVALID;
if(pKey) if(pKey)
@@ -40,8 +37,6 @@ namespace YAML
key.pMapStart = PushIndentTo(INPUT.column, false); key.pMapStart = PushIndentTo(INPUT.column, false);
if(key.pMapStart) if(key.pMapStart)
key.pMapStart->status = TS_UNVERIFIED; key.pMapStart->status = TS_UNVERIFIED;
// else
// key.required = true; // TODO: is this correct?
// then add the (now unverified) key // then add the (now unverified) key
key.pKey = new Token(TT_KEY, INPUT.line, INPUT.column); key.pKey = new Token(TT_KEY, INPUT.line, INPUT.column);

View File

@@ -329,6 +329,22 @@
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
> >
<File
RelativePath=".\tests\directives.yaml"
>
</File>
<File
RelativePath=".\tests\mixed.yaml"
>
</File>
<File
RelativePath=".\tests\scalars.yaml"
>
</File>
<File
RelativePath=".\tests\simple.yaml"
>
</File>
<File <File
RelativePath=".\test.yaml" RelativePath=".\test.yaml"
> >