Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Apr 7, 2022
1 parent daea8de commit 5600507
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/context.ts
Expand Up @@ -75,6 +75,7 @@ export class Context {
return token
}

/* istanbul ignore next */
public throwUnexpectedTokenError(cst: CST.Token): ParseError {
const token = "source" in cst ? `'${cst.source}'` : cst.type
throw this.throwError(`Unexpected token: ${token}`, cst)
Expand Down
3 changes: 3 additions & 0 deletions src/convert.ts
Expand Up @@ -921,6 +921,7 @@ function convertMappingValue(
return convertContentNode(preTokens, cst, node, ctx, parent, doc)
}

/* istanbul ignore if */
if (!isScalarOrNull(node)) {
throw ctx.throwError(
`unknown error: AST is not Scalar and null (${getNodeType(
Expand Down Expand Up @@ -1039,6 +1040,7 @@ function convertSequenceItem(
}
return convertContentNode(preTokens, cst.value, node, ctx, parent, doc)
}
/* istanbul ignore if */
if (!isScalarOrNull(node)) {
throw ctx.throwError(
`unknown error: AST is not Scalar and null (${getNodeType(
Expand Down Expand Up @@ -1074,6 +1076,7 @@ function convertFlowSequenceItem(
return convertContentNode(preTokens, cst, node, ctx, parent, doc)
}

/* istanbul ignore if */
if (!isScalarOrNull(node)) {
throw ctx.throwError(
`unknown error: AST is not Scalar and null (${getNodeType(
Expand Down

0 comments on commit 5600507

Please sign in to comment.