Author: pyaschenko
Date: 2008-12-05 09:44:35 -0500 (Fri, 05 Dec 2008)
New Revision: 11581
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-05
14:42:01 UTC (rev 11580)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2008-12-05
14:44:35 UTC (rev 11581)
@@ -44,8 +44,6 @@
import java.io.PushbackInputStream;
-
-
public class JSMin {
private static final int EOF = -1;
@@ -60,7 +58,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 +115,10 @@
in.unread(lookaheadChar);
return lookaheadChar;
}
+
+ void back(int c) throws IOException {
+ in.unread(c);
+ }
/**
* next -- get the next character, excluding comments. peek() is used to see
@@ -133,20 +135,25 @@
return c;
}
}
-
case '*':
get();
- for (;;) {
- switch (get()) {
- case '*':
- if (peek() == '/') {
- get();
- return ' ';
+ if (peek()=='@') {
+ // TODO: add spaces skipping
+ back('*');
+ return c;
+ } else {
+ for (;;) {
+ switch (get()) {
+ case '*':
+ if (peek() == '/') {
+ get();
+ return ' ';
+ }
+ break;
+ case EOF:
+ throw new UnterminatedCommentException(line,column);
}
- break;
- case EOF:
- throw new UnterminatedCommentException(line,column);
- }
+ }
}
default: