mirror of
https://github.com/google/go-jsonnet.git
synced 2025-09-29 17:31:02 +02:00
Update to cpp jsonnet
This commit is contained in:
parent
6efde9677d
commit
0b46b25f0f
17423
ast/stdast.go
17423
ast/stdast.go
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
|||||||
Subproject commit 0759409780eec8cb3a7a8ced52f104c0d895ac38
|
Subproject commit 8b115c435efa273f45711534b361e847f25f94a7
|
@ -86,7 +86,6 @@ func (s *dumpState) dumpSlice(v reflect.Value) {
|
|||||||
numEntries := v.Len()
|
numEntries := v.Len()
|
||||||
if numEntries == 0 {
|
if numEntries == 0 {
|
||||||
s.w.Write([]byte("{}"))
|
s.w.Write([]byte("{}"))
|
||||||
s.newline()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.w.Write([]byte("{"))
|
s.w.Write([]byte("{"))
|
||||||
|
@ -898,7 +898,7 @@ limitations under the License.
|
|||||||
aux(value, [], ''),
|
aux(value, [], ''),
|
||||||
|
|
||||||
manifestYamlDoc(value)::
|
manifestYamlDoc(value)::
|
||||||
local aux(v, in_array, in_object, path, cindent) =
|
local aux(v, in_object, path, cindent) =
|
||||||
if v == true then
|
if v == true then
|
||||||
'true'
|
'true'
|
||||||
else if v == false then
|
else if v == false then
|
||||||
@ -923,21 +923,21 @@ limitations under the License.
|
|||||||
'[]'
|
'[]'
|
||||||
else
|
else
|
||||||
local range = std.range(0, std.length(v) - 1);
|
local range = std.range(0, std.length(v) - 1);
|
||||||
local new_indent = cindent + ' ';
|
local actual_indent = if in_object then cindent[2:] else cindent;
|
||||||
local parts = [aux(v[i], true, false, path + [i], new_indent) for i in range];
|
local parts = [aux(v[i], false, path + [i], cindent) for i in range];
|
||||||
(if in_object then '\n' + cindent else '') + '- ' + std.join('\n' + cindent + '- ', parts)
|
(if in_object then '\n' + actual_indent else '')
|
||||||
|
+ '- ' + std.join('\n' + actual_indent + '- ', parts)
|
||||||
else if std.type(v) == 'object' then
|
else if std.type(v) == 'object' then
|
||||||
if std.length(v) == 0 then
|
if std.length(v) == 0 then
|
||||||
'{}'
|
'{}'
|
||||||
else
|
else
|
||||||
local new_indent = cindent + ' ';
|
local new_indent = cindent + ' ';
|
||||||
local lines = [
|
local lines = [
|
||||||
cindent + std.escapeStringJson(k) + ': ' + aux(v[k], false, true, path + [k], new_indent)
|
std.escapeStringJson(k) + ': ' + aux(v[k], true, path + [k], new_indent)
|
||||||
for k in std.objectFields(v)
|
for k in std.objectFields(v)
|
||||||
];
|
];
|
||||||
(if in_array || in_object then '\n' else '')
|
(if in_object then '\n' + cindent else '') + std.join('\n' + cindent, lines);
|
||||||
+ std.join('\n', lines);
|
aux(value, false, [], ''),
|
||||||
aux(value, false, false, [], ''),
|
|
||||||
|
|
||||||
manifestYamlStream(value)::
|
manifestYamlStream(value)::
|
||||||
if std.type(value) != 'array' then
|
if std.type(value) != 'array' then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user