on master help sign in
Bump libyaml and stack
commitdedbaddefdc4a534b1bd1ef99b7c9122d2f37ead authorflip111 <flip101@gmail.com> dateMon 3 Feb 2020, 23:37 (7 years ago) parentd0a2ba6
10 files changed+55−36
.gitignore+1 libyaml/README.md+1−1 libyaml/libyaml_src/LICENSE+1−1 libyaml/libyaml_src/dumper.c+1−1 libyaml/libyaml_src/emitter.c+11−11 libyaml/libyaml_src/parser.c+2 libyaml/libyaml_src/scanner.c+18−7 libyaml/libyaml_src/yaml.h+14−9 libyaml/libyaml_src/yaml_private.h+5−5 stack.yaml+1−1
.gitignore+1
@@ -9,3 +9,4 @@ yaml.cabal
99/tarballs/
1010.dir-locals.el
1111*#
12+stack.yaml.lock
libyaml/README.md+1−1
@@ -1,3 +1,3 @@
11# libyaml
22
3−This package provides a haskell wrapper over the [libyaml C library version 0.2.1 by Kirill Simonov](https://github.com/yaml/libyaml). It contains the C source so you don't need to worry about any non-Haskell dependencies.
3+This package provides a haskell wrapper over the [libyaml C library version 0.2.2 by Kirill Simonov](https://github.com/yaml/libyaml). It contains the C source so you don't need to worry about any non-Haskell dependencies.
libyaml/libyaml_src/LICENSE+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2017-2018 Ingy döt Net
1+Copyright (c) 2017-2019 Ingy döt Net
22Copyright (c) 2006-2016 Kirill Simonov
33
44Permission is hereby granted, free of charge, to any person obtaining a copy of
libyaml/libyaml_src/dumper.c+1−1
@@ -131,7 +131,7 @@ yaml_emitter_dump(yaml_emitter_t *emitter, yaml_document_t *document)
131131
132132 assert(emitter->opened); /* Emitter should be opened. */
133133
134− emitter->anchors = yaml_malloc(sizeof(*(emitter->anchors))
134+ emitter->anchors = (yaml_anchors_t*)yaml_malloc(sizeof(*(emitter->anchors))
135135 * (document->nodes.top - document->nodes.start));
136136 if (!emitter->anchors) goto error;
137137 memset(emitter->anchors, 0, sizeof(*(emitter->anchors))
libyaml/libyaml_src/emitter.c+11−11
@@ -16,7 +16,7 @@
1616#define PUT(emitter,value) \
1717 (FLUSH(emitter) \
1818 && (*(emitter->buffer.pointer++) = (yaml_char_t)(value), \
19− emitter->column ++, \
19+ emitter->column++, \
2020 1))
2121
2222/*
@@ -221,7 +221,7 @@ yaml_emitter_write_indent(yaml_emitter_t *emitter);
221221
222222static int
223223yaml_emitter_write_indicator(yaml_emitter_t *emitter,
224− char *indicator, int need_whitespace,
224+ const char *indicator, int need_whitespace,
225225 int is_whitespace, int is_indention);
226226
227227static int
@@ -649,13 +649,6 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
649649
650650 else if (event->type == YAML_STREAM_END_EVENT)
651651 {
652− if (emitter->open_ended)
653− {
654− if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
655− return 0;
656− if (!yaml_emitter_write_indent(emitter))
657− return 0;
658− }
659652
660653 if (!yaml_emitter_flush(emitter))
661654 return 0;
@@ -1784,7 +1777,7 @@ yaml_emitter_write_indent(yaml_emitter_t *emitter)
17841777
17851778static int
17861779yaml_emitter_write_indicator(yaml_emitter_t *emitter,
1787− char *indicator, int need_whitespace,
1780+ const char *indicator, int need_whitespace,
17881781 int is_whitespace, int is_indention)
17891782{
17901783 size_t indicator_length;
@@ -1946,6 +1939,10 @@ yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter,
19461939
19471940 emitter->whitespace = 0;
19481941 emitter->indention = 0;
1942+ if (emitter->root_context)
1943+ {
1944+ emitter->open_ended = 1;
1945+ }
19491946
19501947 return 1;
19511948}
@@ -2004,6 +2001,9 @@ yaml_emitter_write_single_quoted_scalar(yaml_emitter_t *emitter,
20042001 }
20052002 }
20062003
2004+ if (breaks)
2005+ if (!yaml_emitter_write_indent(emitter)) return 0;
2006+
20072007 if (!yaml_emitter_write_indicator(emitter, "'", 0, 0, 0))
20082008 return 0;
20092009
@@ -2174,7 +2174,7 @@ yaml_emitter_write_block_scalar_hints(yaml_emitter_t *emitter,
21742174 yaml_string_t string)
21752175{
21762176 char indent_hint[2];
2177− char *chomp_hint = NULL;
2177+ const char *chomp_hint = NULL;
21782178
21792179 if (IS_SPACE(string) || IS_BREAK(string))
21802180 {
libyaml/libyaml_src/parser.c+2
@@ -1316,6 +1316,8 @@ yaml_parser_process_directives(yaml_parser_t *parser,
13161316 STACK_DEL(parser, tag_directives);
13171317 }
13181318
1319+ if (!version_directive_ref)
1320+ yaml_free(version_directive);
13191321 return 1;
13201322
13211323error:
libyaml/libyaml_src/scanner.c+18−7
@@ -38,8 +38,8 @@
3838 * BLOCK-END # Indentation decrease.
3939 * FLOW-SEQUENCE-START # '['
4040 * FLOW-SEQUENCE-END # ']'
41− * BLOCK-SEQUENCE-START # '{'
42− * BLOCK-SEQUENCE-END # '}'
41+ * FLOW-MAPPING-START # '{'
42+ * FLOW-MAPPING-END # '}'
4343 * BLOCK-ENTRY # '-'
4444 * FLOW-ENTRY # ','
4545 * KEY # '?' or nothing (simple keys).
@@ -1636,7 +1636,7 @@ yaml_parser_fetch_key(yaml_parser_t *parser)
16361636
16371637 if (!parser->flow_level)
16381638 {
1639− /* Check if we are allowed to start a new key (not nessesary simple). */
1639+ /* Check if we are allowed to start a new key (not necessary simple). */
16401640
16411641 if (!parser->simple_key_allowed) {
16421642 return yaml_parser_set_scanner_error(parser, NULL, parser->mark,
@@ -2860,7 +2860,7 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
28602860
28612861 if (!CACHE(parser, 1)) goto error;
28622862
2863− while ((int)parser->mark.column == indent && !IS_Z(parser->buffer))
2863+ while ((int)parser->mark.column == indent && !(IS_Z(parser->buffer)))
28642864 {
28652865 /*
28662866 * We are at the beginning of a non-empty line.
@@ -3430,11 +3430,22 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
34303430
34313431 while (!IS_BLANKZ(parser->buffer))
34323432 {
3433− /* Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13". */
3433+ /* Check for "x:" + one of ',?[]{}' in the flow context. TODO: Fix the test "spec-08-13".
3434+ * This is not completely according to the spec
3435+ * See http://yaml.org/spec/1.1/#id907281 9.1.3. Plain
3436+ */
34343437
34353438 if (parser->flow_level
34363439 && CHECK(parser->buffer, ':')
3437− && !IS_BLANKZ_AT(parser->buffer, 1)) {
3440+ && (
3441+ CHECK_AT(parser->buffer, ',', 1)
3442+ || CHECK_AT(parser->buffer, '?', 1)
3443+ || CHECK_AT(parser->buffer, '[', 1)
3444+ || CHECK_AT(parser->buffer, ']', 1)
3445+ || CHECK_AT(parser->buffer, '{', 1)
3446+ || CHECK_AT(parser->buffer, '}', 1)
3447+ )
3448+ ) {
34383449 yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
34393450 start_mark, "found unexpected ':'");
34403451 goto error;
@@ -3444,7 +3455,7 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
34443455
34453456 if ((CHECK(parser->buffer, ':') && IS_BLANKZ_AT(parser->buffer, 1))
34463457 || (parser->flow_level &&
3447− (CHECK(parser->buffer, ',') || CHECK(parser->buffer, ':')
3458+ (CHECK(parser->buffer, ',')
34483459 || CHECK(parser->buffer, '?') || CHECK(parser->buffer, '[')
34493460 || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '{')
34503461 || CHECK(parser->buffer, '}'))))
libyaml/libyaml_src/yaml.h+14−9
@@ -232,7 +232,7 @@ typedef enum yaml_token_type_e {
232232
233233 /** A BLOCK-SEQUENCE-START token. */
234234 YAML_BLOCK_SEQUENCE_START_TOKEN,
235− /** A BLOCK-SEQUENCE-END token. */
235+ /** A BLOCK-MAPPING-START token. */
236236 YAML_BLOCK_MAPPING_START_TOKEN,
237237 /** A BLOCK-END token. */
238238 YAML_BLOCK_END_TOKEN,
@@ -1517,6 +1517,18 @@ typedef enum yaml_emitter_state_e {
15171517 YAML_EMIT_END_STATE
15181518} yaml_emitter_state_t;
15191519
1520+
1521+/* This is needed for C++ */
1522+
1523+typedef struct yaml_anchors_s {
1524+ /** The number of references. */
1525+ int references;
1526+ /** The anchor id. */
1527+ int anchor;
1528+ /** If the node has been emitted? */
1529+ int serialized;
1530+} yaml_anchors_t;
1531+
15201532/**
15211533 * The emitter structure.
15221534 *
@@ -1742,14 +1754,7 @@ typedef struct yaml_emitter_s {
17421754 int closed;
17431755
17441756 /** The information associated with the document nodes. */
1745− struct {
1746− /** The number of references. */
1747− int references;
1748− /** The anchor id. */
1749− int anchor;
1750− /** If the node has been emitted? */
1751− int serialized;
1752− } *anchors;
1757+ yaml_anchors_t *anchors;
17531758
17541759 /** The last assigned anchor id. */
17551760 int last_anchor_id;
libyaml/libyaml_src/yaml_private.h+5−5
@@ -1,5 +1,5 @@
11#if HAVE_CONFIG_H
2−#include <config.h>
2+#include "config.h"
33#endif
44
55#include <yaml.h>
@@ -171,14 +171,14 @@ yaml_string_join(
171171 * Check the octet at the specified position.
172172 */
173173
174−#define CHECK_AT(string,octet,offset) \
174+#define CHECK_AT(string,octet,offset) \
175175 ((string).pointer[offset] == (yaml_char_t)(octet))
176176
177177/*
178178 * Check the current octet in the buffer.
179179 */
180180
181−#define CHECK(string,octet) CHECK_AT((string),(octet),0)
181+#define CHECK(string,octet) (CHECK_AT((string),(octet),0))
182182
183183/*
184184 * Check if the character at the specified position is an alphabetical
@@ -684,7 +684,7 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
684684#define YAML_MALLOC(size) (yaml_char_t *)yaml_malloc(size)
685685
686686/* For Haskell yaml package, since we do not use the configure script */
687−#define YAML_VERSION_STRING "0.2.1"
687+#define YAML_VERSION_STRING "0.2.2"
688688#define YAML_VERSION_MAJOR 0
689689#define YAML_VERSION_MINOR 2
690−#define YAML_VERSION_PATCH 1
690+#define YAML_VERSION_PATCH 2
stack.yaml+1−1
@@ -1,4 +1,4 @@
1−resolver: lts-13.17
1+resolver: lts-14.22
22
33flags:
44 yaml: