diff --git a/cgen/__init__.py b/cgen/__init__.py index 97a878efe20c7e6aae55e66451b910ea80f59ae7..f42ccd66a87174ba7b17a9cf1a89d39569299696 100644 --- a/cgen/__init__.py +++ b/cgen/__init__.py @@ -816,11 +816,15 @@ class Line(Generable): class Comment(Generable): - def __init__(self, text): + def __init__(self, text, skip_space=False): self.text = text + if skip_space: + self.fmt_str = "/*%s*/" + else: + self.fmt_str = "/* %s */" def generate(self): - yield "/* %s */" % self.text + yield self.fmt_str % self.text mapper_method = "map_comment" diff --git a/cgen/version.py b/cgen/version.py new file mode 100644 index 0000000000000000000000000000000000000000..922dd503cf5856279cfaadc1adedf45efb8b35cd --- /dev/null +++ b/cgen/version.py @@ -0,0 +1,3 @@ +VERSION = (2018, 1) +VERSION_STATUS = "" +VERSION_TEXT = ".".join(str(x) for x in VERSION) + VERSION_STATUS diff --git a/setup.py b/setup.py index 8ab7b03ee64ab314b3f4d93f386bc8df9ae5b89b..804c236e81f5eae4a2bebeb8a567d48f030b4395 100644 --- a/setup.py +++ b/setup.py @@ -6,9 +6,15 @@ from setuptools import setup with open("README.rst", "rt") as inf: readme = inf.read() +ver_dic = {} +with open("cgen/version.py") as version_file: + version_file_contents = version_file.read() + +exec(compile(version_file_contents, "cgen/version.py", 'exec'), ver_dic) + setup( name="cgen", - version="2017.1", + version=ver_dic["VERSION_TEXT"], description="C/C++ source generation from an AST", long_description=readme, classifiers=[