Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clinic only accepts CLanguage
  • Loading branch information
erlend-aasland committed May 21, 2023
commit f84c3d312534f62471fec280770cddb63c2cb4d7
5 changes: 3 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ class Clinic:

def __init__(
self,
language: Language,
language: CLanguage,
printer: BlockPrinter | None = None,
*,
verify: bool = True,
Expand All @@ -2060,7 +2060,7 @@ def __init__(
# maps strings to Parser objects.
# (instantiated from the "parsers" global.)
self.parsers: ParserDict = {}
Comment thread
erlend-aasland marked this conversation as resolved.
self.language: Language = language
self.language: CLanguage = language
if printer:
fail("Custom printers are broken right now")
self.printer = printer or BlockPrinter(language)
Expand Down Expand Up @@ -2273,6 +2273,7 @@ def parse_file(
if not find_start_re.search(raw):
return

assert isinstance(language, CLanguage)
clinic = Clinic(language, verify=verify, filename=filename)
src_out, clinic_out = clinic.parse(raw)

Expand Down