-
Notifications
You must be signed in to change notification settings - Fork 6
/
generate-file-list.rb
executable file
·220 lines (189 loc) · 3.22 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
#!/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 then
wrong_arguments
end
target = ARGV[0]
if target == "smlnj" then
target = :smlnj
elsif target == "mlton" then
target = :mlton
elsif target == "Makefile" then
target = :Makefile
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
string-key.sml
list-pair-map.sml
set-util.sml
map-util.sml
unique-map.sml
region.sml
time.sml
operators.sml
}
if target == :smlnj || target == :Makefile then
print %{
sexp/sexp.sml
sexp/sexp.grm
sexp/sexp.lex
sexp/parser.sml
parser/ast.sml
parser/timl.grm
parser/timl.lex
parser/parser.sml
}
elsif target == :mlton then
print %{
sexp/sexp.sml
sexp/sexp.grm.sig
sexp/sexp.grm.sml
sexp/sexp.lex.sml
sexp/parser.sml
parser/ast.sml
parser/timl.grm.sig
parser/timl.grm.sml
parser/timl.lex.sml
parser/parser.sml
}
end
print %{
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-visitor.sml
expr-fn.sml
get-region.sml
base-types.sml
idx-util.sml
type-util.sml
expr-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
uvar.sml
expr.sml
underscore-exprs.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
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
pp-util.sml
micro-timl/micro-timl.sml
nouvar-expr.sml
visitor.sml
parse-filename.sml
micro-timl/micro-timl-visitor.sml
micro-timl/micro-timl-pp.sml
micro-timl/micro-timl-ex.sml
micro-timl/micro-timl-ex-pp.sml
micro-timl/pattern-ex.sml
micro-timl/micro-timl-ex-util.sml
micro-timl/micro-timl-ex-long-id.sml
micro-timl/post-process.sml
remove-open.sml
merge-modules.sml
micro-timl/timl-to-micro-timl.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 == :mlton || target == :Makefile then
print %{
mlton-main.sml
}
end
$stdout = old_stdout
output = captured_stdio.string
output.gsub!(/#.*/, '')
print output