File: do_const.awk

package info (click to toggle)
ocamlgsl 0.3.5-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,444 kB
  • ctags: 2,901
  • sloc: ml: 7,956; ansic: 6,796; makefile: 303; sh: 87; awk: 13
file content (16 lines) | stat: -rwxr-xr-x 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)
}