File: const-proc.lua

package info (click to toggle)
luxio 12-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 408 kB
  • ctags: 461
  • sloc: ansic: 3,109; makefile: 138; sh: 24
file content (16 lines) | stat: -rwxr-xr-x 336 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env lua

local ln = 0

for l in io.lines() do
   ln = ln + 1
   if l:sub(1, 1) == "?" then
      local var = l:match "E%((.*)%)"
      if var == nil then
	 io.stderr:write(("unable to parse line %d\n"):format(ln))
	 os.exit(1)
      end
      l = ("#ifdef %s\n        E(%s),\n#endif"):format(var, var)
   end
   print(l)
end