Qui, 2009-02-12 ?s 19:38 +0000, corvid escreveu:
I updated the UTF-8 sampler search bar screenshot to show off the nifty new button :)
Great, thanks! Onto another subject I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh. In the following code: inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); } Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality. Thanks, Jo?o
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S Jo?o
_______________________________________________ Dillo-dev mailing list Dillo-dev@dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
Jo?o wrote:
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S
I think we want to treat something like tab and space as the same.
Sex, 2009-02-13 ?s 00:41 +0000, corvid escreveu:
Jo?o wrote:
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S
I think we want to treat something like tab and space as the same.
OK, I'm not quite sure why we want that, but now I'll try to focus on why it fails with thast particular expression. Thanks for that. Jo?o
_______________________________________________ Dillo-dev mailing list Dillo-dev@dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
On Sat, Feb 14, 2009 at 12:29:32AM +0000, Jo?o Ricardo Louren?o wrote:
Sex, 2009-02-13 ?s 00:41 +0000, corvid escreveu:
Jo?o wrote:
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S
I think we want to treat something like tab and space as the same.
OK, I'm not quite sure why we want that,
When parsing in HTML mode, all whitespace are equal.
but now I'll try to focus on why it fails with thast particular expression. Thanks for that.
-- Cheers Jorge.-
Sex, 2009-02-13 ?s 00:41 +0000, corvid escreveu:
Jo?o wrote:
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S
I think we want to treat something like tab and space as the same.
Oh and one more thing. If our purpose is to treat all whitespace equaly (tabs=Spaces...), why do we _only_ do that when not doing a case-sensitive comparison? A way to verify that (isspace (c1) && isspace (c2)) is causing the fail is to search for ' ' backwards with case-sens* on --- it finds it. Thanks, Jo?o
_______________________________________________ Dillo-dev mailing list Dillo-dev@dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
Jo?o wrote:
Sex, 2009-02-13 ?s 00:41 +0000, corvid escreveu:
Jo?o wrote:
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S
I think we want to treat something like tab and space as the same.
Oh and one more thing. If our purpose is to treat all whitespace equaly (tabs=Spaces...), why do we _only_ do that when not doing a case-sensitive comparison?
A way to verify that (isspace (c1) && isspace (c2)) is causing the fail is to search for ' ' backwards with case-sens* on --- it finds it.
I don't really know that code in any detail whatsoever. I think Johannes implemented it.
On Sat, Feb 14, 2009 at 03:16:56AM +0000, corvid wrote:
Jo?o wrote:
Sex, 2009-02-13 ?s 00:41 +0000, corvid escreveu:
Jo?o wrote:
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S
I think we want to treat something like tab and space as the same.
Oh and one more thing. If our purpose is to treat all whitespace equaly (tabs=Spaces...), why do we _only_ do that when not doing a case-sensitive comparison?
A way to verify that (isspace (c1) && isspace (c2)) is causing the fail is to search for ' ' backwards with case-sens* on --- it finds it.
I don't really know that code in any detail whatsoever. I think Johannes implemented it.
Yes, I had added the (isspace (c1) && isspace (c2)) part to treat all whitespace equally. I didn't touch the caseSens==true case, because I wasn't sure whether we want to retain the possibility to search for e.g. \t or \n in plain text or not. Cheers, Johannes
On Sat, Feb 14, 2009 at 12:38:36AM +0000, Jo?o Ricardo Louren?o wrote:
Sex, 2009-02-13 ?s 00:41 +0000, corvid escreveu:
Jo?o wrote:
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S
I think we want to treat something like tab and space as the same.
Oh and one more thing. If our purpose is to treat all whitespace equaly (tabs=Spaces...), why do we _only_ do that when not doing a case-sensitive comparison?
It looks like a bug.
A way to verify that (isspace (c1) && isspace (c2)) is causing the fail is to search for ' ' backwards with case-sens* on --- it finds it.
-- Cheers Jorge.-
participants (4)
-
corvid@lavabit.com
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de
-
jorl17.8@gmail.com