Commit graph

81 commits

Author SHA1 Message Date
Iskander Sharipov
38315098bd parser: fix parser panic for the invalid directive
`%YAML 1.1 {}` input makes the parser panic.

This change attempts to fix that by checking
for the token not to be nil. We use previous
token to specify the approx syntax error location.

Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
2020-09-09 20:31:42 +03:00
Masaaki Goshima
4d2c5f0532 Fix parsing for mapping key or tag token 2020-07-02 17:25:31 +09:00
Masaaki Goshima
204d5ba8e9 Add test case for checking syntax error 2020-07-02 14:38:34 +09:00
Masaaki Goshima
bdfa98c567 Add test case for mapping value delimiter in flow style ( #142 ) 2020-07-02 12:49:18 +09:00
Masaaki Goshima
d81424f5f6 Fix parser test 2020-07-02 12:49:05 +09:00
Masaaki Goshima
9565ed166b Fix processing of Literal with NewLineCharacter 2020-06-15 20:16:51 +09:00
Masaaki Goshima
043e7bde32 Add null token to parsed result 2020-06-03 17:57:26 +09:00
Masaaki Goshima
1ee2aede3a Fix new line character in string surrounded by double quote 2020-06-02 13:06:46 +09:00
Masaaki Goshima
0c228d5cbc Fix scanning token of number in literal 2020-06-01 12:54:23 +09:00
Masaaki Goshima
bff65e2e7b Support parsing with comment 2020-05-29 11:49:32 +09:00
Masaaki Goshima
b3d4080492 Support parsing with comment 2020-05-28 21:39:06 +09:00
Masaaki Goshima
0204fca738 Fix handling of sequence indicator 2020-03-07 20:17:54 +09:00
Masaaki Goshima
5965e147d2 Fix handling of dash character 2020-03-07 12:03:06 +09:00
Masaaki Goshima
825e932247 Fix test case ( use parser.ParseFile ) 2019-12-22 12:08:45 +09:00
Masaaki Goshima
90c6152d4b Fix test case 2019-12-22 11:59:24 +09:00
Masaaki Goshima
dbcc3e20dc Add test case of parser for CRLF 2019-12-22 11:50:07 +09:00
Masaaki Goshima
8f13c01463 Remove unnecessary spaces at right side 2019-12-11 17:17:05 +09:00
Masaaki Goshima
dd6a892902 Fix parsing error of document like a: 1 - 4 2019-12-04 23:58:06 +09:00
Masaaki Goshima
4147f40ae7 Fix handling of literal token include empty line 2019-11-19 18:03:24 +09:00
nasa9084
6db264d96f Comments must be separated from other tokens by white space characters 2019-11-12 19:50:58 +09:00
Masaaki Goshima
7729266864 Fix parsing of literal token 2019-11-08 16:48:54 +09:00
Masaaki Goshima
62a86c4e5d Fix parsing of literal token 2019-11-07 23:45:39 +09:00
Masaaki Goshima
4dc8ed6703 Fix design of parser API 2019-11-05 17:02:55 +09:00
Masaaki Goshima
4780e46e37 Integrate FlowSequenceNode into SequenceNode 2019-10-31 13:06:35 +09:00
Masaaki Goshima
e8a411abfc Integrate FlowMappingNode into MappingNode 2019-10-31 12:25:33 +09:00
Masaaki Goshima
265cae5062 Optimize parsing for mapping-value token 2019-10-24 13:52:12 +09:00
Masaaki Goshima
3882855ddc Fix parser bugs
- double sequence entry
- multiple column based mapping value
2019-10-23 20:22:14 +09:00
Masaaki Goshima
b4289af609 Support syntax error printing 2019-10-23 13:30:22 +09:00
Masaaki Goshima
c5db11901c Improve error format
- %v : beautiful syntax error with source code
- %#+v : error with stack trace ( for debugging )
- others : simple syntax error ( without source code )
2019-10-23 03:21:42 +09:00
Masaaki Goshima
293ee9861c Add document 2019-10-21 12:53:30 +09:00
Masaaki Goshima
a02f24c9ad Add parser package 2019-10-16 18:21:20 +09:00