lib/smurf/javascript.rb
def mynext()
      c = get
      if (c == "/")
        if(peek == "/")
          while(true)
            c = get
            if (c == -1 || c <= "\n")
            return c
            end
          end
        end
        if(peek == "*" && peek(2) != "@") # not conditional comments
          get
          while(true)
            case get
            when "*"
             if (peek == "/")
                get
                return " "
              end
            when EOF
              raise "Unterminated comment"
            end
          end
        end
      end
      return c
    end
def mynext()
      c = get
      if (c == "/")
        if(peek == "/")
          while(true)
            c = get
            if (c == -1 || c <= "\n")
            return c
            end
          end
        end
        if(peek == "*" && peek(2) != "@") # not conditional comments
          get
          while(true)
            case get
            when "*"
             if (peek == "/")
                get
                return " "
              end
            when EOF
              raise "Unterminated comment"
            end
          end
        end
      end
      return c
    end
def mynext ( ) c = get if ( c == "/" ) if ( peek == "/" ) while ( true ) c = get if ( c == - 1 || c <= "\n" ) return c end end end if ( peek == "*" && peek ( 2 ) != "@" ) # not conditional comments get while ( true ) case get when "*" if ( peek == "/" ) get return " " end when EOF raise "Unterminated comment" end end end end return c end
mynext -- get the next character, excluding legitimate comments.
 peek() is used to see if a '/' is followed by a '/' or '*'.
mynext -- get the next character excluding legitimate comments . peek () is used to see if a / is followed by a / or * .