diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-03-27 15:33:19 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-03-27 15:33:19 +0000 |
commit | f0f7a9f29962c55a6c2082b44c9befbd912c2f53 (patch) | |
tree | d768ccbd861af67d1c33d9657777c55139e4ec8a /src/log2xml/log2xml.cc | |
parent | 7823db2137d8079bcf512aba4ce46f1373693517 (diff) |
* Do not close a nesting level twice after close() has been
called explicitly on a Nest object.
Diffstat (limited to 'src/log2xml/log2xml.cc')
-rw-r--r-- | src/log2xml/log2xml.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/log2xml/log2xml.cc b/src/log2xml/log2xml.cc index 66e182452..a4955dc6e 100644 --- a/src/log2xml/log2xml.cc +++ b/src/log2xml/log2xml.cc @@ -16,6 +16,7 @@ struct Decoder bool newNumber; int priority; bool ignoreLF; + int lineNo, charNo; Decoder() { @@ -25,6 +26,8 @@ struct Decoder level = 0; priority = 1; ignoreLF = false; + lineNo = 1; + charNo = 0; } void pushChar(char c); @@ -35,6 +38,11 @@ struct Decoder void Decoder::pushChar(char c) { + if (c == '\n') { + lineNo++; + charNo = 0; + } else charNo++; + switch (state) { case stTop: @@ -71,7 +79,8 @@ void Decoder::pushChar(char c) level--; cout << "</nest>" << endl; } else - cerr << "not enough nesting levels" << endl; + cerr << "not enough nesting levels at line " + << lineNo << ", character " << charNo << endl; break; case 's': if (line.size()) finishLine(); |