-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate-file-list.rb
executable file
·298 lines (261 loc) · 4.72 KB
/
generate-file-list.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#!/usr/bin/env ruby
require 'stringio'
def usage
puts "usage: THIS_SCRIPT [smlnj|mlton|Makefile]"
end
def wrong_arguments
puts "wrong arguments"
usage
exit 1
end
if ARGV.size < 1 || ARGV.size > 2 then
wrong_arguments
end
target = ARGV[0]
is_unit_test = false
if target == "smlnj" then
target = :smlnj
elsif target == "mlton" then
target = :mlton
if ARGV.size >= 2 then
if ARGV[1] == "unit-test"
is_unit_test = true
else
wrong_arguments
end
end
elsif target == "Makefile" then
target = :Makefile
elsif target == "unit-test" then
target = :unit_test
else
wrong_arguments
end
captured_stdio = StringIO.new('', 'w')
old_stdout = $stdout
$stdout = captured_stdio
if target == :smlnj then
print %{
Group is
cont-smlnj.sml
}
elsif target == :mlton then
print %{
$(SML_LIB)/basis/basis.mlb
$(SML_LIB)/basis/build/sources.mlb
$(SML_LIB)/mlyacc-lib/mlyacc-lib.mlb
$(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
$(SML_LIB)/smlnj-lib/PP/pp-lib.mlb
}
end
if target == :mlton || target == :Makefile then
print %{
cont-mlton.sml
}
end
print %{
enumerator.sml
util.sml
ord-key-util.sml
list-pair-map.sml
set-util.sml
map-util.sml
unique-map.sml
region.sml
time.sml
operators.sml
pp-util.sml
error-code.sml
parser/ast.sml
parser/ast-pp.sml
parser/parser-util.sml
sexp/sexp.sml
}
if target == :smlnj || target == :Makefile then
print %{
sexp/sexp.grm
sexp/sexp.lex
parser/timl.grm
parser/timl.lex
parser/etiml.grm
parser/etiml.lex
}
elsif target == :mlton then
print %{
sexp/sexp.grm.sig
sexp/sexp.grm.sml
sexp/sexp.lex.sml
parser/timl.grm.sig
parser/timl.grm.sml
parser/timl.lex.sml
parser/etiml.grm.sig
parser/etiml.grm.sml
parser/etiml.lex.sml
}
end
print %{
sexp/parser.sml
parser/parser.sml
parser/etiml-parser.sml
parser/parser-factory.sml
cont-util.sml
module-context.sml
to-string-util.sml
long-id.sml
uvar.sig
base-sorts.sml
bind.sml
visitor-util.sml
unbound.sml
idx.sig
idx-visitor.sml
idx.sml
shift-util.sml
idx-trans.sml
type.sig
type-visitor.sml
type.sml
type-trans.sml
pattern.sml
pattern-visitor.sml
hyp.sml
expr.sig
expr-util.sml
expr-visitor.sml
expr-fn.sml
get-region.sml
base-types.sml
idx-util.sml
type-util.sml
idx-type-expr.sig
idx-type-expr-fn.sml
expr-trans.sml
simp.sml
simp-type.sml
vc.sml
equal.sml
subst.sml
long-id-subst.sml
export.sml
to-string-raw.sml
to-string-nameful.sml
to-string.sml
pp-nameful.sml
pretty-print.sml
uvar.sml
uniquefy.sml
expr.sml
underscore-exprs.sml
pervasive.sml
elaborate.sml
name-resolve.sml
package.sml
typecheck-util.sml
normalize.sml
simp-expr.sml
collect-var.sml
collect-uvar.sml
parallel-subst.sml
fresh-uvar.sml
uvar-forget.sml
unify.sml
redundant-exhaust.sml
collect-mod.sml
subst-uvar.sml
update-expr.sml
sortcheck.sml
topo-sort-fn.sml
compiler/evm-costs.sml
compiler/micro-timl-costs.sml
cost-util.sml
free-evars.sml
live-vars.sml
compiler/pattern-ex.sml
typecheck-main.sml
trivial-solver.sml
derived-trans.sml
unpackage.sml
post-typecheck.sml
typecheck.sml
smt2-printer.sml
smt-solver.sml
long-id-map.sml
bigO-solver.sml
simp-ctx.sml
nouvar-expr.sml
visitor.sml
parse-filename.sml
vc-solver.sml
remove-open.sml
merge-modules.sml
cost-debug.sml
compiler/micro-timl.sml
compiler/micro-timl-visitor.t.sml
compiler/micro-timl-long-id.sml
compiler/micro-timl-visitor2.sml
compiler/micro-timl-util.sml
compiler/micro-timl-pp.sml
compiler/post-process.sml
compiler/export-pp.sml
compiler/micro-timl-util-timl.sml
compiler/timl-to-micro-timl.sml
compiler/eval-constr.sml
compiler/micro-timl-live-vars.sml
compiler/micro-timl-simp.sml
compiler/micro-timl-free-evars.sml
compiler/micro-timl-typecheck.sml
compiler/micro-timl-locally-nameless.sml
compiler/compiler-util.sml
compiler/cps.sml
compiler/anf.sml
compiler/cc.sml
# compiler/pair-alloc.sml
# compiler/tital.sml
# compiler/tital-visitor.sml
# compiler/tital-pp.sml
# compiler/tital-export-pp.sml
# compiler/tital-tc.sml
# compiler/tital-eval.sml
# compiler/code-gen.sml
compiler/evm1.sml
compiler/evm1-other-names.sml
compiler/evm1-visitor.sml
compiler/evm1-pp.sml
compiler/evm1-export-pp.sml
compiler/evm1-util.sml
compiler/evm1-tc.sml
compiler/evm1-assemble.sml
compiler/evm1-simp.sml
compiler/evm-prelude.sml
compiler/evm-debug-log.sml
compiler/to-evm1.sml
unit-test.sml
main.sml
}
if target == :smlnj then
print %{
$/basis.cm
$/smlnj-lib.cm
$/ml-yacc-lib.cm
$/pp-lib.cm
}
elsif target == :Makefile then
print %{
mlton-main.sml
unit-test/unit-test-util.sml
}
elsif target == :mlton then
if is_unit_test then
print %{
unit-test/unit-test-util.sml
}
else
print %{
mlton-main.sml
}
end
end
$stdout = old_stdout
output = captured_stdio.string
output.gsub!(/#.*/, '')
print output