MOD mise en production (pas tout à fait fini)
[euphorik.git] / tools / jsmin.rb
index 00fd804..05a5e7d 100644 (file)
@@ -66,12 +66,14 @@ end
 # peek() is used to see if a '/' is followed by a '/' or '*'.
 def mynext()
     c = get
-    if (c == "/")
-        if(peek == "/")
+    # saute les commentaires (également les lignes commencant pas ;;)
+    if (c == "/" or c == ";")
+       prochain = peek
+        if(prochain  == "/" or prochain == ";")
             while(true)
                 c = get
-                if (c <= "\n")
-                return c
+                if (c[0] <= "\n"[0])
+                  return c
                 end
             end
         end