Module Expr Str Import alias Import alias Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body Return BinOpAdd BinOpAdd Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num BinOpMult Str Call NameLoad Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Return ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num BinOpMult Str Call NameLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Return ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore ListLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad While NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Num Assign NameStore BinOpAdd BinOpAdd SubscriptLoad NameLoad Slice NameLoad Str SubscriptLoad NameLoad Slice NameLoad Assign NameStore BinOpAdd BinOpAdd SubscriptLoad NameLoad Slice NameLoad Str SubscriptLoad NameLoad Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str Str Assign NameStore ListLoad Str Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad For NameStore NameLoad body For NameStore NameLoad body If CompareEq NameLoad NameLoad body AugAssignAdd NameStore Num For NameStore NameLoad body If CompareEq NameLoad NameLoad body AugAssignSub NameStore Num Assign NameStore NameLoad If CompareGt NameLoad Num body Assign NameStore NameLoad If BoolOpAnd CompareLt NameLoad Num Call AttributeLoad NameLoad attr NameLoad body Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Num Assign NameStore Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Print NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Str If CompareGt Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore Call NameLoad NameLoad If CompareNotEq NameLoad Num body If NameLoad body Print BinOpAdd BinOpMult Str BinOpMult NameLoad NameLoad NameLoad AugAssignAdd NameStore NameLoad orelse AugAssignAdd NameStore NameLoad Print BinOpAdd BinOpMult Str BinOpMult NameLoad NameLoad NameLoad orelse Print BinOpAdd BinOpMult Str BinOpMult NameLoad NameLoad NameLoad orelse Print Str Assign NameStore NameLoad decorator_list FunctionDef arguments args defaults body If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad Call AttributeLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr attr orelse Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call NameLoad NameLoad Expr Call NameLoad NameLoad Return Num decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Call NameLoad
N/A N/A Pretty-prints the contents of a GYP file. N/A sys N/A re N/A COMMENT_RE N/A N/A re compile \s*#.* N/A QUOTE_RE_STR (?P<q>[\'"])(.*?)(?<![^\\][\\])(?P=q) N/A QUOTE_RE N/A N/A re compile QUOTE_RE_STR comment_replace N/A N/A matchobj N/A N/A N/A N/A N/A N/A N/A matchobj group 1 N/A N/A matchobj group 2 N/A # N/A len N/A N/A matchobj group 3 N/A mask_comments N/A N/A input N/A N/A N/A Mask the quoted strings so we skip braces inside quoted strings. N/A search_re N/A N/A re compile (.*?)(#)(.*) N/A N/A N/A N/A search_re sub comment_replace line N/A line input N/A quote_replace N/A N/A matchobj N/A N/A N/A N/A %s%s%s%s N/A N/A N/A matchobj group 1 N/A N/A matchobj group 2 N/A x N/A len N/A N/A matchobj group 3 N/A N/A matchobj group 2 N/A mask_quotes N/A N/A input N/A N/A N/A Mask the quoted strings so we skip braces inside quoted strings. N/A search_re N/A N/A re compile N/A (.*?) QUOTE_RE_STR N/A N/A N/A N/A search_re sub quote_replace line N/A line input N/A do_split N/A N/A input masked_input search_re N/A N/A N/A output N/A N/A mask_output N/A N/A N/A line masked_line N/A zip input masked_input N/A N/A m N/A N/A search_re match masked_line N/A m N/A N/A split N/A len N/A N/A m group 1 N/A line N/A N/A N/A line N/A split \n N/A line N/A split N/A masked_line N/A N/A N/A masked_line N/A split \n N/A masked_line N/A split N/A m N/A N/A search_re match masked_line N/A N/A N/A output extend N/A N/A line split \n N/A N/A N/A mask_output extend N/A N/A masked_line split \n N/A N/A output mask_output N/A split_double_braces N/A N/A input N/A N/A N/A Masks out the quotes and comments, and then splits appropriate
  lines (lines that matche the double_*_brace re's above) before
  indenting them below.

  These are used to split lines which have multiple braces on them, so
  that the indentation looks prettier when all laid out (e.g. closing
  braces make a nice diagonal line).
   N/A double_open_brace_re N/A N/A re compile (.*?[\[\{\(,])(\s*)([\[\{\(]) N/A double_close_brace_re N/A N/A re compile (.*?[\]\}\)],?)(\s*)([\]\}\)]) N/A masked_input N/A mask_quotes input N/A masked_input N/A mask_comments masked_input N/A N/A output mask_output N/A do_split input masked_input double_open_brace_re N/A N/A output mask_output N/A do_split output mask_output double_close_brace_re N/A output N/A count_braces N/A N/A line N/A N/A N/A keeps track of the number of braces on a given line and returns the result.

  It starts at zero and subtracts for closed braces, and adds for open braces.
   N/A open_braces N/A [ ( { N/A close_braces N/A ] ) } N/A closing_prefix_re N/A N/A re compile (.*?[^\s\]\}\)]+.*?)([\]\}\)],?)\s*$ N/A cnt 0 N/A stripline N/A N/A COMMENT_RE sub line N/A stripline N/A N/A QUOTE_RE sub '' stripline N/A char stripline N/A N/A brace open_braces N/A N/A N/A char brace N/A N/A cnt 1 N/A brace close_braces N/A N/A N/A char brace N/A N/A cnt 1 N/A after False N/A N/A cnt 0 N/A N/A after True N/A N/A N/A cnt 0 N/A N/A closing_prefix_re match stripline N/A N/A after True N/A N/A cnt after N/A prettyprint_input N/A N/A lines N/A N/A N/A Does the main work of indenting the input based on the brace counts. N/A indent 0 N/A basic_offset 2 N/A last_line N/A line lines N/A N/A N/A N/A COMMENT_RE match line N/A N/A line N/A N/A line N/A N/A line strip N/A N/A N/A len line 0 N/A N/A N/A brace_diff after N/A count_braces line N/A N/A brace_diff 0 N/A N/A after N/A N/A N/A N/A N/A basic_offset indent line N/A indent brace_diff N/A N/A indent brace_diff N/A N/A N/A N/A basic_offset indent line N/A N/A N/A N/A N/A basic_offset indent line N/A N/A N/A last_line line N/A main N/A N/A N/A N/A N/A N/A N/A len N/A sys argv 1 N/A N/A data N/A N/A N/A N/A N/A open N/A N/A sys argv N/A 1 read splitlines N/A N/A data N/A N/A N/A N/A N/A sys stdin read splitlines N/A lines N/A split_double_braces data N/A N/A prettyprint_input lines N/A 0 N/A N/A N/A __name__ __main__ N/A N/A N/A N/A sys exit N/A main