Mercurial > hg > Papers > 2015 > atton-thesis
annotate paper/replace_agda.rb @ 78:6f699b37dc55
Add original number count
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 18 Feb 2015 12:26:17 +0900 (2015-02-18) |
parents | 1181b4facaf9 |
children |
rev | line source |
---|---|
36 | 1 #!/usr/bin/env ruby |
2 | |
3 replace_table = { | |
45
12c5e455fe55
Writing description proofs of monad-laws for delta
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
42
diff
changeset
|
4 '->' => 'rightarrow', |
41
8fc2ac1f901f
Add delta definition in agda
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
5 '∙' => 'circ', |
42
4cc65012412f
Add proofs of functor-laws on delta
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
41
diff
changeset
|
6 '≡' => 'equiv', |
41
8fc2ac1f901f
Add delta definition in agda
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
7 '×' => 'times', |
8fc2ac1f901f
Add delta definition in agda
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
8 '⟨' => 'langle', |
8fc2ac1f901f
Add delta definition in agda
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
9 '⟩' => 'rangle', |
8fc2ac1f901f
Add delta definition in agda
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
10 '∎' => 'blacksquare' |
36 | 11 } |
12 footer = '.replaced' | |
13 | |
14 sources = Dir.glob('src/*.agda') | |
15 | |
16 sources.each do |src| | |
17 code = File.read(src) | |
18 | |
19 replace_table.each do |k, v| | |
20 code = code.gsub(k, "@$\\#{v}$@" ) | |
21 end | |
22 | |
23 File.write(src+footer , code) | |
24 end |