[richfaces-svn-commits] JBoss Rich Faces SVN: r11539 - trunk/framework/impl/src/main/java/org/ajax4jsf/javascript.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Dec 4 05:15:51 EST 2008


Author: pyaschenko
Date: 2008-12-04 05:15:51 -0500 (Thu, 04 Dec 2008)
New Revision: 11539

Modified:
   trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
Log:
https://jira.jboss.org/jira/browse/RF-4513

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java	2008-12-04 10:01:06 UTC (rev 11538)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java	2008-12-04 10:15:51 UTC (rev 11539)
@@ -42,10 +42,9 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PushbackInputStream;
+import org.ajax4jsf.io.FastBufferOutputStream;
 
 
-
-
 public class JSMin {
 	private static final int EOF = -1;
 
@@ -60,7 +59,7 @@
 	private int column;
 	
 	public JSMin(InputStream in, OutputStream out) {
-		this.in = new PushbackInputStream(in);
+		this.in = new PushbackInputStream(in,2);
 		this.out = out;
 		this.line = 0;
 		this.column = 0;
@@ -117,6 +116,10 @@
 		in.unread(lookaheadChar);
 		return lookaheadChar;
 	}
+	
+	void back(byte[] b) throws IOException {
+		in.unread(b);
+	}
 
 	/**
 	 * next -- get the next character, excluding comments. peek() is used to see
@@ -133,7 +136,6 @@
 						return c;
 					}
 				}
-
 			case '*':
 				get();
 				for (;;) {
@@ -144,6 +146,14 @@
 							return ' ';
 						}
 						break;
+					case '@':
+						// TODO: add spaces skipping
+						FastBufferOutputStream bs = new FastBufferOutputStream();
+						bs.write('*');
+						bs.write('@');
+						back(bs.toByteArray());
+						bs.close();
+						return c;
 					case EOF:
 						throw new UnterminatedCommentException(line,column);
 					}




More information about the richfaces-svn-commits mailing list