Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » [solved] Bug in CParser
[solved] Bug in CParser [message #43598] Thu, 11 September 2014 14:59 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
CParser::SkipSpaces is bugged. Correct implementation:

CParser& SkipSpaces(bool b = true)        { skipspaces = b; return *this; }

[Updated on: Tue, 03 January 2017 12:03]

Report message to a moderator

Re: Bug in CParser [message #43599 is a reply to message #43598] Thu, 11 September 2014 15:15 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Plus, there is no way to call Set after NoSkipSpaces because it will override the skip. I propose these changes:

.hpp
void   Set(const char *ptr, const char *fn, int line = 1, bool skip = true);
	void   Set(const char *ptr, bool skip = true);


.cpp
void CParser::Set(const char *_ptr, const char *_fn, int _line, bool skip)
{
	term = lineptr = wspc = _ptr;
	fn = _fn;
	line = _line;
	skipspaces = skip;
	Spaces();
	LLOG("Set " << fn << ":" << line);
}

void CParser::Set(const char *_ptr, bool skip)
{
	Set(_ptr, "", 1, skip);
}
Re: Bug in CParser [message #43600 is a reply to message #43598] Thu, 11 September 2014 17:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, fixed.

Set: I actually believe that the setting of skip should be removed and Spaces be called only if it is true.
Re: Bug in CParser [message #43603 is a reply to message #43600] Fri, 12 September 2014 08:52 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Thank you!

Set: that would work as well. As long as I can use CParser in "noskip" Mode. The output of my parser is HTML that contains syntax highlighting with CSS styles and whitespaces need to be processed.
Re: Bug in CParser [message #43613 is a reply to message #43603] Sat, 13 September 2014 19:15 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Applied. Thanks.

Mirek
Previous Topic: HttpClient -> ssl
Next Topic: Some fixes in InVector.hpp and Vcont.cpp
Goto Forum:
  


Current Time: Fri Apr 19 11:52:07 CEST 2024

Total time taken to generate the page: 0.04234 seconds