Author: toad Date: 2006-09-01 21:52:51 +0000 (Fri, 01 Sep 2006) New Revision: 10339
Modified: trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex Log: remove unnecessary "comment:" at the beginning of comments. Modified: trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java =================================================================== --- trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java 2006-09-01 21:50:06 UTC (rev 10338) +++ trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java 2006-09-01 21:52:51 UTC (rev 10339) @@ -1,4 +1,4 @@ -/* The following code was generated by JFlex 1.3.5 on 01/09/06 21:38 */ +/* The following code was generated by JFlex 1.3.5 on 01/09/06 22:48 */ package freenet.clients.http.filter; import java.io.*; @@ -11,7 +11,7 @@ /** * This class is a scanner generated by * <a href="http://www.jflex.de/">JFlex</a> 1.3.5 - * on 01/09/06 21:38 from the specification file + * on 01/09/06 22:48 from the specification file * <tt>file:/usr/src/cvs/eclipse-workspace/Freenet 0.7/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex</tt> */ class CSSTokenizerFilter { @@ -1185,6 +1185,32 @@ } } case 305: break; + case 105: + { + String s = yytext(); + StringBuffer sb = new StringBuffer(s.length()); + sb.append("/* "); + boolean inPrefix = true; + for(int i=2;i<s.length()-2;i++) { + char c = s.charAt(i); + if(inPrefix && Character.isWhitespace(c)) { + continue; + } + inPrefix = false; + if(Character.isDigit(c) || Character.isWhitespace(c) || + Character.isLetter(c) || c == '.' || c == '_' || c == '-') { + // No @, no !, etc; IE has been known to do things with comments + // in CSS, and other browsers may too + sb.append(c); + } + } + while(Character.isWhitespace(sb.charAt(sb.length()-1))) + sb.deleteCharAt(sb.length()-1); + sb.append(" */"); + w.write(sb.toString()); + if(debug) log("Matched comment: "+s+" -> "+sb.toString()); + } + case 306: break; case 26: case 94: { @@ -1193,7 +1219,7 @@ w.write(s); if(debug) log("Matched function start: "+s); } - case 306: break; + case 307: break; case 28: { if(postBadImportFlag) { @@ -1207,7 +1233,7 @@ if(debug) log("Matched and passing on mediums list: "+s); } } - case 307: break; + case 308: break; case 188: case 198: case 219: @@ -1230,21 +1256,21 @@ } else if(debug) log("Dropped @import"); } - case 308: break; + case 309: break; case 106: { String s = yytext(); w.write(s); if(debug) log("Matched HTML comment: "+s); } - case 309: break; + case 310: break; case 146: { String s = yytext(); w.write(s); if(debug) log("Matched @media: "+s); } - case 310: break; + case 311: break; case 74: case 75: case 95: @@ -1262,28 +1288,28 @@ w.write(s); if(debug) log("Matched unicode: "+s); } - case 311: break; + case 312: break; case 37: { String s = yytext(); w.write(s); if(debug) log("Matched number: "+s); } - case 312: break; + case 313: break; case 54: { String s = yytext(); w.write(s); if(debug) log("Matched |=: "+s); } - case 313: break; + case 314: break; case 125: { String s = yytext(); w.write(s); if(debug) log("Matched @page: "+s); } - case 314: break; + case 315: break; case 92: case 152: { @@ -1291,7 +1317,7 @@ if(debug) log("Got hexcolor: "+s); w.write(s); } - case 315: break; + case 316: break; case 2: case 5: case 13: @@ -1308,7 +1334,7 @@ w.write(s); if(debug) log("Matched ident: "+s); } - case 316: break; + case 317: break; case 34: case 59: case 60: @@ -1322,7 +1348,7 @@ w.write(s); } } - case 317: break; + case 318: break; case 38: case 40: case 71: @@ -1339,21 +1365,21 @@ w.write(s); if(debug) log("Matched #name: "+s); } - case 318: break; + case 319: break; case 281: { String s = yytext(); w.write(s); if(debug) log("Matched important: "+s); } - case 319: break; + case 320: break; case 15: { String s = yytext(); w.write(s); if(debug) log("Matched semicolon: "+s); } - case 320: break; + case 321: break; case 136: case 138: case 140: @@ -1365,14 +1391,14 @@ if(debug) log("Ignoring unrecognizable url: "+s); w.write("/* Ignoring unmatchable URL */url()"); } - case 321: break; + case 322: break; case 53: { String s = yytext(); w.write(s); if(debug) log("Matched ~=: "+s); } - case 322: break; + case 323: break; case 121: case 143: case 166: @@ -1384,21 +1410,21 @@ w.write(s); if(debug) log("Matched unicode range: "+s); } - case 323: break; + case 324: break; case 17: { String s = yytext(); w.write(s); if(debug) log("Matched close braces: "+s); } - case 324: break; + case 325: break; case 10: { String s = yytext(); w.write(s); if(debug) log("Matched function end: "+s); } - case 325: break; + case 326: break; case 248: case 266: case 280: @@ -1408,7 +1434,7 @@ if(debug) log("Matched and ignoring charset: "+s); // Ignore } - case 326: break; + case 327: break; case 1: case 3: case 7: @@ -1425,21 +1451,21 @@ log("Matched anything: "+yytext()+" - ignoring"); w.write("/* ignored unmatched char: "+c+" */"); // single char cannot break out of comment } - case 327: break; + case 328: break; case 225: { String s = yytext(); w.write(s); if(debug) log("Matched @font-face: "+s); } - case 328: break; + case 329: break; case 16: { String s = yytext(); w.write(s); if(debug) log("Matched open braces: "+s); } - case 329: break; + case 330: break; case 6: case 9: case 12: @@ -1449,53 +1475,27 @@ w.write(s); if(debug) log("Matched single char: "+s); } - case 330: break; + case 331: break; case 4: { String s = yytext(); w.write(s); if(debug) log("Matched whitespace: "+s); } - case 331: break; + case 332: break; case 29: { String s = yytext(); w.write(s); if(debug) log("Matched measurement: "+s); } - case 332: break; + case 333: break; case 58: { String s = yytext(); w.write(s); if(debug) log("Matched HTML comment: "+s); } - case 333: break; - case 105: - { - String s = yytext(); - StringBuffer sb = new StringBuffer(s.length()); - sb.append("/* comment: "); - boolean inPrefix = true; - for(int i=2;i<s.length()-2;i++) { - char c = s.charAt(i); - if(inPrefix && Character.isWhitespace(c)) { - continue; - } - inPrefix = false; - if(Character.isDigit(c) || Character.isWhitespace(c) || - Character.isLetter(c) || c == '.' || c == '_' || c == '-') { - // No @, no !, etc; IE has been known to do things with comments - // in CSS, and other browsers may too - sb.append(c); - } - } - while(Character.isWhitespace(sb.charAt(sb.length()-1))) - sb.deleteCharAt(sb.length()-1); - sb.append(" */"); - w.write(sb.toString()); - if(debug) log("Matched comment: "+s+" -> "+sb.toString()); - } case 334: break; default: if (yy_input == YYEOF && yy_startRead == yy_currentPos) { Modified: trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex =================================================================== --- trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex 2006-09-01 21:50:06 UTC (rev 10338) +++ trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex 2006-09-01 21:52:51 UTC (rev 10339) @@ -296,7 +296,7 @@ "/*" ~"*/" { String s = yytext(); StringBuffer sb = new StringBuffer(s.length()); - sb.append("/* comment: "); + sb.append("/* "); boolean inPrefix = true; for(int i=2;i<s.length()-2;i++) { char c = s.charAt(i);
