166_uppsrc.diff

The diff file to apply for uppsrc directory - Sender Ghost, 11/11/2011 07:44 PM

Download (1.63 KB)

View differences:

uppsrc/ide/Browser/Lay.cpp 2011-11-12 00:21:52 +0600
19 19
	}
20 20
}
21 21

  
22
inline void WriteLines(String& r, int count)
23
{
24
	for (int i = 0; i < count; ++i)
25
		r << '\n';
26
}
27

  
22 28
void ScanLayFile(const char *fn)
23 29
{
24 30
	LTIMING("Lay file");
......
26 32
	CParser p(s);
27 33
	String r;
28 34
	try {
35
		int line = p.GetLine();
29 36
		if(p.Char('#') && p.Id("ifdef")) {
30 37
			if(!p.Id("LAYOUTFILE"))
31 38
				p.Id("LAYOUT");
39
			WriteLines(r, p.GetLine() - line);
32 40
		}
33 41
		while(!p.IsEof()) {
42
			line = p.GetLine();
34 43
			p.PassId("LAYOUT");
35 44
			p.PassChar('(');
36
			r << "template <class T> struct With" << p.ReadId() << " : public T {\n"
37
			  << "\tstatic Size GetLayoutSize();\n";
45
			r << "template <class T> struct With" << p.ReadId() << " : public T {"
46
			  << "\tstatic Size GetLayoutSize();";
38 47
			LaySkipRest(p);
48
			WriteLines(r, p.GetLine() - line);
39 49
			for(;;) {
50
				line = p.GetLine();
40 51
				if(p.Id("ITEM")) {
41 52
					p.PassChar('(');
42 53
					if(p.IsId()) {
......
44 55
						if(strncmp(type, "dv___", 5)) {
45 56
							r << '\t' << type;
46 57
							p.PassChar(',');
47
							r << ' ' << p.ReadId() << ";\n";
58
							r << ' ' << p.ReadId() << ";";
48 59
						}
49 60
					}
50 61
				}
......
54 65
				else
55 66
					break;
56 67
				LaySkipRest(p);
68
				WriteLines(r, p.GetLine() - line);
57 69
			}
70
			line = p.GetLine();
58 71
			p.PassId("END_LAYOUT");
59 72
			if(p.Char('#'))
60 73
				p.Id("endif");
61
			r << "};\n\n";
74
			r << "};";
75
			WriteLines(r, p.GetLine() - line);
62 76
		}
63 77
	}
64 78
	catch(CParser::Error) {}