You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(this.tagPrefixes[handle])this.errors.push(new_errors.YAMLSyntaxError(directive,'The TAG directive must only be given at most once per handle in the same document.'));
38
+
this.tagPrefixes[handle]=prefix;
39
+
}else{
40
+
this.errors.push(new_errors.YAMLSyntaxError(directive,'Insufficient parameters given for TAG directive'));
if(this.version)this.errors.push(new_errors.YAMLSyntaxError(directive,'The YAML directive must only be given at most once per document.'));
50
+
if(!version)this.errors.push(new_errors.YAMLSyntaxError(directive,'Insufficient parameters given for YAML directive'));elseif(version!=='1.2')this.errors.push(new_errors.YAMLWarning(directive,"Document will be parsed as YAML 1.2 rather than YAML ".concat(version)));
this.errors.push(new_errors.YAMLSyntaxError(node,"The ".concat(handle," tag has no suffix.")));
148
+
}else{
149
+
this.errors.push(new_errors.YAMLSyntaxError(node,"The ".concat(handle," tag handle is non-default and was not declared.")));
150
+
}
151
+
}
152
+
}
153
+
154
+
switch(type){
155
+
case_Node.Type.BLOCK_FOLDED:
156
+
case_Node.Type.BLOCK_LITERAL:
157
+
case_Node.Type.QUOTE_DOUBLE:
158
+
case_Node.Type.QUOTE_SINGLE:
159
+
return_Tags.DefaultTags.STR;
160
+
161
+
case_Node.Type.FLOW_MAP:
162
+
case_Node.Type.MAP:
163
+
return_Tags.DefaultTags.MAP;
164
+
165
+
case_Node.Type.FLOW_SEQ:
166
+
case_Node.Type.SEQ:
167
+
return_Tags.DefaultTags.SEQ;
168
+
169
+
case_Node.Type.PLAIN:
170
+
returnnonSpecific ? _Tags.DefaultTags.STR : null;
171
+
172
+
default:
173
+
returnnull;
174
+
}
175
+
}
176
+
},{
177
+
key: "resolveNode",
178
+
value: functionresolveNode(node){
179
+
if(!node)returnnull;
180
+
varanchors=this.anchors,
181
+
errors=this.errors,
182
+
tags=this.tags;
183
+
varhasAnchor=false;
184
+
varhasTag=false;
185
+
node.props.forEach(function(_ref3){
186
+
varstart=_ref3.start,
187
+
end=_ref3.end;
188
+
189
+
switch(node.context.src[start]){
190
+
case_Node.Char.COMMENT:
191
+
if(!node.commentHasRequiredWhitespace(start))errors.push(new_errors.YAMLSyntaxError(node,'Comments must be separated from other tokens by white space characters'));
192
+
break;
193
+
194
+
case_Node.Char.ANCHOR:
195
+
if(hasAnchor)errors.push(new_errors.YAMLSyntaxError(node,'A node can have at most one anchor'));
196
+
hasAnchor=true;
197
+
break;
198
+
199
+
case_Node.Char.TAG:
200
+
if(hasTag)errors.push(new_errors.YAMLSyntaxError(node,'A node can have at most one tag'));
201
+
hasTag=true;
202
+
break;
203
+
}
204
+
});
205
+
varanchor=node.anchor;
206
+
if(anchor)anchors[anchor]=node;
207
+
208
+
if(node.type===_Node.Type.ALIAS){
209
+
if(hasAnchor||hasTag)errors.push(new_errors.YAMLSyntaxError(node,'An alias node must not specify any properties'));
210
+
varsrc=anchors[node.rawValue];
211
+
if(src)returnnode.resolved=src.resolved;
212
+
errors.push(new_errors.YAMLReferenceError(node,"Aliased anchor not found: ".concat(node.rawValue)));
0 commit comments