Use the new Range class in more places

This commit is contained in:
James Westman 2023-07-25 20:01:41 -05:00
parent 56274d7c1f
commit 3bcc9f4cbd
10 changed files with 91 additions and 90 deletions

View file

@ -70,8 +70,7 @@ class ScopeCtx:
):
raise CompileError(
f"Duplicate object ID '{obj.tokens['id']}'",
token.start,
token.end,
token.range,
)
passed[obj.tokens["id"]] = obj

View file

@ -62,8 +62,7 @@ class UI(AstNode):
else:
gir_ctx.not_found_namespaces.add(i.namespace)
except CompileError as e:
e.start = i.group.tokens["namespace"].start
e.end = i.group.tokens["version"].end
e.range = i.range
self._gir_errors.append(e)
return gir_ctx