mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 05:35:31 +00:00
091500b7b4
You can now call to_source() on Expansion, StringExpansion, Function (and derived), Statement (and derived), Condition (and derived), and StatementList to obtain make "source code" for that entity. This means you can write out make files by constructing an appropriate set of Statement instances. This also implements __eq__ and __ne__ on all of the above. This is being used in the tests to verify that the reformatting code works properly (produces an equivalent StatementList). khuey gave permission to land without review. --HG-- extra : rebase_source : ffc16e930279fc4a6978117efabf5483d7087b53
14 lines
237 B
Python
Executable File
14 lines
237 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import sys
|
|
import pymake.parser
|
|
|
|
filename = sys.argv[1]
|
|
source = None
|
|
|
|
with open(filename, 'rU') as fh:
|
|
source = fh.read()
|
|
|
|
statements = pymake.parser.parsestring(source, filename)
|
|
print statements.to_source()
|