|
|
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Disable Assits++ scan on certain files
Disable Assits++ scan on certain files [message #50710] |
Fri, 07 December 2018 19:42  |
Didier
Messages: 726 Registered: November 2008 Location: France
|
Contributor |
|
|
When using Boost::spirit, I have an issue with assist++ scanner : it get's stuck in Boost headers.
So if I want to be able to use Assis++, I have to comment Boost header #include, launch rescan of all files, uncomment the boost headers #include
As BLITZ can be disabled on certain files using
Maybe Assist++ scanning could be disable using something like #pragma ASSIST_SCAN_PROHIBIT
|
|
|
Re: Disable Assits++ scan on certain files [message #50714 is a reply to message #50710] |
Sat, 08 December 2018 18:40   |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I found missing documentation page that speaks about your problem. The assist parsing can be turn off by following macros (part of missing documentation):
5. Assist++ C++ parser directives
Assist supports simple directives that are passed to it via '//' comments that can be used in cases that original code is confusing:
//$-
Code past this directive will not be passed to parser.
//$+
Code past this directive will be passed to parser (stops //$-).
//$ code
example: //$ void Foo(Bar&)
Code will be passed to parser (adds code that is not part of compiled sources)
The documentation page will be available tomorrow and it will be bundled with TheIDE. I hope my message will help you to deal with your problem.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sat, 08 December 2018 18:41] Report message to a moderator
|
|
|
|
|
Re: Disable Assits++ scan on certain files [message #51272 is a reply to message #50716] |
Tue, 26 February 2019 22:13   |
Didier
Messages: 726 Registered: November 2008 Location: France
|
Contributor |
|
|
Hello,
I took some time to find out why it doesn't work in my case, and I think I found a candidate
//$+ and //$- work when parsing the code of a file
But .... the list of files is extracted from the package files and file #include without taking into account the //$+ and //$-
The function that does this extract seems to be (Is this correct ??) : ide/Browser/Base.cpp BaseInfoSync(Progress& pi)
So the following code does not behave as I expected : I thought the includes (and the included files) would not be processed by assist++
//$-
#include <boost/config/warning_disable.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_fusion.hpp>
#include <boost/spirit/include/phoenix_stl.hpp>
#include <boost/spirit/include/phoenix_object.hpp>
#include <boost/spirit/include/phoenix_bind.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/variant/recursive_variant.hpp>
#include <boost/foreach.hpp>
//$+
Maybe the file should be preprocessed by :
CppBase/Pre.cpp SrcFile PreProcess(Stream& in, Parser& parser)
Before extracting the list of files to be processed by Assist++
[Updated on: Tue, 26 February 2019 22:37] Report message to a moderator
|
|
|
Re: Disable Assits++ scan on certain files [message #52297 is a reply to message #51272] |
Sun, 01 September 2019 00:20   |
Didier
Messages: 726 Registered: November 2008 Location: France
|
Contributor |
|
|
Well I finally found some time to look into this problem and actually found something that works.
Code is just a first quick try, but before going further I would like to share it first and have some return on it.
* in uppsrc/CppBase/CppBase.h
const char *SkipString(const char *s);
void RemoveComments(String& l, bool& incomment);
void RemoveDirectives(String& l, bool& inDirective); // ======= ADDED THIS LINE ============
String GetStdDefs();
* in uppsrc/CppBase/ppFile.cpp
Added the following function:
void RemoveDirectives(String& l, bool& inDirective)
{
int q = -1;
int w = -1;
if(inDirective)
q = w = 0;
else {
const char *s = l;
while(*s) {
if(*s == '\"')
s = SkipString(s);
else
if(s[0] == '/' && s[1] == '/' && s[2] == '$' && s[3] == '-') {
q = int(s - ~l);
break;
}
else
s++;
}
if(q >= 0)
w = q + 4;
}
while(q >= 0) {
int eq = l.Find("//$+", w);
if(eq < 0) {
inDirective = true;
SetSpaces(l, q, l.GetCount() - q);
return;
}
SetSpaces(l, q, eq + 4 - q);
inDirective = false;
q = l.Find("//$+");
w = q + 4;
}
}
* Modified ppFile::parse() method
void PPFile::Parse(Stream& in)
{
LTIMING("PPFile::Parse");
for(int i = 0; i < ppmacro.GetCount(); i++)
sAllMacros.Unlink(ppmacro[i]);
ppmacro.Clear();
item.Clear();
includes.Clear();
bool was_using = false;
bool was_namespace = false;
int level = 0;
bool incomment = false;
bool inDirective = false; ========== line added ===========
Vector<int> namespace_block;
bool next_segment = true;
Index<int> local_segments;
keywords.Clear();
int linei = 0;
Md5Stream md5;
while(!in.IsEof()) {
String l = in.GetLine();
while(*l.Last() == '\\' && !in.IsEof()) {
l.Trim(l.GetLength() - 1);
l.Cat(in.GetLine());
}
RemoveDirectives(l, inDirective); ========== line added =========
RemoveComments(l, incomment);
try {
CParser p(l);
|
|
|
|
|
|
|
|
|
Re: Disable Assits++ scan on certain files [message #52341 is a reply to message #52338] |
Tue, 10 September 2019 23:04   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
Didier wrote on Tue, 10 September 2019 20:06Hello Mirek,
I will provide all debug info tonight, when I first took a look at it, it got stuck in an infinite loop.
It always get's stuck on the same file
Please check and report the svn version of theide as an infinite loop is exactly what I have fixed...
Mirek
[Updated on: Tue, 10 September 2019 23:05] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sun May 11 17:20:51 CEST 2025
Total time taken to generate the page: 0.03548 seconds
|
|
|