Collected pos, line, and column into a Mark struct

This commit is contained in:
Jesse Beder
2009-07-27 02:56:18 +00:00
parent 9b78bd459b
commit b1ce042535
17 changed files with 145 additions and 137 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "mark.h"
#include <ios>
#include <string>
#include <vector>
@@ -50,7 +51,7 @@ namespace YAML
};
struct Token {
Token(TOKEN_TYPE type_, int line_, int column_): status(TS_VALID), type(type_), line(line_), column(column_) {}
Token(TOKEN_TYPE type_, const Mark& mark_): status(TS_VALID), type(type_), mark(mark_) {}
friend std::ostream& operator << (std::ostream& out, const Token& token) {
out << TokenNames[token.type] << std::string(": ") << token.value;
@@ -61,7 +62,7 @@ namespace YAML
TOKEN_STATUS status;
TOKEN_TYPE type;
int line, column;
Mark mark;
std::string value;
std::vector <std::string> params;
};