Arquivos
hhvm/hphp/compiler/expression/fix.py
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00

21 linhas
480 B
Python

#!/usr/bin/python
import re
import sys
regex = re.compile(r'(\w+)::\1(\s*)\((.*)\)(\s*):(\s*)Expression\(EXPRESSION_CONSTRUCTOR_PARAMETER_VALUES\)', re.M | re.S)
def fix_file(file):
global regex
fp = open(file, 'r')
contents = fp.read()
rep = regex.sub(r'\1::\1\2(\3)\4:\5Expression(EXPRESSION_CONSTRUCTOR_PARAMETER_VALUES(\1))',
contents)
fp.close()
fp = open(file, 'w')
fp.write(rep)
fp.close()
for fname in sys.argv[1:]:
fix_file(fname)