-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse_tests.yml
196 lines (188 loc) · 4.66 KB
/
parse_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
---
- name: rubocop-rspec
input: |
rubygem "rubocop-rspec" {
version.exact "3.1.0"
digest.sha256 "abcabcabcabc"
}
formatted: |
rubygem "rubocop-rspec" {
version.exact "3.1.0"
digest.sha256 "abcabcabcabc"
}
syntax_tree: !ruby/object:KDL::Document
nodes:
- !ruby/object:KDL::Node
name: rubygem
arguments:
- !ruby/object:KDL::Value::String
value: rubocop-rspec
format:
type:
properties: {}
children:
- !ruby/object:KDL::Node
name: version.exact
arguments:
- !ruby/object:KDL::Value::String
value: 3.1.0
format:
type:
properties: {}
children: []
type:
- !ruby/object:KDL::Node
name: digest.sha256
arguments:
- !ruby/object:KDL::Value::String
value: abcabcabcabc
format:
type:
properties: {}
children: []
type:
type:
- name: empty
input: ''
syntax_tree: !ruby/object:KDL::Document
nodes: []
- name: whitespace
input: " "
syntax_tree: !ruby/object:KDL::Document
nodes: []
- name: 'bare #'
input: "#"
syntax_tree: !ruby/object:KDL::Document
nodes:
- !ruby/object:KDL::Node
name: "#"
arguments: []
properties: {}
children: []
type:
- name: multiline comment as whitespace
input: 'foo/*bar*/""
'
syntax_tree: !ruby/object:KDL::Document
nodes:
- !ruby/object:KDL::Node
name: foo
arguments:
- !ruby/object:KDL::Value::String
value: ''
properties: {}
children: []
- name: quote in ident
input: 'foo""
'
racc_error: parse error on value "" (1:4) (STRING)
error: |
Error at <unknown>:1:0 (byte 0): expected node id (in :nodes)
foo""
^
- name: quote in ident
input: 'foo"bar"
'
racc_error: parse error on value "bar" (1:4) (STRING)
error: |
Error at <unknown>:1:0 (byte 0): expected node id (in :nodes)
foo"bar"
^
rust_error: |
Error: × Expected valid node terminator.
╭────
1 │ foo""
· ─┬─
· ╰── parsed node
╰────
help: Nodes can only be terminated by `;` or a valid line ending.
- name: escape at EOF after string ident
input: '"foo"\'
racc_error: parse error on value :EOF (2:1) (EOF)
error: |
Error at <unknown>:1:5 (byte 5): expected argument or property for "foo" (in :value)
"foo"\
^
rust_error: |
Error: × Expected newline after line escape.
╭────
1 │ "foo"\
· ┬
· ╰── line escape starts here
╰────
help: line escapes can only be followed by whitespace plus a newline (or
single-line comment).
- name: unclosed nodes
input: |
_ {
_ {}
racc_error: parse error on value :EOF (3:1) ($end)
error: |
Error at <unknown>:3:0 (byte 11): unclosed nodes:
_ {
_
}
(in :nodes)
_ {
_ {}
^
- name: node after semicolon with no space
input: '_{};_ '
syntax_tree: !ruby/object:KDL::Document
nodes:
- !ruby/object:KDL::Node
name: _
arguments: []
properties: {}
children: []
type:
- !ruby/object:KDL::Node
name: _
arguments: []
properties: {}
children: []
type:
- name: node after node with space
input: '_{} _
'
rust_error: |
Error: × Expected valid node terminator.
╭────
1 │ _{} _
· ───
· ╰── parsed node
╰────
help: Nodes can only be terminated by `;` or a valid line ending.
- name: node after node with comment and no space
input: '_{}/**/_
'
rust_error: |
Error: × Expected valid node terminator.
╭────
1 │ _{}/**/_
· ───┬───
· ╰── parsed node
╰────
help: Nodes can only be terminated by `;` or a valid line ending.
racc_error: parse error on value "_" (1:4) (IDENT)
error: |
Error at <unknown>:1:2 (byte 2): expected node terminator (in :nodes)
_{}/**/_
^
- name: dangling property
input: '_ foo= {}
'
racc_error: parse error on value " " (1:7) (WS)
error: |
Error at <unknown>:1:6 (byte 6): expected value for property "foo" (in :value)
_ foo= {}
^
rust_error: |
Error: × Expected property value.
╭────
1 │ _ foo= {}
· ▲
· ╰── invalid value
╰────
help: Please refer to https://github.com/kdl-org/kdl/blob/main/
SPEC.md#value for valid KDL value syntaxes.