* Matthew Toseland <toad at amphibian.dyndns.org> [2007-08-21 23:27:49]:
> On Monday 13 August 2007 21:59, you wrote: > > Author: nextgens > > Date: 2007-08-13 20:59:10 +0000 (Mon, 13 Aug 2007) > > New Revision: 14664 > > > > Removed: > > trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java > > Modified: > > trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex > > Log: > > Fix last commit, unbreak the CSS filter (hopefully). > > > > REVIEW IT! > > > > Modified: > trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex > > =================================================================== > > --- trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex > 2007-08-13 20:23:07 UTC (rev 14663) > > +++ trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex > 2007-08-13 20:59:10 UTC (rev 14664) > > @@ -237,9 +237,9 @@ > > STRING2=\'(\\{NL}|\"|(\\\')|{NONASCII}|{ESCAPE}|[^\'])*\' > > > > IDENT={NMSTART}{NMCHAR}* > > -UNOFFICIAL_IDENT="-[^0-9]"{IDENT} > > +UNOFFICIAL_IDENT="-"{IDENT} > > Ok, this is just reverting it to the old version. > > > NAME={NMCHAR}+ > > -NUM="-"([0-9]+|[0-9]*"."[0-9]+) > > +NUM=[-]([0-9]+|[0-9]*"."[0-9]+) > > Need more brackets, no? > > (([0-8]+)|([0-9]*"."[0-9]+)) ? > > Also I don't get the [-]. I changed it again in a later version : current is NUM=(-){0,1}([0-9]+|[0-9]*"."[0-9]+) > > +{UNOFFICIAL_IDENT} { > > + if(debug) log("Deleted unofficial ident: "+yytext()); > > + w.write("/* " + l10n("deletedUnofficialIdent") + " */"); > > +} > > +{UNOFFICIAL_IDENT}{W}":"{W}{REALURL} { > > + if(debug) log("Deleted unofficial ident with url: "+yytext()); > > + w.write("/* " + l10n("deletedUnofficialIdentWithURL") + " */"); > > +} > > Moving the unofficial ident matching down seems sensible although *it has no > effect at all* - jflex always takes the longest match. The last rule is the > fallback. Weird... I moved it because it matched things it shouldn't have. > Lexical states look quite interesting, maybe a way to do more > sophisticated parsing rather than simple sequential lexing which really > doesn't work that well for CSS. Agreed: the current solution sucks. NextGen$ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20070822/6e7e354b/attachment.pgp>