Last change
on this file was
1055,
checked in by dubos, 4 years ago
|
Simplify base/field.f90 to reduce repetitive code
Generate remaining repetitive code in base/field.f90 and parallel/transfert_mpi_collectives from a template
|
-
Property svn:executable set to
*
|
File size:
648 bytes
|
Line | |
---|
1 | #!/bin/env bash |
---|
2 | # Usage : |
---|
3 | # 1) render |
---|
4 | # 2) render indent FILE |
---|
5 | # 3) render ascii FILE |
---|
6 | |
---|
7 | function cmd_indent() |
---|
8 | { |
---|
9 | ACTIONS='(f90-mode) (indent-region (point-min) (point-max) nil) (delete-trailing-whitespace)' |
---|
10 | emacs -batch $1 --eval "(progn $ACTIONS)" -f save-buffer 2>/dev/null |
---|
11 | } |
---|
12 | |
---|
13 | function cmd_ascii() |
---|
14 | { |
---|
15 | TMP=$(mktemp) |
---|
16 | iconv -f utf-8 -t ascii//translit $1 > $TMP || exit |
---|
17 | cp $TMP $1 |
---|
18 | } |
---|
19 | |
---|
20 | function cmd_() |
---|
21 | { |
---|
22 | TMP=$(mktemp) |
---|
23 | for x in $(cd jsrc ; find . -name "*.?90") ; do |
---|
24 | wc jsrc/$x |
---|
25 | jsrc/jinja2 jsrc/$x > $TMP |
---|
26 | cmd_indent $TMP |
---|
27 | cmp -s $TMP src/$x || cp $TMP src/$x |
---|
28 | wc src/$x |
---|
29 | done |
---|
30 | rm -f $TMP |
---|
31 | } |
---|
32 | |
---|
33 | CMD=$1 ; shift |
---|
34 | cmd_$CMD $* |
---|
35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.