New upstream version 6.2.7
Victor Seva
3 years ago
0 | 0 | # 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 | ||
1 | 8 | |
2 | 9 | ## Noteworthy changes in release 6.2.6 (2020-08-28) [stable] |
3 | 10 |
3 | 3 | Copyright (C) 2013-2020 Gary V. Vaughan |
4 | 4 | |
5 | 5 | [![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) | |
8 | 8 | |
9 | 9 | [LibYAML] binding for [Lua], with a fast C implementation |
10 | 10 | for converting between [%YAML 1.1][yaml11] and [Lua] tables, |
2 | 2 | <html> |
3 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
4 | 4 | <head> |
5 | <title>lyaml 6.2.6 Reference</title> | |
5 | <title>lyaml 6.2.7 Reference</title> | |
6 | 6 | <link rel="stylesheet" href="ldoc.css" type="text/css" /> |
7 | 7 | </head> |
8 | 8 | <body> |
23 | 23 | |
24 | 24 | <div id="navigation"> |
25 | 25 | <br/> |
26 | <h1>lyaml 6.2.6</h1> | |
26 | <h1>lyaml 6.2.7</h1> | |
27 | 27 | |
28 | 28 | |
29 | 29 | |
89 | 89 | </div> <!-- id="main" --> |
90 | 90 | <div id="about"> |
91 | 91 | <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> | |
93 | 93 | </div> <!-- id="about" --> |
94 | 94 | </div> <!-- id="container" --> |
95 | 95 | </body> |
2 | 2 | <html> |
3 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
4 | 4 | <head> |
5 | <title>lyaml 6.2.6 Reference</title> | |
5 | <title>lyaml 6.2.7 Reference</title> | |
6 | 6 | <link rel="stylesheet" href="../ldoc.css" type="text/css" /> |
7 | 7 | </head> |
8 | 8 | <body> |
23 | 23 | |
24 | 24 | <div id="navigation"> |
25 | 25 | <br/> |
26 | <h1>lyaml 6.2.6</h1> | |
26 | <h1>lyaml 6.2.7</h1> | |
27 | 27 | |
28 | 28 | <ul> |
29 | 29 | <li><a href="../index.html">Index</a></li> |
259 | 259 | </div> <!-- id="main" --> |
260 | 260 | <div id="about"> |
261 | 261 | <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> | |
263 | 263 | </div> <!-- id="about" --> |
264 | 264 | </div> <!-- id="container" --> |
265 | 265 | </body> |
2 | 2 | <html> |
3 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
4 | 4 | <head> |
5 | <title>lyaml 6.2.6 Reference</title> | |
5 | <title>lyaml 6.2.7 Reference</title> | |
6 | 6 | <link rel="stylesheet" href="../ldoc.css" type="text/css" /> |
7 | 7 | </head> |
8 | 8 | <body> |
23 | 23 | |
24 | 24 | <div id="navigation"> |
25 | 25 | <br/> |
26 | <h1>lyaml 6.2.6</h1> | |
26 | <h1>lyaml 6.2.7</h1> | |
27 | 27 | |
28 | 28 | <ul> |
29 | 29 | <li><a href="../index.html">Index</a></li> |
228 | 228 | </div> <!-- id="main" --> |
229 | 229 | <div id="about"> |
230 | 230 | <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> | |
232 | 232 | </div> <!-- id="about" --> |
233 | 233 | </div> <!-- id="container" --> |
234 | 234 | </body> |
2 | 2 | <html> |
3 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
4 | 4 | <head> |
5 | <title>lyaml 6.2.6 Reference</title> | |
5 | <title>lyaml 6.2.7 Reference</title> | |
6 | 6 | <link rel="stylesheet" href="../ldoc.css" type="text/css" /> |
7 | 7 | </head> |
8 | 8 | <body> |
23 | 23 | |
24 | 24 | <div id="navigation"> |
25 | 25 | <br/> |
26 | <h1>lyaml 6.2.6</h1> | |
26 | <h1>lyaml 6.2.7</h1> | |
27 | 27 | |
28 | 28 | <ul> |
29 | 29 | <li><a href="../index.html">Index</a></li> |
216 | 216 | </div> <!-- id="main" --> |
217 | 217 | <div id="about"> |
218 | 218 | <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> | |
220 | 220 | </div> <!-- id="about" --> |
221 | 221 | </div> <!-- id="container" --> |
222 | 222 | </body> |
2 | 2 | <html> |
3 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
4 | 4 | <head> |
5 | <title>lyaml 6.2.6 Reference</title> | |
5 | <title>lyaml 6.2.7 Reference</title> | |
6 | 6 | <link rel="stylesheet" href="../ldoc.css" type="text/css" /> |
7 | 7 | </head> |
8 | 8 | <body> |
23 | 23 | |
24 | 24 | <div id="navigation"> |
25 | 25 | <br/> |
26 | <h1>lyaml 6.2.6</h1> | |
26 | <h1>lyaml 6.2.7</h1> | |
27 | 27 | |
28 | 28 | <ul> |
29 | 29 | <li><a href="../index.html">Index</a></li> |
525 | 525 | </div> <!-- id="main" --> |
526 | 526 | <div id="about"> |
527 | 527 | <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> | |
529 | 529 | </div> <!-- id="about" --> |
530 | 530 | </div> <!-- id="container" --> |
531 | 531 | </body> |
198 | 198 | elseif itsa == 'string' or itsa == 'boolean' or itsa == 'number' then |
199 | 199 | return self:dump_scalar(node) |
200 | 200 | 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. | |
202 | 216 | return self:dump_sequence(node) |
203 | 217 | else |
218 | -- Table contains non sequential integer keys or mixed keys. | |
204 | 219 | return self:dump_mapping(node) |
205 | 220 | end |
206 | 221 | else -- unsupported Lua type |
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 |
54 | 54 | - it writes a mapping: | |
55 | 55 | expect (lyaml.dump {{a=1, b=2, c=3, d=""}}). |
56 | 56 | 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"} | |
57 | 72 | |
58 | 73 | - context anchors and aliases: |
59 | 74 | - before: |