Skip to content

Commit

Permalink
bump KDL parser to improve errors (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgotink authored Jan 9, 2025
1 parent 962633e commit 1dacb0c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"shiki": "^1.24.2",
"svgo": "^3.3.2",
"tailwindcss": "^2.0.2",
"@bgotink/kdl": "^0.2.1",
"@bgotink/kdl": "^0.3.1",
"monaco-editor": "^0.52.0",
"monaco-themes": "^0.4.4"
},
Expand Down
16 changes: 8 additions & 8 deletions static/play/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,21 @@ addEventListener("DOMContentLoaded", (event) => {
markers.push({
message: error.message,
severity: monaco.MarkerSeverity.Error,
startLineNumber: error.token?.start.line,
startColumn: error.token?.start.column,
endLineNumber: error.token?.end.line,
endColumn: error.token?.end.column,
startLineNumber: error.start?.line,
startColumn: error.start?.column,
endLineNumber: error.end?.line,
endColumn: error.end?.column,
})
} else if (typeof AggregateError === 'function' && error instanceof AggregateError) {
for (const suberror of error.errors) {
if (suberror instanceof KDL.InvalidKdlError) {
markers.push({
message: suberror.message,
severity: monaco.MarkerSeverity.Error,
startLineNumber: suberror.token?.start.line,
startColumn: suberror.token?.start.column,
endLineNumber: suberror.token?.end.line,
endColumn: suberror.token?.end.column,
startLineNumber: suberror.start?.line,
startColumn: suberror.start?.column,
endLineNumber: suberror.end?.line,
endColumn: suberror.end?.column,
})
} else {
console.error(suberror);
Expand Down

0 comments on commit 1dacb0c

Please # to comment.