refactorings

This commit is contained in:
nora 2023-08-02 19:18:52 +02:00
parent 7eeaf548d0
commit 2f1f4a9798
12 changed files with 85 additions and 100 deletions

View file

@ -92,7 +92,7 @@ export function tokenize(file: LoadedFile): Token[] {
finish: while (i < input.length) {
const next = input[i];
const span: Span = { start: i, end: i + 1, file };
const span: Span = new Span(i, i + 1, file);
if (next === "/" && input[i + 1] === "/") {
while (input[i] !== "\n") {
@ -206,7 +206,7 @@ export function tokenize(file: LoadedFile): Token[] {
default:
throw new CompilerError(
`invalid escape character: ${input[i]}`,
{ start: span.end - 1, end: span.end, file }
new Span(span.end - 1, span.end, file)
);
}
continue;