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 » CParser do not check for invalid strings that span lines
Re: CParser do not check for invalid strings that spam lines [message #42878 is a reply to message #42873] Sat, 12 April 2014 19:45 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
mingodad wrote on Sat, 12 April 2014 10:48
Hello !

Working with witz templates I found error messages a bit misleading when I forgot to put an end quote on one string, following the problem I found several problems (it got better but the error message has a wrong column info on my case it is 2 bytes upfront):

1- CParser do not check for invalid strings that spam multiple lines (see fix bellow):
/////////
--- /home/mingo/upp/uppsrc/Core/parser.cpp
+++ /tmp/parser-0.cpp
@@ -327,7 +327,7 @@
 			}
 		}
 		else {
-			if(*term < ' ') {
+			if(*term < ' ' || *term == '\n') {
 



As '\n' is clearly < ' ', this is unlikely to change anything Smile

Anyway, the problem was something else: ReadString has bool parameter that allows it to ignore unterminated String errors. It was added in order to be able to deal with some broken files situations, unfortunately it was set to 'ignore problems' as default.

This was kind of stupid decision, so I have been bold enought to do a backward incompatible change, making checking mode the default. I hope it is very unlikely that this would cause any problems...

(will check witz stuff later)

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can we have a ValueMap(Unique) ?
Next Topic: Surprising behavior of CParser
Goto Forum:
  


Current Time: Wed Jun 12 17:47:50 CEST 2024

Total time taken to generate the page: 0.02459 seconds