41 Commits

Author SHA1 Message Date
Ryuta Kamizono
1e66c1e13a Fix some typos 2024-04-08 18:33:30 +02:00
Tina Müller
51843fe482 Limit depth of nesting by default
Each nesting level increases the stack and the number of previous
starting events that the parser has to check.

The default maximum is 1000 and can be set via yaml_set_max_nest_level()

I also added new options to run-parser and run-parser-test-suite:
* --max-level: you can now try out this feature on the command line
* --show-error: By default, run-parser doesn't show errors. The new option
  helps with debugging
2024-04-08 18:12:59 +02:00
Tina Müller (tinita)
6e2fa9786a
Emitter: Output space after an alias mapping key (#185)
Before:
    a: &b x
    *b: c

Now:
    a: &b x
    *b : c

Passing tests:
* 26DV: Whitespace around colon in mappings
* E76Z: Aliases in Implicit Block Mapping
* X38W: Aliases in Flow Objects

Test manually because `make test-suite` will overwrite changes in the skiplist:

    ./tests/run-parser-test-suite tests/run-test-suite/data/26DV/in.yaml | ./tests/run-emitter-test-suite
    ./tests/run-parser-test-suite tests/run-test-suite/data/E76Z/in.yaml | ./tests/run-emitter-test-suite
    ./tests/run-parser-test-suite tests/run-test-suite/data/X38W/in.yaml | ./tests/run-emitter-test-suite

Or edit tests/run-test-suite/test/blacklist/libyaml-emitter and do:

    (cd tests/run-test-suite; prove -lv test)

Also I added some newlines to yaml.h to help identifying states by number.
2020-06-01 11:55:55 +02:00
Mark Sheahan
a1dc7861f8 Change dllexport controlling macro to use _WIN32
(provided by msvc compiler) instead of WIN32 (which is user configurable, and
omitted by default on some x64 builds); this fixes an issue with 64 bit windows
static library builds (#66)

Co-authored-by: Mark Sheahan <mark.sheahan@upguard.com>
2020-04-11 16:10:50 +02:00
Junde Yhi
e0b9e42d82
include/yaml.h: fix comments (#155)
* include/yaml.h: fix indentation of comments

* include/yaml.h: fix documentation style comment

* include/yaml.h: fix doc command returns

* include/yaml.h: fix typo
2020-03-28 18:17:28 +01:00
criptych
a21fc21697 Use pointer to const for strings that aren't/shouldn't be modified 2019-06-06 19:25:18 +02:00
林博仁(Buo-ren Lin)
b4ca139010 Fix typo in comment
s/intendation/indentation/

Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2019-06-06 19:11:29 +02:00
Reini Urban
75eddf785f fix C++-compat error
we cannot malloc to an anon struct in C++.
typedef yaml_anchors_t
2018-07-17 23:08:09 +02:00
Viktor Szakats
2e849b3651 Fix token name typos in comments 2018-06-30 14:47:25 -07:00
Éric Thiébaut
83d3d38838 Fix two typos in header comments. (#120) 2018-06-25 00:44:49 -04:00
Anthony Hendrickson
119b7b6adf Updates defs for MingGW support on Windows
addresses issue #52
2017-03-10 16:12:57 -05:00
Kevin Wojniak
6bc9e2466b Fix typo 2016-12-28 21:11:55 -08:00
Ian Cordasco
fd039be5f1
Use AM_CPPFLAGS since autotools deprecated INCLUDE
autoconf deprecated INCLUDE around version 2.69. No other automake file
in the project uses INCLUDE (instead they use AM_CPPFLAGS) and this
warning prevents the bootstrap-configure-make process from working on
OSX for me. Updating the variable name in the include/Makefile.am fixes
this and allows me to move along with development on OSX.
2016-12-10 11:14:56 -06:00
Kirill Simonov
52e34e2b73 Use _WIN32 instead of WIN32 as the latter is not defined by Visual C. 2011-05-29 02:41:36 +00:00
Kirill Simonov
b11a3e6e50 'make distclean' should not remove html docs, 'make maintainer-clean' should (Thanks Anders Kaseorg). 2008-12-30 03:42:23 +00:00
Kirill Simonov
561ca6de7b Fixed emitting folded scalars with trailing breaks; Forced emitting of a document end indicator when there is a possibility of ambiguous parsing. 2008-12-27 19:14:00 +00:00
Kirill Simonov
c9b74def08 Eliminate some warnings and add more doxygen definitions. 2007-01-08 18:33:55 +00:00
Kirill Simonov
e27a3c886e Add functions for constructing, parsing and emitting YAML documents. 2007-01-07 20:11:16 +00:00
Kirill Simonov
a907bf857a Add const qualifier for yaml_parser_set_input_string parameter input. 2006-12-11 19:33:21 +00:00
Kirill Simonov
028f3e8709 Prepare the initial release. 2006-08-01 11:28:16 +00:00
Kirill Simonov
2a02dfd262 Add two examples and prepare the build system for distribution. 2006-07-31 22:24:32 +00:00
Kirill Simonov
e35af832e9 Implement everything except tag and scalar writers. 2006-07-28 20:09:34 +00:00
Kirill Simonov
5a00d8fe66 Implement Emitter state machine. 2006-07-26 20:32:16 +00:00
Kirill Simonov
cf61616657 Add yaml_emitter_emit_* set of functions. 2006-07-25 20:54:28 +00:00
Kirill Simonov
b1a54000b5 Add Emitter definitions and implement the Writer. 2006-07-23 11:57:36 +00:00
Kirill Simonov
625fcfe9ed Refactor internal and external API. 2006-07-21 13:50:32 +00:00
Kirill Simonov
52fba2c6b3 Implement half of the parsers. 2006-07-05 19:58:30 +00:00
Kirill Simonov
1eb01be7e2 Start working on the parser. 2006-07-04 19:39:56 +00:00
Kirill Simonov
5eff53a4ac Move yaml/yaml.h to yaml.h and merge version.c to api.c. 2006-07-03 13:49:14 +00:00
Kirill Simonov
26687d7db8 Add event constructors and destructors. 2006-07-03 13:34:57 +00:00
Kirill Simonov
f2b59d4db0 Implementing Scanner: macros and high-level functions. 2006-06-07 20:30:22 +00:00
Kirill Simonov
03be97ab0c Add scanner definitions.
Add a basic description of all tokens produced by the scanner.
2006-06-06 19:43:34 +00:00
Kirill Simonov
f642fd1158 Add token constructors and destructors.
Add YAML_DECLARE to the API declarations (Thanks to Peter Murphy for suggestion).
2006-06-02 13:03:14 +00:00
Kirill Simonov
2fa16060e0 Complete buffering and encoding code. 2006-06-01 20:19:43 +00:00
Kirill Simonov
3d790dfd5e Complete UTF-8 and UTF-16 decoders.
Reader is mostly done (though untested).
2006-05-30 17:49:18 +00:00
Kirill Simonov
6eb1ded4c4 Working on the decoding code. 2006-05-29 20:08:09 +00:00
Kirill Simonov
95b98ba9b5 Implementing Reader: first tries. 2006-05-27 17:19:07 +00:00
Kirill Simonov
a51447c932 Doxygenify the header file.
Add basic reader fields to the parser structure.

Start implementing basic parser functions.
2006-05-26 21:46:47 +00:00
Kirill Simonov
721c1923e4 Add doxygen support. 2006-05-21 14:58:32 +00:00
Kirill Simonov
cec6fc98eb Add the basic autoconf infrastructure. 2006-05-20 22:43:15 +00:00
Kirill Simonov
9e05b78ca5 Add yaml.h with prototypes for basic structures. 2006-05-12 19:39:56 +00:00