swh:1:snp:0e3a7a90b5b85feca1ee6285ebc0301d2b85deae
Tip revision: f938f3815f806f96b58417a9fb91ad0e5df8f7cc authored by François Dupressoir on 24 March 2022, 15:55:56 UTC
Tighten the ROM bad call results
Tighten the ROM bad call results
Tip revision: f938f38
dune-lib
#! /usr/bin/env python3
# --------------------------------------------------------------------
import sys, os
# --------------------------------------------------------------------
def _main():
if len(sys.argv)-1 != 1:
print(f'Usage: {sys.argv[0]} [theory directory]')
exit(1)
thdir = sys.argv[1]
theories = []
for root, _, files in os.walk(thdir):
for fname in files:
if os.path.splitext(fname)[1] in ('.ec', '.eca'):
theories.append(os.path.relpath(os.path.join(root, fname), thdir))
theories = sorted(theories)
namemax = max(0, *(len(x) for x in theories))
print('(install')
print(' (section (site (easycrypt theories)))')
print(' (files')
for theory in theories:
print(f' ({theory:{namemax}} as {theory})')
print(' )')
print(')')
# --------------------------------------------------------------------
if __name__ == '__main__':
_main()