Skip to content

Commit e99af8d

Browse files
committed
rename
1 parent 41cebbd commit e99af8d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/parser/parser_lib.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,30 +221,30 @@ function generateError(
221221
position: number,
222222
expected: string,
223223
): ArrayResult<never> {
224-
let source: string;
224+
let unexpected: string;
225225
let length: number;
226226
if (position === currentSource.length) {
227-
source = "end of text";
227+
unexpected = "end of text";
228228
length = 0;
229229
} else {
230230
const sourceString = currentSource.slice(position);
231231
const [token] = sourceString.match(/^\S*/)!;
232232
if (token === "") {
233233
if (/^\r?\n/.test(sourceString)) {
234-
source = "newline";
234+
unexpected = "newline";
235235
length = 0;
236236
} else {
237237
const [token] = sourceString.match(/^\s+?(?=\S|\r?\n|$)/)!;
238-
source = "space";
238+
unexpected = "space";
239239
length = token.length;
240240
}
241241
} else {
242-
source = `"${token}"`;
242+
unexpected = `"${token}"`;
243243
length = token.length;
244244
}
245245
}
246246
return new ArrayResult(
247-
new UnexpectedError(source, expected, { position, length }),
247+
new UnexpectedError(unexpected, expected, { position, length }),
248248
);
249249
}
250250
export function matchCapture(

0 commit comments

Comments
 (0)