changeset 4209:df7171fd3013

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/scrum/controls/jfx/rt
author David Grieve<david.grieve@oracle.com>
date Wed, 03 Jul 2013 08:32:01 -0400
parents f6edfc2f7b85 a26b4827dc1e
children c6e4266aed9b
files
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/css/parser/CSSLexer.java	Wed Jul 03 07:35:50 2013 -0400
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/parser/CSSLexer.java	Wed Jul 03 08:32:01 2013 -0400
@@ -401,6 +401,7 @@
                 case '/':                    
                     ch = readChar();
                     if (ch == '*') skipComment();
+                    else if (ch == '/') skipEOL();
                     else {
                         text.append('/').append((char)ch);
                         int temp = offset;
@@ -561,6 +562,22 @@
         }
     }
 
+    private void skipEOL() throws IOException {
+
+        int lastc = ch;
+
+        while (ch != -1) {
+
+            ch = readChar();
+
+            // EOL is cr, lf, or crlf
+            if ((ch == '\n') || (lastc == '\r' && ch != '\n')) {
+                    break;
+            }
+        }
+
+    }
+
     private int pos = 0;
     private int offset = 0;
     private int line = 1;
@@ -697,6 +714,14 @@
                                 token = Token.EOF_TOKEN;
                                 return token;
                             }
+                        } else if (ch == '/') {
+                            skipEOL();
+                            if (ch != -1) {
+                                continue;
+                            } else {
+                                token = Token.EOF_TOKEN;
+                                return token;
+                            }
                         } else {
                             // not a comment - a SOLIDUS
                             token = new Token(SOLIDUS,"/", line, offset);