From f544580692129ff5065166779411e3c380472e1e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 2 Aug 2023 12:10:21 +0200 Subject: [PATCH] Add note about how Lua nil is unsuitable as table key Could add some context tracking in the future to allow rejecting nil in a table key context. --- pkg/yqlib/encoder_lua.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/yqlib/encoder_lua.go b/pkg/yqlib/encoder_lua.go index ee4d360b..b79d18e8 100644 --- a/pkg/yqlib/encoder_lua.go +++ b/pkg/yqlib/encoder_lua.go @@ -175,6 +175,7 @@ func (le *luaEncoder) encodeAny(writer io.Writer, node *yaml.Node) error { case "!!str": return le.encodeString(writer, node) case "!!null": + // TODO reject invalid use as a table key return writeString(writer, "nil") case "!!bool": // Yaml 1.2 has case variation e.g. True, FALSE etc but Lua only has