Skip to content

Commit e9e290b

Browse files
committed
Removed some options.
1 parent ac05f13 commit e9e290b

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

expand.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,56 +22,39 @@
2222
e.g.)expand.py math segtree
2323
2424
Options:
25-
-c --output-comment output comment
26-
-t --output-test output test code
2725
-h --help print help
2826
'''
2927
output_header = '//https://github.com/rust-lang-ja/ac-library-rs\n'
30-
opt_list = ['output-comment', 'output-test', 'help']
28+
opt_list = ['help']
3129
output_list_all = ('lazysegtree', 'segtree', 'convolution', 'twosat', 'scc',
3230
'fenwicktree', 'math', 'modint', 'maxflow', 'dsu', 'mincostflow', 'string', 'internal_bit', 'internal_math', 'internal_type_traits', 'internal_scc', 'internal_queue')
3331
dependency_list = {'lazysegtree': ('internal_bit',), 'segtree': ('internal_bit',), 'convolution': ('internal_bit', 'modint',), 'math': ('internal_math',), 'modint': (
3432
'internal_math', 'internal_type_traits'), 'fenwicktree': ('internal_type_traits',), 'twosat': ('internal_scc',), 'scc': ('internal_scc',), 'maxflow': ('internal_queue', 'internal_type_traits',), 'mincostflow': ('internal_type_traits',)}
3533
src_path = 'src/'
3634

3735

38-
def output_file(filename, output_comment, output_test):
36+
def output_file(filename):
3937
global src_path
4038

4139
res = []
4240
with open(src_path+filename+'.rs', 'r') as f:
4341
res.append('mod {}{{'.format(filename))
4442

4543
for line in f:
46-
if not output_test and line.strip() == '#[cfg(test)]':
47-
# TODO
48-
# Find more better way.
49-
break
50-
if not output_comment and line.strip().startswith("//"):
51-
# TODO
52-
# Find more better way.
53-
continue
5444
res.append(line.rstrip())
5545

5646
res.append('}')
5747
return res
5848

5949

6050
try:
61-
opts, args = getopt.getopt(sys.argv[1:], 'tch', opt_list)
51+
opts, args = getopt.getopt(sys.argv[1:], 'h', opt_list)
6252
except getopt.GetoptError as e:
6353
print(e)
6454
print(usage)
6555
sys.exit(2)
6656

67-
output_comment = False
68-
output_test = False
69-
7057
for o, v in opts:
71-
if o == '--output-comment' or o == '-c':
72-
output_comment = True
73-
if o == '--output-test' or o == '-t':
74-
output_test = True
7558
if o == '--help' or o == '-h':
7659
print(usage)
7760
sys.exit(0)
@@ -94,7 +77,7 @@ def output_file(filename, output_comment, output_test):
9477

9578
output_data = []
9679
for i in output_list:
97-
buf = output_file(i, output_comment, output_test)
80+
buf = output_file(i)
9881
output_data.extend(buf)
9982

10083
for i in output_list:

0 commit comments

Comments
 (0)