git-svn-id: svn://db.shs.com.ru/pip@591 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
C++ code parser
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru
|
||||
Copyright (C) 2018 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -439,10 +439,10 @@ bool PICodeParser::parseEnum(Entity * parent, const PIString & name, PIString fc
|
||||
vn = v; ind = v.find("=");
|
||||
if (ind > 0) {cv = v.right(v.size_s() - ind - 1).toInt(); vn = v.left(ind);}
|
||||
if (ind < 0) ++cv;
|
||||
e.members << Enumerator(vn.trim(), cv);
|
||||
e.members << EnumeratorInfo(vn.trim(), cv);
|
||||
}
|
||||
if (!e.members.isEmpty())
|
||||
if (e.members.back().first.isEmpty())
|
||||
if (e.members.back().name.isEmpty())
|
||||
e.members.pop_back();
|
||||
enums << e;
|
||||
return true;
|
||||
@@ -802,6 +802,7 @@ PIString PICodeParser::procMacros(PIString fc) {
|
||||
if (line.left(1) == "#") {
|
||||
mifcond = line.mid(1);
|
||||
mif = mifcond.takeCWord();
|
||||
//piCout << mif;
|
||||
//piCout << "mif mifcond" << mif << mifcond << ifcnt;
|
||||
if (skip || grab) {
|
||||
if (mif.left(2) == "if") ifcnt++;
|
||||
@@ -877,6 +878,8 @@ bool PICodeParser::parseDirective(PIString d) {
|
||||
}
|
||||
if (dname == "define") {
|
||||
PIString mname = d.takeCWord();
|
||||
//piCout << mname;
|
||||
if (mname == "PIMETA") return true;
|
||||
if (d.left(1) == "(") { // macro
|
||||
PIStringList args = d.takeRange("(", ")").split(",").trim();
|
||||
macros << Macro(mname, d.trim(), args);
|
||||
|
||||
Reference in New Issue
Block a user