From 7c74c9e34f18a365eb87e1a99a5b63c9d31bd2f4 Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Wed, 5 Jun 2024 00:32:04 -0400 Subject: [PATCH] Add optional (and unused) offset parameter to parse() signature --- src/parser.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parser.ts b/src/parser.ts index d9dc4d4..3f7ad78 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -137,10 +137,11 @@ const ERROR_CONTEXT = /(?<=([^\n]{0,50}))([^\n]{0,50})/y; * Parse out a Notcl script into an easier-to-interpret representation. * No script is actually executed yet. * - * @param - code to parse - * @returns - parsed list of commands, or error message on failure + * @param code code to parse + * @param offset source position of code, if embedded in a larger source document + * @returns parsed list of commands, or error message on failure */ -export function parse(code: string): [true, Script] | [false, string] { +export function parse(code: string, offset = 0): [true, Script] | [false, string] { /* Parse */ const [commands, errorPos, expected] = Script.match(code, 0);