diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-10 18:31:54 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-10 18:31:54 -0800 |
commit | f4e239ed21d9f6ea79693f003f2d595143937108 (patch) | |
tree | 46d76486555b1396c724b3d73e89a6766357ddc8 /tools | |
parent | 41e3ba8e82863a75d3b81fdad9ebef319a4ac652 (diff) |
fix fix_closure bug
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/fix_closure.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/fix_closure.py b/tools/fix_closure.py index c1d16cb7..086dddfa 100755 --- a/tools/fix_closure.py +++ b/tools/fix_closure.py @@ -22,6 +22,7 @@ class ObjectParser: ''' assert line[s-1] == ',' # we are a new element, after a comma curly = 0 + paren = 0 string = 0 is_func = 0 i = s @@ -35,7 +36,11 @@ class ObjectParser: curly += 1 elif c == '}': curly -= 1 - elif not curly: + elif c == '(': + paren += 1 + elif c == ')': + paren -= 1 + elif not curly and not paren: if c in [',', ']']: return (i, is_func and line[s:i].startswith('function(')) else: |