Meta: Clarify that webidl_parser.py's raise_parse_error() cannot return

This allows functions to skip returning/asserting after calling it.
This commit is contained in:
Zaggy1024 2026-04-29 21:37:35 -05:00 committed by Gregory Bertilson
parent d89e9bb44d
commit c0609f4ee1

View file

@ -7,6 +7,7 @@ from dataclasses import field
from pathlib import Path
from typing import Dict
from typing import List
from typing import NoReturn
from typing import Optional
from Utils.lexer import Lexer
@ -412,7 +413,7 @@ class Parser:
if not self.lexer.consume_specific(expected_character):
self.raise_parse_error(f"expected '{expected_character}'")
def raise_parse_error(self, message: str) -> None:
def raise_parse_error(self, message: str) -> NoReturn:
line_number = 1
column_number = 1