ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Iffy/Iffy.cpp
(Generate patch)

Comparing Iffy/Iffy.cpp (file contents):
Revision 276 by Douglas Thrift, 2004-11-13T00:45:59-08:00 vs.
Revision 277 by Douglas Thrift, 2004-11-13T14:01:11-08:00

# Line 10 | Line 10
10   #include <menes-api/exename.hpp>
11   #include <menes-api/files.hpp>
12   #include <menes-app/application.hpp>
13 + #include <menes-ext/stack.hpp>
14  
15   struct IffyCommand : public app::Application
16   {
# Line 84 | Line 85 | void Iffy::iffy(ios::Reader& in, ios::Wr
85          ext::String segment;
86          bool text(true);
87          ios::FormatWriter fout(out);
88 +        ext::Stack<ext::String> opens;
89  
90          while (read(in, segment, text)) if (text)
91          {
# Line 97 | Line 99 | void Iffy::iffy(ios::Reader& in, ios::Wr
99  
100                  if (tag == "br") tag = STANDALONE;
101  
102 <                // XXX: automagically fix
102 >                switch (tag)
103 >                {
104 >                case OPEN:
105 >                        opens.Push(tag);
106 >
107 >                        break;
108 >                case CLOSE:
109 >                        if (tag != opens.Top()) tag = opens.Top();
110 >
111 >                        opens.Pop();
112 >
113 >                        break;
114 >                default:
115 >                        break;
116 >                }
117  
118                  fout << tag << ios::Flush;
119  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines