diff options
author | Mike Pall <mike> | 2010-01-05 22:07:54 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-01-05 22:07:54 +0100 |
commit | 9df01f96b960c1db9fd123a14a443614aa4ac30c (patch) | |
tree | e17b64b346bd63c786a217ac34323d30ad98751e | |
parent | 93ee10642e285f972daff59492c05aa04dc2aa86 (diff) | |
download | luajit-9df01f96b960c1db9fd123a14a443614aa4ac30c.tar.gz luajit-9df01f96b960c1db9fd123a14a443614aa4ac30c.tar.bz2 luajit-9df01f96b960c1db9fd123a14a443614aa4ac30c.zip |
Allow @ in DynASM globals.
-rw-r--r-- | dynasm/dasm_x86.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dynasm/dasm_x86.lua b/dynasm/dasm_x86.lua index d985e3ff..26a52bbd 100644 --- a/dynasm/dasm_x86.lua +++ b/dynasm/dasm_x86.lua | |||
@@ -173,7 +173,7 @@ end | |||
173 | -- Global label name -> global label number. With auto assignment on 1st use. | 173 | -- Global label name -> global label number. With auto assignment on 1st use. |
174 | local next_global = 10 | 174 | local next_global = 10 |
175 | local map_global = setmetatable({}, { __index = function(t, name) | 175 | local map_global = setmetatable({}, { __index = function(t, name) |
176 | if not match(name, "^[%a_][%w_]*$") then werror("bad global label") end | 176 | if not match(name, "^[%a_][%w_@]*$") then werror("bad global label") end |
177 | local n = next_global | 177 | local n = next_global |
178 | if n > 246 then werror("too many global labels") end | 178 | if n > 246 then werror("too many global labels") end |
179 | next_global = n + 1 | 179 | next_global = n + 1 |
@@ -198,7 +198,7 @@ local function writeglobals(out, prefix) | |||
198 | for name, n in pairs(map_global) do t[n] = name end | 198 | for name, n in pairs(map_global) do t[n] = name end |
199 | out:write("enum {\n") | 199 | out:write("enum {\n") |
200 | for i=10,next_global-1 do | 200 | for i=10,next_global-1 do |
201 | out:write(" ", prefix, t[i], ",\n") | 201 | out:write(" ", prefix, gsub(t[i], "@.*", ""), ",\n") |
202 | end | 202 | end |
203 | out:write(" ", prefix, "_MAX\n};\n") | 203 | out:write(" ", prefix, "_MAX\n};\n") |
204 | end | 204 | end |