lib/smurf/javascript.rb
def jsmin
      @theA = "\n"
      action(3)
      while (@theA != EOF)
        case @theA
        when " "
          if (isAlphanum(@theB))
            action(1)
          else
            action(2)
          end
        when "\n"
          case (@theB)
          when "{","[","(","+","-"
            action(1)
          when " "
            action(3)
          else
            if (isAlphanum(@theB))
              action(1)
            else
              action(2)
            end
          end
        else
          case (@theB)
          when " "
            if (isAlphanum(@theA))
              action(1)
            else
              action(3)
            end
          when "\n"
            case (@theA)
            when "}","]",")","+","-","\"","\\", "'", '"'
              action(1)
            else
              if (isAlphanum(@theA))
                action(1)
              else
                action(3)
              end
            end
          else
            action(1)
          end
        end
      end
    end
def jsmin
      @theA = "\n"
      action(3)
      while (@theA != EOF)
        case @theA
        when " "
          if (isAlphanum(@theB))
            action(1)
          else
            action(2)
          end
        when "\n"
          case (@theB)
          when "{","[","(","+","-"
            action(1)
          when " "
            action(3)
          else
            if (isAlphanum(@theB))
              action(1)
            else
              action(2)
            end
          end
        else
          case (@theB)
          when " "
            if (isAlphanum(@theA))
              action(1)
            else
              action(3)
            end
          when "\n"
            case (@theA)
            when "}","]",")","+","-","\"","\\", "'", '"'
              action(1)
            else
              if (isAlphanum(@theA))
                action(1)
              else
                action(3)
              end
            end
          else
            action(1)
          end
        end
      end
    end
jsmin -- Copy the input to the output, deleting the characters which are
 insignificant to JavaScript. Comments will be removed. Tabs will be
 replaced with spaces. Carriage returns will be replaced with linefeeds.
 Most spaces and linefeeds will be removed.