summaryrefslogtreecommitdiff
path: root/examples/dynamic_dispatch_table.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dynamic_dispatch_table.lua')
-rw-r--r--examples/dynamic_dispatch_table.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/dynamic_dispatch_table.lua b/examples/dynamic_dispatch_table.lua
index 4d94fa2..38b8bae 100644
--- a/examples/dynamic_dispatch_table.lua
+++ b/examples/dynamic_dispatch_table.lua
@@ -1,16 +1,16 @@
local get_length_table = {
- [".."] = function(match)
- local bytes = string.byte(match, 1, 2)
- local length = bytes[1] * 256^2 + bytes[2] -- TODO byte order?
- local get_binary_data_table = {
- [string.rep(".", length)] = function(match)
- command_queue:enqueue(match)
- dispatch_table:register_handler_table(get_length_table)
- end
- }
-
- dispatch_table:register_handler_table(get_binary_data_table)
- end
+ [".."] = function(match)
+ local bytes = string.byte(match, 1, 2)
+ local length = bytes[1] * 256^2 + bytes[2] -- TODO byte order?
+ local get_binary_data_table = {
+ [string.rep(".", length)] = function(match)
+ command_queue:enqueue(match)
+ dispatch_table:register_handler_table(get_length_table)
+ end
+ }
+
+ dispatch_table:register_handler_table(get_binary_data_table)
+ end
}
local responses = {