mirror of
https://github.com/mikefarah/yq.git
synced 2026-08-24 08:22:13 +08:00
Lua output fixes (#1811)
* encoder_lua: Handle explicitly positive infinity * encoder_lua: Fix inclusion of pre-/suffix when prettyPrinted It seems certain operations like --prettyPrint or subset selections does not produce a DocumentNode, which is where the lua pre- and suffix was printed, causing those to be omitted. * encoder_lua: Improve Tag handling robustness Using the method call seems more reliable in case the input parser forgets to set the tag.
This commit is contained in:
@@ -135,6 +135,8 @@ numbers:
|
||||
- octal: 0o30
|
||||
- float: 123.45
|
||||
- infinity: .inf
|
||||
plus_infinity: +.inf
|
||||
minus_infinity: -.inf
|
||||
- not: .nan
|
||||
`,
|
||||
expected: `return {
|
||||
@@ -161,6 +163,8 @@ numbers:
|
||||
},
|
||||
{
|
||||
["infinity"] = (1/0);
|
||||
["plus_infinity"] = (1/0);
|
||||
["minus_infinity"] = (-1/0);
|
||||
},
|
||||
{
|
||||
["not"] = (0/0);
|
||||
|
||||
Reference in New Issue
Block a user