Codebase list lua-yaml / upstream/6.2.7
New upstream version 6.2.7 Victor Seva 3 years ago
11 changed file(s) with 114 addition(s) and 77 deletion(s). Raw diff Collapse all Expand all
00 # lyaml NEWS - User visible changes
1
2 ## Noteworthy changes in release 6.2.7 (2020-11-27) [stable]
3
4 ### Bug fixes
5
6 - Don't skip YAML entries from mixed key Lua tables.
7
18
29 ## Noteworthy changes in release 6.2.6 (2020-08-28) [stable]
310
33 Copyright (C) 2013-2020 Gary V. Vaughan
44
55 [![License](https://img.shields.io/:license-mit-blue.svg)](https://mit-license.org)
6 [![travis-ci status](https://secure.travis-ci.org/gvvaughan/lyaml.png?branch=release-v6.2.6)](http://travis-ci.org/gvvaughan/lyaml/builds)
7 [![codecov.io](https://codecov.io/github/gvvaughan/lyaml/coverage.svg?branch=release-v6.2.6)](https://codecov.io/github/gvvaughan/lyaml?branch=release-v6.2.6)
6 [![travis-ci status](https://secure.travis-ci.org/gvvaughan/lyaml.png?branch=release-v6.2.7)](http://travis-ci.org/gvvaughan/lyaml/builds)
7 [![codecov.io](https://codecov.io/github/gvvaughan/lyaml/coverage.svg?branch=release-v6.2.7)](https://codecov.io/github/gvvaughan/lyaml?branch=release-v6.2.7)
88
99 [LibYAML] binding for [Lua], with a fast C implementation
1010 for converting between [%YAML 1.1][yaml11] and [Lua] tables,
22 <html>
33 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
44 <head>
5 <title>lyaml 6.2.6 Reference</title>
5 <title>lyaml 6.2.7 Reference</title>
66 <link rel="stylesheet" href="ldoc.css" type="text/css" />
77 </head>
88 <body>
2323
2424 <div id="navigation">
2525 <br/>
26 <h1>lyaml 6.2.6</h1>
26 <h1>lyaml 6.2.7</h1>
2727
2828
2929
8989 </div> <!-- id="main" -->
9090 <div id="about">
9191 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
92 <i style="float:right;">Last updated 2020-08-28 18:44:46 </i>
92 <i style="float:right;">Last updated 2020-11-27 16:17:28 </i>
9393 </div> <!-- id="about" -->
9494 </div> <!-- id="container" -->
9595 </body>
22 <html>
33 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
44 <head>
5 <title>lyaml 6.2.6 Reference</title>
5 <title>lyaml 6.2.7 Reference</title>
66 <link rel="stylesheet" href="../ldoc.css" type="text/css" />
77 </head>
88 <body>
2323
2424 <div id="navigation">
2525 <br/>
26 <h1>lyaml 6.2.6</h1>
26 <h1>lyaml 6.2.7</h1>
2727
2828 <ul>
2929 <li><a href="../index.html">Index</a></li>
259259 </div> <!-- id="main" -->
260260 <div id="about">
261261 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
262 <i style="float:right;">Last updated 2020-08-28 18:44:46 </i>
262 <i style="float:right;">Last updated 2020-11-27 16:17:28 </i>
263263 </div> <!-- id="about" -->
264264 </div> <!-- id="container" -->
265265 </body>
22 <html>
33 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
44 <head>
5 <title>lyaml 6.2.6 Reference</title>
5 <title>lyaml 6.2.7 Reference</title>
66 <link rel="stylesheet" href="../ldoc.css" type="text/css" />
77 </head>
88 <body>
2323
2424 <div id="navigation">
2525 <br/>
26 <h1>lyaml 6.2.6</h1>
26 <h1>lyaml 6.2.7</h1>
2727
2828 <ul>
2929 <li><a href="../index.html">Index</a></li>
228228 </div> <!-- id="main" -->
229229 <div id="about">
230230 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
231 <i style="float:right;">Last updated 2020-08-28 18:44:46 </i>
231 <i style="float:right;">Last updated 2020-11-27 16:17:28 </i>
232232 </div> <!-- id="about" -->
233233 </div> <!-- id="container" -->
234234 </body>
22 <html>
33 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
44 <head>
5 <title>lyaml 6.2.6 Reference</title>
5 <title>lyaml 6.2.7 Reference</title>
66 <link rel="stylesheet" href="../ldoc.css" type="text/css" />
77 </head>
88 <body>
2323
2424 <div id="navigation">
2525 <br/>
26 <h1>lyaml 6.2.6</h1>
26 <h1>lyaml 6.2.7</h1>
2727
2828 <ul>
2929 <li><a href="../index.html">Index</a></li>
216216 </div> <!-- id="main" -->
217217 <div id="about">
218218 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
219 <i style="float:right;">Last updated 2020-08-28 18:44:46 </i>
219 <i style="float:right;">Last updated 2020-11-27 16:17:28 </i>
220220 </div> <!-- id="about" -->
221221 </div> <!-- id="container" -->
222222 </body>
22 <html>
33 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
44 <head>
5 <title>lyaml 6.2.6 Reference</title>
5 <title>lyaml 6.2.7 Reference</title>
66 <link rel="stylesheet" href="../ldoc.css" type="text/css" />
77 </head>
88 <body>
2323
2424 <div id="navigation">
2525 <br/>
26 <h1>lyaml 6.2.6</h1>
26 <h1>lyaml 6.2.7</h1>
2727
2828 <ul>
2929 <li><a href="../index.html">Index</a></li>
525525 </div> <!-- id="main" -->
526526 <div id="about">
527527 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
528 <i style="float:right;">Last updated 2020-08-28 18:44:46 </i>
528 <i style="float:right;">Last updated 2020-11-27 16:17:28 </i>
529529 </div> <!-- id="about" -->
530530 </div> <!-- id="container" -->
531531 </body>
198198 elseif itsa == 'string' or itsa == 'boolean' or itsa == 'number' then
199199 return self:dump_scalar(node)
200200 elseif itsa == 'table' then
201 if #node > 0 then
201 -- Something is only a sequence if its keys start at 1
202 -- and are consecutive integers without any jumps.
203 local prior_key = 0
204 local is_pure_sequence = true
205 local i, v = next(node, nil)
206 while i and is_pure_sequence do
207 if type(i) ~= "number" or (prior_key + 1 ~= i) then
208 is_pure_sequence = false -- breaks the loop
209 else
210 prior_key = i
211 i, v = next(node, prior_key)
212 end
213 end
214 if is_pure_sequence then
215 -- Only sequentially numbered integer keys starting from 1.
202216 return self:dump_sequence(node)
203217 else
218 -- Table contains non sequential integer keys or mixed keys.
204219 return self:dump_mapping(node)
205220 end
206221 else -- unsupported Lua type
+0
-59
lyaml-6.2.6-1.rockspec less more
0 local _MODREV, _SPECREV = '6.2.6', '-1'
1
2 package = 'lyaml'
3 version = _MODREV .. _SPECREV
4
5 description = {
6 summary = 'libYAML binding for Lua',
7 detailed = 'Read and write YAML format files with Lua.',
8 homepage = 'http://github.com/gvvaughan/lyaml',
9 license = 'MIT/X11',
10 }
11
12 source = {
13 url = 'http://github.com/gvvaughan/lyaml/archive/v' .. _MODREV .. '.zip',
14 dir = 'lyaml-' .. _MODREV,
15 }
16
17 dependencies = {
18 'lua >= 5.1, < 5.5',
19 }
20
21 external_dependencies = {
22 YAML = {
23 library = 'yaml',
24 },
25 }
26
27 build = {
28 type = 'command',
29 build_command = '$(LUA) build-aux/luke'
30 .. ' package="' .. package .. '"'
31 .. ' version="' .. _MODREV .. '"'
32 .. ' PREFIX="$(PREFIX)"'
33 .. ' CFLAGS="$(CFLAGS)"'
34 .. ' LIBFLAG="$(LIBFLAG)"'
35 .. ' LIB_EXTENSION="$(LIB_EXTENSION)"'
36 .. ' OBJ_EXTENSION="$(OBJ_EXTENSION)"'
37 .. ' LUA="$(LUA)"'
38 .. ' LUA_DIR="$(LUADIR)"'
39 .. ' LUA_INCDIR="$(LUA_INCDIR)"'
40 .. ' YAML_DIR="$(YAML_DIR)"'
41 .. ' YAML_INCDIR="$(YAML_INCDIR)"'
42 .. ' YAML_LIBDIR="$(YAML_LIBDIR)"'
43 ,
44 install_command = '$(LUA) build-aux/luke install --quiet'
45 .. ' INST_LIBDIR="$(LIBDIR)"'
46 .. ' INST_LUADIR="$(LUADIR)"'
47 ,
48 copy_directories = {'doc'},
49 }
50
51 if _MODREV == 'git' then
52 build.copy_directories = nil
53
54 source = {
55 url = 'git://github.com/gvvaughan/lyaml.git',
56 }
57 end
58
0 local _MODREV, _SPECREV = '6.2.7', '-1'
1
2 package = 'lyaml'
3 version = _MODREV .. _SPECREV
4
5 description = {
6 summary = 'libYAML binding for Lua',
7 detailed = 'Read and write YAML format files with Lua.',
8 homepage = 'http://github.com/gvvaughan/lyaml',
9 license = 'MIT/X11',
10 }
11
12 source = {
13 url = 'http://github.com/gvvaughan/lyaml/archive/v' .. _MODREV .. '.zip',
14 dir = 'lyaml-' .. _MODREV,
15 }
16
17 dependencies = {
18 'lua >= 5.1, < 5.5',
19 }
20
21 external_dependencies = {
22 YAML = {
23 library = 'yaml',
24 },
25 }
26
27 build = {
28 type = 'command',
29 build_command = '$(LUA) build-aux/luke'
30 .. ' package="' .. package .. '"'
31 .. ' version="' .. _MODREV .. '"'
32 .. ' PREFIX="$(PREFIX)"'
33 .. ' CFLAGS="$(CFLAGS)"'
34 .. ' LIBFLAG="$(LIBFLAG)"'
35 .. ' LIB_EXTENSION="$(LIB_EXTENSION)"'
36 .. ' OBJ_EXTENSION="$(OBJ_EXTENSION)"'
37 .. ' LUA="$(LUA)"'
38 .. ' LUA_DIR="$(LUADIR)"'
39 .. ' LUA_INCDIR="$(LUA_INCDIR)"'
40 .. ' YAML_DIR="$(YAML_DIR)"'
41 .. ' YAML_INCDIR="$(YAML_INCDIR)"'
42 .. ' YAML_LIBDIR="$(YAML_LIBDIR)"'
43 ,
44 install_command = '$(LUA) build-aux/luke install --quiet'
45 .. ' INST_LIBDIR="$(LIBDIR)"'
46 .. ' INST_LUADIR="$(LUADIR)"'
47 ,
48 copy_directories = {'doc'},
49 }
50
51 if _MODREV == 'git' then
52 build.copy_directories = nil
53
54 source = {
55 url = 'git://github.com/gvvaughan/lyaml.git',
56 }
57 end
58
5454 - it writes a mapping: |
5555 expect (lyaml.dump {{a=1, b=2, c=3, d=""}}).
5656 to_contain.all_of {"a: 1", "b: 2", "c: 3", "d: ''"}
57 - it writes a mapping of mixed keys: |
58 expect (lyaml.dump {{[1]=1, [2]=2, three="three", four="4", [5]="five"}}).
59 to_contain.all_of {"1: 1", "2: 2", "three: three", "four: '4'", "5: five"}
60 - it writes a mapping of integer keys starting at two: |
61 expect (lyaml.dump {{[2]=2, [3]=3, [4]=4}}).
62 to_contain.all_of {"2: 2", "3: 3", "4: 4"}
63 - it writes a mapping of mixed keys starting at one: |
64 expect (lyaml.dump {{[1]=1, [2]=2, [3]=3, foo="bar"}}).
65 to_contain.all_of {"1: 1", "2: 2", "3: 3", "foo: bar"}
66 - it writes a mapping of mixed keys starting at two: |
67 expect (lyaml.dump {{[2]=2, [3]=3, [4]=4, foo="bar"}}).
68 to_contain.all_of {"2: 2", "3: 3", "4: 4", "foo: bar"}
69 - it writes a table containing nils (jumps in index) as mapping: |
70 expect (lyaml.dump {{1, 2, nil, 3, 4}}).
71 to_contain.all_of {"1: 1", "2: 2", "4: 3", "5: 4"}
5772
5873 - context anchors and aliases:
5974 - before: