aboutsummaryrefslogtreecommitdiff
path: root/parse_spec.lua
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-05-29 23:09:53 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-05-29 23:09:53 +0200
commite8c35eb2780cf17890f2905f44d1a1d170c40b37 (patch)
treed5e80c11f6ca1f46eb1ae3aa88a3e2c8e2507597 /parse_spec.lua
parent535595e9823f020b8f02ae657f259966814d1906 (diff)
downloadhydra-dragonfire-e8c35eb2780cf17890f2905f44d1a1d170c40b37.tar.xz
Implement sending of packets
Diffstat (limited to 'parse_spec.lua')
-rw-r--r--parse_spec.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/parse_spec.lua b/parse_spec.lua
index 449360c..588f4d7 100644
--- a/parse_spec.lua
+++ b/parse_spec.lua
@@ -9,7 +9,7 @@ local function snext(t, state)
end
end
table.sort(t.__sorted)
-
+
key = t.__sorted[1]
else
for i, v in ipairs(t.__sorted) do
@@ -41,7 +41,7 @@ local function parse_pair(pair, value_first)
if idx then
local first, second = pair:sub(1, idx - 1), pair:sub(idx + 1)
- if value_first and first:sub(1, 1) ~= "[" then
+ if value_first and first:sub(1, 1) ~= "{" then
return second, first
else
return first, second
@@ -103,3 +103,6 @@ function camel_case(snake)
return camel
end
+function apply_prefix(fields, str)
+ return (fields.prefix or "") .. camel_case(str) .. (fields.postfix or "")
+end