diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-07-24 15:34:30 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-07-24 15:34:30 -0700 |
commit | cebc0da5f6ddaf170d458d2c68d4bbd3cee210d5 (patch) | |
tree | c3af0a9eff809c185426f7fc3e78c51100c170b3 /tools/bindings_generator.py | |
parent | 8897795d333e197666574b21120d2044a5abf938 (diff) |
improve bindings processor support to modify multi-line patterns
Diffstat (limited to 'tools/bindings_generator.py')
-rwxr-xr-x | tools/bindings_generator.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/bindings_generator.py b/tools/bindings_generator.py index 191e7adf..5f3c3ab3 100755 --- a/tools/bindings_generator.py +++ b/tools/bindings_generator.py @@ -47,7 +47,7 @@ import CppHeaderParser basename = sys.argv[1] -processor = lambda line: line +processor = lambda text: text ignored = [] if '--' in sys.argv: @@ -62,13 +62,14 @@ if '--' in sys.argv: classes = {} struct_parents = {} +text = '' +for header in sys.argv[2:]: + text += '//// ' + header + '\n' + text += open(header, 'r').read() all_h_name = basename + '.all.h' all_h = open(all_h_name, 'w') -for header in sys.argv[2:]: - all_h.write('//// ' + header + '\n') - all_h.write(processor(open(header, 'r').read())) - +all_h.write(processor(text)) all_h.close() parsed = CppHeaderParser.CppHeader(all_h_name) |