From 1dacb0cbf2a58ba70d307c788401a2c5c9123988 Mon Sep 17 00:00:00 2001 From: Bram Gotink Date: Thu, 9 Jan 2025 02:23:23 +0100 Subject: [PATCH] bump KDL parser to improve errors (#42) --- package-lock.json | 11 ++++++----- package.json | 2 +- static/play/play.js | 16 ++++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 225dbf5..c71fe3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@11ty/eleventy": "^3.0.0", "@11ty/eleventy-plugin-vite": "^6.0.0-alpha.3", - "@bgotink/kdl": "^0.2.1", + "@bgotink/kdl": "^0.3.1", "@parcel/packager-raw-url": "^2.13.3", "@parcel/transformer-webmanifest": "^2.13.3", "@tailwindcss/typography": "^0.3.1", @@ -339,10 +339,11 @@ } }, "node_modules/@bgotink/kdl": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bgotink/kdl/-/kdl-0.2.1.tgz", - "integrity": "sha512-0VeRezpHzoyZ15iEdnmsAsQYLywl6icLUzzf8kCIwsHEL5oYXFBOylnuVGv9nvSX//Q+XECaLTi8B9vGD1RG/Q==", - "dev": true + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bgotink/kdl/-/kdl-0.3.1.tgz", + "integrity": "sha512-EQQpjS3RiYNlUymAeO06WUrphzSdmbXzQrJ4s8JAr0Ft5WE67s23i5JaulZ3BO0yHA4tMkUT2cHWEgAq5iJC8Q==", + "dev": true, + "license": "MIT" }, "node_modules/@esbuild/aix-ppc64": { "version": "0.24.2", diff --git a/package.json b/package.json index 0798018..1aeda96 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/static/play/play.js b/static/play/play.js index 34117d9..dff190f 100644 --- a/static/play/play.js +++ b/static/play/play.js @@ -117,10 +117,10 @@ 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) { @@ -128,10 +128,10 @@ addEventListener("DOMContentLoaded", (event) => { 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);