version 0.5.0_alpha

git-svn-id: svn://db.shs.com.ru/pip@8 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-03-10 10:13:18 +00:00
parent b1f651ab62
commit c11bc3b3b8
697 changed files with 18150 additions and 18839 deletions

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
C++ code parser
Copyright (C) 2014 Ivan Pelipenko peri4ko@gmail.com
Copyright (C) 2015 Ivan Pelipenko peri4ko@gmail.com
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
@@ -54,7 +54,7 @@ PIString PICodeParser::Macro::expand(PIString args_, bool * ok) const {
PIChar ppc(0), pc(0), nc(0);
if (ind > 1) ppc = ret[ind - 2];
if (ind > 0) pc = ret[ind - 1];
if (ind + an.size_s() < ret.size_s()) nc = ret[ind + an.size_s()];
if (ind + an.size_s() < ret.size_s()) nc = ret.mid(ind + an.size_s(),0)[0];
if (ppc != '#' && pc == '#' && !_isCChar(nc)) { // to chars
ind--;
ret.replace(ind, an.size_s() + 1, "\"" + av + "\"");
@@ -230,7 +230,7 @@ bool PICodeParser::parseFileContent(PIString & fc, bool main) {
while ((ind = pfc.find(d.first, ind + 1)) >= 0) {
PIChar pc(0), nc(0);
if (ind > 0) pc = pfc[ind - 1];
if (ind + d.first.size_s() < pfc.size_s()) nc = pfc[ind + d.first.size_s()];
if (ind + d.first.size_s() < pfc.size_s()) nc = pfc.mid(ind + d.first.size_s(),0)[0];
if (_isCChar(pc) || _isCChar(nc) || nc.isDigit()) continue;
pfc.replace(ind, d.first.size_s(), d.second);
ind -= d.first.size_s() - d.second.size_s();
@@ -242,7 +242,7 @@ bool PICodeParser::parseFileContent(PIString & fc, bool main) {
while ((ind = pfc.find(m.name, ind + 1)) >= 0) {
PIChar pc(0), nc(0);
if (ind > 0) pc = pfc[ind - 1];
if (ind + m.name.size_s() < pfc.size_s()) nc = pfc[ind + m.name.size_s()];
if (ind + m.name.size_s() < pfc.size_s()) nc = pfc.mid(ind + m.name.size_s(),0)[0];
if (_isCChar(pc) || _isCChar(nc) || nc.isDigit()) continue;
PIString ret, range; bool ok(false);
range = pfc.mid(ind + m.name.size_s()).takeRange("(", ")");