Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Compilers

    SlimIt 0.7.3

    Download button

    No screenshots available
    Downloads: 230  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Ruslan Spivak | More programs
    MIT/X Consortium Lic... / FREE
    May 22nd, 2012, 19:29 GMT [view history]
    ROOT / Programming / Compilers

     Read user reviews (0)  Refer to a friend  Subscribe

    SlimIt description

    JavaScript minifier

    SlimIt is a JavaScript minifier written in Python. The project compiles JavaScript into more compact code so that it downloads and runs faster.

    Using lexer in your project

    >>> from slimit.lexer import Lexer
    >>> lexer = Lexer()
    >>> lexer.input('a = 1;')
    >>> for token in lexer:
    ... print token
    ...
    LexToken(ID,'a',1,0)
    LexToken(EQ,'=',1,2)
    LexToken(NUMBER,'1',1,4)
    LexToken(SEMI,';',1,5)


    You can get one token at a time using token method:

    >>> lexer.input('a = 1;')
    >>> while True:
    ... token = lexer.token()
    ... if not token:
    ... break
    ... print token
    ...
    LexToken(ID,'a',1,0)
    LexToken(EQ,'=',1,2)
    LexToken(NUMBER,'1',1,4)
    LexToken(SEMI,';',1,5)


    LexToken instance has different attributes:

    >>> lexer.input('a = 1;')
    >>> token = lexer.token()
    >>> token.type, token.value, token.lineno, token.lexpos
    ('ID', 'a', 1, 0)


    Installation:

    Using pip:

    sudo pip install slimit

    Using easy_install:

    sudo easy_install slimit


    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Bug fix (unary op in FOR init): https://github.com/rspivak/slimit/pull/33

      


    TAGS:

    JavaScript minifier | JavaScript lexer | JavaScript compiler | JavaScript | minifier | lexer



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM