mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
a0f00e28c3
git-svn-id: https://svn.eduke32.com/eduke32@3856 1a8010ca-5511-0410-912e-c29ae57300e0
17 lines
590 B
Bash
Executable file
17 lines
590 B
Bash
Executable file
#!/bin/sh
|
|
|
|
if [ -z "$1" ]; then
|
|
# S or G can be used to display SETGLOBALs or GETGLOBALs, respectively
|
|
echo "Usage: $0 <file.lua> [S|G]"
|
|
exit 1;
|
|
fi
|
|
|
|
# Lua 5.2 required to parse ::label:: / goto generated by LunaCON.
|
|
LUAC=luac
|
|
|
|
# Strip LuaJIT specific syntax first. Run luac and extract interesting lines.
|
|
sed -r -e "s/[0-9]+U?LL/0/g" "$1" | $LUAC -p -l - | grep "$2ETTABUP.*; _ENV " |
|
|
# Reformat them.
|
|
sed -e 's/.*\[\(.*\)\].*\([SG]ET\)TABUP.*"\(.*\)".*/\1: \2 \3/' |
|
|
# Mark where the new module environment starts.
|
|
sed -e 's/GET module/& ____________________/'
|