Commit 31f7db5a by Jesse Beder

More simple scalar scanning.

parent a3961d04
...@@ -36,8 +36,9 @@ namespace YAML ...@@ -36,8 +36,9 @@ namespace YAML
try { try {
scanner.Scan(); scanner.Scan();
} catch(const UnknownToken& e) { } catch(const Exception& e) {
} }
getchar();
// if(!scanner) // if(!scanner)
// return; // return;
......
...@@ -11,4 +11,5 @@ namespace YAML ...@@ -11,4 +11,5 @@ namespace YAML
class IllegalMapKey: public Exception {}; class IllegalMapKey: public Exception {};
class IllegalMapValue: public Exception {}; class IllegalMapValue: public Exception {};
class IllegalScalar: public Exception {}; class IllegalScalar: public Exception {};
class IllegalTabInScalar: public Exception {};
} }
...@@ -43,13 +43,14 @@ namespace YAML ...@@ -43,13 +43,14 @@ namespace YAML
private: private:
char GetChar(); char GetChar();
void Eat(int n = 1);
std::string Peek(int n);
void EatLineBreak(); void EatLineBreak();
void EatDocumentStart();
void EatDocumentEnd();
bool IsWhitespaceToBeEaten(); bool IsWhitespaceToBeEaten(char ch);
bool IsLineBreak(); bool IsLineBreak(char ch);
bool IsBlank(); bool IsBlank(char ch);
bool IsDocumentStart(); bool IsDocumentStart();
bool IsDocumentEnd(); bool IsDocumentEnd();
bool IsBlockEntry(); bool IsBlockEntry();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace YAML namespace YAML
{ {
class Token {}; class Token { public: virtual ~Token() {} };
class StreamStartToken: public Token {}; class StreamStartToken: public Token {};
class StreamEndToken: public Token {}; class StreamEndToken: public Token {};
......
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