Commit Graph

5 Commits

Author SHA1 Message Date
Erlend E. Aasland 1709020e8e
gh-113317: Move FormatCounterFormatter into libclinic (#114066) 2024-01-15 00:09:26 +01:00
Erlend E. Aasland 5dbcdfdeb8
gh-113317: Move global utility functions into libclinic (#113986)
Establish Tools/clinic/libclinic/utils.py and move the following
functions over there:

- compute_checksum()
- create_regex()
- write_file()
2024-01-14 18:26:09 +00:00
Erlend E. Aasland 87295b4068
gh-113317: Rework Argument Clinic cpp.py error handling (#113525)
Rework error handling in the C preprocessor helper. Instead of monkey-
patching the cpp.Monitor.fail() method from within clinic.py, rewrite
cpp.py to use a subclass of the ClinicError exception. As a side-effect,
ClinicError is moved into Tools/clinic/libclinic/errors.py.

Yak-shaving in preparation for putting cpp.py into libclinic.
2023-12-27 21:43:19 +00:00
Erlend E. Aasland ca71987f4e
gh-113317: Move more formatting helpers into libclinic (#113438)
Move the following global helpers into libclinic:
- format_escape()
- normalize_snippet()
- wrap_declarations()

Also move strip_leading_and_trailing_blank_lines() and make it internal to libclinic.
2023-12-23 17:08:10 +00:00
Erlend E. Aasland c3f92f6a75
gh-113317: Clean up Argument Clinic global namespace (#113414)
Split up clinic.py by establishing libclinic as a support package for
Argument Clinic. Get rid of clinic.py globals by either making them
class members, or by putting them into libclinic.

- Move INCLUDE_COMMENT_COLUMN to BlockPrinter
- Move NO_VARARG to CLanguage
- Move formatting helpers to libclinic
- Move some constants to libclinic (and annotate them as Final)
2023-12-23 00:37:39 +00:00