�� 9#kKc�����������@���s,���d��Z��d�d�k�Z�d�e�f�d�������YZ�d�S(���s���A JavaScript minifier. It is far from being a complete JS parser, so there are many valid JavaScript programs that will be ruined by it. Another strangeness is that it accepts $ and % as parts of identifiers. It doesn't merge lines or strip out blank lines in order to ease debugging. Variables at the top scope are properties of the global object so we can't rename them. It is assumed that you introduce variables with var as if JavaScript followed C++ scope rules around curly braces, so the declaration must be above the first use. Use as: import jsmin minifier = JavaScriptMinifier() program1 = minifier.JSMinify(program1) program2 = minifier.JSMinify(program2) i����Nt���JavaScriptMinifierc�����������B���s_���e��Z�d��Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z �d����Z �d ����Z�RS( ���sB���An object that you can feed code snippets to to get them minified.c���������C���s?���h�t��d�6t��d�6|��_�d�|��_�t�|��_�h��|��_�d�|��_�d��S(���Nt���dot���ini����(���t���Truet���seen_identifierst���identifier_countert���Falset ���in_commentt���mapt���nesting(���t���self(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���__init__5���s ���� c���������C���s ���|�i��d���}�t�|��i�|�<d�S(���s����Records identifiers or keywords that we see in use. (So we can avoid renaming variables to these strings.) Args: m: The match object returned by re.search. Returns: Nothing. i���N(���t���groupR���R���(���R ���t���mt ���identifier(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���LookAtIdentifier?���s���� c���������C���s���|��i��d�7_��d�S(���s���Called when we encounter a '{'.i���N(���R ���(���R ���(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���PushL���s����c���������C���s9���|��i��d�8_��|��i��d�j�o�h��|��_�d�|��_�n�d�S(���s���Called when we encounter a '}'.i���i����N(���R ���R���R���(���R ���(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���PopP���s���� c���������C���sQ��|�i��d���}�|�d�j�o�|��i����|�S|�d�j�o�|��i����|�St�i�d�|���o�|�St�i�d�|���}�|�o@�|�|�i����}�t�i�d�|���}�d�d�i�t�|��i �|�����St�i�d�|���}�|�o`�|�i��d���}�|�i��d ���}�t�i�d�|���}�|��i����|�d �d�i�t�|��i �|�����d�S|�|��i�j�o�|��i�|�S|�S(���s���Rewrites bits of the program selected by a regexp. These can be curly braces, literal strings, function declarations and var declarations. (These last two must be on one line including the opening curly brace of the function for their variables to be renamed). Args: m: The match object returned by re.search. Returns: The string that should replace the match in the rewritten program. i����t���{t���}s���["'/]s���var t���,s���(function\b[^(]*)\((.*)\)\{$i���i���t���(s���){( ���R���R���R���t���ret���matcht���endt���splitt���joinR���t���FindNewName(���R ���R ���t���matched_textt ���var_namest ���up_to_argst���args(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���DeclarationY���s0���� &c���������C���s4���|�d�j��o�t��|�d���S|�d�8}�t��|�d���S(���s-���A single-digit base-52 encoding using a-zA-Z.i���ia���iA���(���t���chr(���R ���t���number(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���CharFromNumber����s���� c���������C���s����d�}�|�|��i��j�o�|��i��|�S|��i�d�j�o�|�Sx��t�oy�|��i�d�}�|��i�d�}�|��i�|���}�|�d�j�o�|��i�|�d���|�}�n�|��i�d�7_�|�|��i�j�o�Pq:�q:�W|�|��i��|�<|�S(���s����Finds a new 1-character or 2-character name for a variable. Enters it into the mapping table for this scope. Args: var_name: The name of the variable before renaming. Returns: The new name of the variable. t����i����i4���i���(���R���R ���R���R���R#���R���(���R ���t���var_namet���new_identifiert���identifier_first_chart���identifier_second_char(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyR�������s"����� c���������C���sj���|�i��d���}�|�i��d���}�t�i�d�|���o�|�St�i�d�|���o�|�St�i�d�|���o�|�S|�S(���sQ��Returns literal strings unchanged, replaces other inputs with group 2. Other inputs are replaced with the contents of capture 1. This is either a single space or an empty string. Args: m: The match object returned by re.search. Returns: The string that should be inserted instead of the matched text. i����i���s���'.*'$s���".*"$s���/.+/$(���R���R���R���(���R ���R ���t���entire_matcht���replacement(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���RemoveSpaces����s����c������ ���C���sA��g��}�x't��i�d�|���D]}�|�i�d�d���}�|��i�oJ�t��i�d�|���}�|�o�|�|�i����}�t�|��_�q��|�i�d���q�n�|��i�pd�t��i�d�d�|���}�t��i�d�d�|���}�t��i�d�|���}�|�o�|�|�i ���� }�t �|��_�q��n�t��i�d �d�|���}�t��i�d �d�|���}�d�}�d�}�d �}�t��i�d�i�|�|�|�d�g���|��i�|���}�t��i�d�i�|�|�|�d�g���|��i�|���}�|��i �d�j�o�t��i�d�|��i�|���n�d�}�t��i�d�|���o �d�} �n�d�} �d�| �} �t��i�d�i�|�|�|�d�d�d�|�| �g���|��i�|���}�|�i�|���q�Wd�i�|���d�S(���sC��The main entry point. Takes a text and returns a compressed version. The compressed version hopefully does the same thing. Line breaks are preserved. Args: text: The text of the code snippet as a multiline string. Returns: The compressed text of the code snippet as a multiline string. s���\ns��� t��� s���\*/R$���s ���/\*.*?\*/s���//.*s���/\*s���^ +s��� +$s���"(?:[^"\\]|\\.)*"s���'(?:[^'\\]|\\.)*'s/���/(?:(?=\()|(?:[^()/\\]|\\.)+)(?:\([^/\\]|\\.)*/t���|s���( )+s*���(?<![a-zA-Z_0-9$%]) | (?![a-zA-Z_0-9$%])()i����s���([a-zA-Z0-9_$%]+)s#���\bfunction( [\w$%]+)?\([\w$%,]+\)\{s���\?s���(?![:\w$%])s���(?<![.\w$%])[\w$%]+s���\{s���\}s���\bvar [\w$%,]+s��� (���R���R���t���replaceR���t���searchR���R���t���appendt���subt���startR���R���R+���R ���R���R ���(���R ���t���textt ���new_linest���lineR ���t���double_quoted_stringt���single_quoted_stringt���slash_quoted_regexpt���function_declaration_regexpt���block_trailing_colont���variable_use_regexp(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���JSMinify����sl����� (���t���__name__t ���__module__t���__doc__R���R���R���R���R ���R#���R���R+���R<���(����(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyR����2���s��� ( ! (���R?���R���t���objectR����(����(����(����sI���/Users/cowboyd/Projects/therubyracer/ext/v8/upstream/2.0.6/tools/jsmin.pyt���<module>-���s���