diff options
Diffstat (limited to 'dynasm/dynasm.lua')
-rw-r--r-- | dynasm/dynasm.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dynasm/dynasm.lua b/dynasm/dynasm.lua index d9dd1800..da94744e 100644 --- a/dynasm/dynasm.lua +++ b/dynasm/dynasm.lua | |||
@@ -723,8 +723,10 @@ local function splitstmt_one(c) | |||
723 | splitlvl = ")"..splitlvl | 723 | splitlvl = ")"..splitlvl |
724 | elseif c == "[" then | 724 | elseif c == "[" then |
725 | splitlvl = "]"..splitlvl | 725 | splitlvl = "]"..splitlvl |
726 | elseif c == ")" or c == "]" then | 726 | elseif c == "{" then |
727 | if sub(splitlvl, 1, 1) ~= c then werror("unbalanced () or []") end | 727 | splitlvl = "}"..splitlvl |
728 | elseif c == ")" or c == "]" or c == "}" then | ||
729 | if sub(splitlvl, 1, 1) ~= c then werror("unbalanced (), [] or {}") end | ||
728 | splitlvl = sub(splitlvl, 2) | 730 | splitlvl = sub(splitlvl, 2) |
729 | elseif splitlvl == "" then | 731 | elseif splitlvl == "" then |
730 | return " \0 " | 732 | return " \0 " |
@@ -740,7 +742,7 @@ local function splitstmt(stmt) | |||
740 | 742 | ||
741 | -- Split at commas and equal signs, but obey parentheses and brackets. | 743 | -- Split at commas and equal signs, but obey parentheses and brackets. |
742 | splitlvl = "" | 744 | splitlvl = "" |
743 | stmt = gsub(stmt, "[,%(%)%[%]]", splitstmt_one) | 745 | stmt = gsub(stmt, "[,%(%)%[%]{}]", splitstmt_one) |
744 | if splitlvl ~= "" then werror("unbalanced () or []") end | 746 | if splitlvl ~= "" then werror("unbalanced () or []") end |
745 | 747 | ||
746 | -- Split off opcode. | 748 | -- Split off opcode. |
@@ -783,7 +785,7 @@ dostmt = function(stmt) | |||
783 | if not f then | 785 | if not f then |
784 | if not g_arch then wfatal("first statement must be .arch") end | 786 | if not g_arch then wfatal("first statement must be .arch") end |
785 | -- Improve error report. | 787 | -- Improve error report. |
786 | for i=0,16 do | 788 | for i=0,9 do |
787 | if map_op[op.."_"..i] then | 789 | if map_op[op.."_"..i] then |
788 | werror("wrong number of parameters for `"..op.."'") | 790 | werror("wrong number of parameters for `"..op.."'") |
789 | end | 791 | end |