File: do_const.awk

package info (click to toggle)
ocamlgsl 0.6.0-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 4,028 kB
  • ctags: 3,090
  • sloc: ml: 8,539; ansic: 7,338; makefile: 261; sh: 149; awk: 13
file content (16 lines) | stat: -rw-r--r-- 300 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

BEGIN {
  print "(** Values of physical constants *)\n"
  if (ARGV[1] == "--mli") {
    MLI=1
    delete ARGV[1]
  }
}

/^#define GSL_CONST_/ {
  if (MLI)
    printf "val %s : float\n", tolower(substr($2,11))
  else
    printf "let %s = %s\n", tolower(substr($2,11)), substr($3,2,length($3)-2)
}