Commit graph

39 commits

Author SHA1 Message Date
Robin Stocker
3ae23d47de Fix handling of indicators in plain scalars to conform to YAML 1.2
YAML 1.2 has special handling of indicators to be compatible with JSON.
The following is equivalent to `{"a": "b"}` (note, no space after `:`):

    {"a":b}

But without the quoted key, a space is required. So the `:` here is part
of the plain scalar:

    {a:b}  # == {"a:b"}

A plain scalar can also start with a `:` as long as it's followed by
"safe" characters:

    {a: :b}  # == {"a": ":b"}

(Fixes #118)
2019-03-04 11:45:39 +11:00
Tibo Delor
3f8a60627f Format using rustfmt 1.0 2018-12-13 18:35:01 +11:00
David Tolnay
20190538af Replace try! with question mark 2018-09-15 23:58:48 -07:00
David Tolnay
dc1ed3d396 Lowercase the recursion limit error message
To be consistent with the other errors in this crate.
2018-09-15 13:09:11 -07:00
David Tolnay
1f0d33259b Address redundant_field_names lint 2018-09-15 10:06:34 -07:00
David Tolnay
f26a44bcdc Format with rustfmt 0.99.4 2018-09-15 09:49:08 -07:00
Konrad Borowski
b17fbe703c Prevent too deep recursion 2018-09-15 12:34:21 +02:00
cetra3
652e42d1c4 Include Scanner 2017-11-15 14:11:39 +10:30
cetra3
201c16217a Allow the Marker from ScanError 2017-11-15 12:06:16 +10:30
Martin Hoffmann
b9b79a5cf8 Allow access to Marker’s content. 2017-09-02 13:49:53 +02:00
Yuheng Chen
e5a2439494 Fix #65 2017-05-13 20:48:48 +08:00
Yuheng Chen
864c7e0829 Use push_str() instead of extend() 2016-11-24 18:10:49 +08:00
Hendrik Sollich
ca7956f429 Fix logic error that caused infinite loop 2016-06-23 00:22:03 +02:00
Hendrik Sollich
27e11273c1 returning ScanError instead of running unreachable!()
fixes #23
2016-06-22 15:54:22 +08:00
Yuheng Chen
5fa1c5d7cc Fix clippy warnings about not 2016-03-10 20:49:24 +08:00
David Tolnay
06732a6b77 Resolve remaining clippy lints and add to Travis build 2016-02-27 16:42:32 -08:00
David Tolnay
956f7625d1 Remove common suffix from TokenType enum
See https://github.com/Manishearth/rust-clippy/wiki#enum_variant_names
2016-02-27 15:29:36 -08:00
Yuheng Chen
a29b0c12f6 Fix CR/LF in literal scalar 2015-09-15 15:27:32 +08:00
Yuheng Chen
e8f754bb9e Display error line and col number for ScanError 2015-07-02 23:46:04 +08:00
Yuheng Chen
87539f852d remove trailing space 2015-06-30 00:31:22 +08:00
m-r-r
34f81af101 Implementation of std::scanner::Error for ScanError 2015-06-18 23:49:28 +02:00
Yuheng Chen
d40b7cbdd2 Better code coverage 2015-06-04 16:10:43 +08:00
Yuheng Chen
3af90353f6 Add LICENSE and build status 2015-05-31 00:13:21 +08:00
Yuheng Chen
e4862a7c8f Add tag:yaml.org,2002 parsing 2015-05-30 22:39:50 +08:00
Yuheng Chen
064f10beee Add scan_uri_escapes 2015-05-30 18:49:54 +08:00
Yuheng Chen
ec1cf5a223 Add scan_tag_directive_value 2015-05-29 02:57:41 +08:00
Yuheng Chen
3d7a97ad32 Add partial anchor support 2015-05-29 01:56:03 +08:00
Yuheng Chen
169ec43039 Fix unicode escape 2015-05-28 22:19:06 +08:00
Yuheng Chen
4890b7de5b Add VersionDirectiveToken 2015-05-28 22:07:59 +08:00
Yuheng Chen
b4f94fdca7 Fix test_spec_ex7_3 2015-05-28 17:18:20 +08:00
Yuheng Chen
032a595dde Add indentless_sequence_entry 2015-05-27 16:35:31 +08:00
Yuheng Chen
616ebfa378 Refactory YAML document loader 2015-05-27 14:57:44 +08:00
Yuheng Chen
89b9c6b1db Add block_scalar 2015-05-27 00:29:40 +08:00
Yuheng Chen
998dbbef91 Add scanner unit tests 2015-05-25 19:32:48 +08:00
Yuheng Chen
2b73808939 Add scan_flow_scalar 2015-05-25 03:21:53 +08:00
Yuheng Chen
2e1416c509 Add yaml value coerce 2015-05-25 01:34:18 +08:00
Yuheng Chen
9fa4c839fc fix lookahead spelling 2015-05-24 14:38:54 +08:00
Yuheng Chen
1014e35108 Fix warnings 2015-05-24 14:37:36 +08:00
Yuheng Chen
f8065b79c7 Initial commit 2015-05-24 14:27:42 +08:00