gh-113299: Move cpp.py into libclinic (#113526)

This commit is contained in:
Erlend E. Aasland 2023-12-28 00:20:57 +01:00 committed by GitHub
parent 87295b4068
commit 7ab9efdd6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -3920,7 +3920,7 @@ class ClinicReprTests(unittest.TestCase):
self.assertEqual(repr(parameter), "<clinic.Parameter 'bar'>")
def test_Monitor_repr(self):
monitor = clinic.cpp.Monitor("test.c")
monitor = libclinic.cpp.Monitor("test.c")
self.assertRegex(repr(monitor), r"<clinic.Monitor \d+ line=0 condition=''>")
monitor.line_number = 42

View File

@ -13,7 +13,6 @@ import builtins as bltns
import collections
import contextlib
import copy
import cpp
import dataclasses as dc
import enum
import functools
@ -53,6 +52,7 @@ from typing import (
# Local imports.
import libclinic
import libclinic.cpp
from libclinic import ClinicError
@ -648,7 +648,7 @@ class CLanguage(Language):
def __init__(self, filename: str) -> None:
super().__init__(filename)
self.cpp = cpp.Monitor(filename)
self.cpp = libclinic.cpp.Monitor(filename)
def parse_line(self, line: str) -> None:
self.cpp.writeline(line)

View File

@ -3,7 +3,10 @@ import re
import sys
from typing import NoReturn
from libclinic.errors import ParseError
from .errors import ParseError
__all__ = ["Monitor"]
TokenAndCondition = tuple[str, str]