From: Waldbaer <wal...@us...> - 2008-11-20 16:40:29
|
Hi, I wondered why the columnNumbers for characters following a TAB character are so big. The TAB character seems to be treated like 8 characters. I found the following: com.steadystate.css.parser.ASCII_CharStream.UpdateLineColumn(char c), line 162: case '\t' : this.column--; this.column += (8 - (this.column & 07)); break; Why is this special treatment for TAB? -- Waldbaer |
From: Daniel G. <djg...@gm...> - 2008-11-20 17:57:34
|
No idea... does the cvs log say who committed those lines of code? On Thu, Nov 20, 2008 at 11:21 AM, Waldbaer <wal...@us...>wrote: > Hi, > > I wondered why the columnNumbers for characters following a TAB > character are so big. The TAB character seems to be treated like 8 > characters. I found the following: > > com.steadystate.css.parser.ASCII_CharStream.UpdateLineColumn(char c), > line 162: > > case '\t' : > this.column--; > this.column += (8 - (this.column & 07)); > break; > > Why is this special treatment for TAB? > > -- > Waldbaer > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > cssparser-developers mailing list > css...@li... > https://lists.sourceforge.net/lists/listinfo/cssparser-developers > -- Daniel Gredler http://daniel.gredler.net/ |
From: Alan K. <al...@tr...> - 2008-11-20 18:30:07
|
Alan Krueger wrote: > http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?hideattic=0&view=log#rev1.3 > <http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?hideattic=0&view=log#rev1.3> > > Revision *1.3* - (view > <http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?hideattic=0&revision=1.3&view=markup>) > (download > <http://cssparser.cvs.sourceforge.net/viewvc/*checkout*/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?revision=1.3>) > (annotate > Wow, that REALLY didn't send well through the list manager. :-( |
From: Waldbaer <wal...@us...> - 2008-11-21 08:11:57
|
Alan Krueger schrieb: > Waldbaer wrote: >> I wondered why the columnNumbers for characters following a TAB >> character are so big. The TAB character seems to be treated like 8 >> characters. I found the following: >> >> com.steadystate.css.parser.ASCII_CharStream.UpdateLineColumn(char c), >> line 162: >> >> case '\t' : >> this.column--; >> this.column += (8 - (this.column & 07)); >> break; >> >> Why is this special treatment for TAB? >> > According to the SourceForge CVS browser, that looks like it was one of > your changes. :-) [...] > Changes since *1.2: +125 -125 lines* > Diff to previous 1.2 > <http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?hideattic=0&r1=1.2&r2=1.3>cleanup > > http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?hideattic=0&view=diff&r1=1.2&r2=1.3 <http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?hideattic=0&view=diff&r1=1.2&r2=1.3> > > 162 > <http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?annotate=1.3&hideattic=0#l162> > case '\t' : case '\t' : > 163 > <http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?annotate=1.3&hideattic=0#l163> > column--; this.column--; > 164 > <http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?annotate=1.3&hideattic=0#l164> > column += (8 - (column & 07)); this.column += > (8 - (this.column & 07)); > 165 > <http://cssparser.cvs.sourceforge.net/viewvc/cssparser/cssparser/src/com/steadystate/css/parser/ASCII_CharStream.java?annotate=1.3&hideattic=0#l165> > break; break; Well, I did some _changes_, but I did not write the original code. David? The problem that I see with this special treatment is that some viewing applications may treat a TAB char as 8, some as 4, some as 2 characters wide. In fact it's still only one character. I propose to remove the whole case block for '\t'. -- Waldbaer |
From: Alan K. <al...@tr...> - 2008-11-21 16:12:18
|
Waldbaer wrote: > Well, I did some _changes_, but I did not write the original code. David? > If I'm reading the diff correctly, it claims those lines were added in that revision. > The problem that I see with this special treatment is that some viewing > applications may treat a TAB char as 8, some as 4, some as 2 characters > wide. In fact it's still only one character. > > I propose to remove the whole case block for '\t' I agree. This is really presentation logic embedded in the parser. The caller can expand the returned column based on how it treats tabs, but that's not something the parser itself needs to do. |
From: Daniel G. <djg...@gm...> - 2008-11-21 17:39:28
|
Works for me, though I'd prefer we had some feedback from David regarding the initial rationale for this code :-/ On Fri, Nov 21, 2008 at 11:12 AM, Alan Krueger <al...@tr...> wrote: > Waldbaer wrote: > > Well, I did some _changes_, but I did not write the original code. David? > > > If I'm reading the diff correctly, it claims those lines were added in > that revision. > > The problem that I see with this special treatment is that some viewing > > applications may treat a TAB char as 8, some as 4, some as 2 characters > > wide. In fact it's still only one character. > > > > I propose to remove the whole case block for '\t' > I agree. This is really presentation logic embedded in the parser. The > caller can expand the returned column based on how it treats tabs, but > that's not something the parser itself needs to do. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > cssparser-developers mailing list > css...@li... > https://lists.sourceforge.net/lists/listinfo/cssparser-developers > -- Daniel Gredler http://daniel.gredler.net/ |
From: David S. <dav...@gm...> - 2008-11-21 20:38:17
|
On 22/11/2008, at 4:39 AM, Daniel Gredler wrote: > Works for me, though I'd prefer we had some feedback from David > regarding the initial rationale for this code :-/ The plan for me is to go camping in a couple of hours, but looking at the wind and the rain outside I may have an opportunity to go through all this sooner than that. David |