aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/code_generator.py
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /build/plugins/code_generator.py
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'build/plugins/code_generator.py')
-rw-r--r--build/plugins/code_generator.py45
1 files changed, 0 insertions, 45 deletions
diff --git a/build/plugins/code_generator.py b/build/plugins/code_generator.py
deleted file mode 100644
index c1dc7922019..00000000000
--- a/build/plugins/code_generator.py
+++ /dev/null
@@ -1,45 +0,0 @@
-import re
-import os
-
-import ymake
-
-pattern = re.compile(r"#include\s*[<\"](?P<INDUCED>[^>\"]+)[>\"]|(?:@|{@)\s*(?:import|include|from)\s*[\"'](?P<INCLUDE>[^\"']+)[\"']")
-
-
-class CodeGeneratorTemplateParser(object):
- def __init__(self, path, unit):
- self._path = path
- retargeted = os.path.join(unit.path(), os.path.relpath(path, unit.resolve(unit.path())))
- with open(path, 'rb') as f:
- includes, induced = CodeGeneratorTemplateParser.parse_includes(f.readlines())
- self._includes = unit.resolve_include([retargeted] + includes) if includes else []
- self._induced = unit.resolve_include([retargeted] + induced) if induced else []
-
- @staticmethod
- def parse_includes(lines):
- includes = []
- induced = []
-
- for line in lines:
- for match in pattern.finditer(line):
- type = match.lastgroup
- if type == 'INCLUDE':
- includes.append(match.group(type))
- elif type == 'INDUCED':
- induced.append(match.group(type))
- else:
- raise Exception("Unexpected match! Perhaps it is a result of an error in pattern.")
- return (includes, induced)
-
- def includes(self):
- return self._includes
-
- def induced_deps(self):
- return {
- 'h+cpp': self._induced
- }
-
-
-def init():
- ymake.addparser('markettemplate', CodeGeneratorTemplateParser)
- ymake.addparser('macro', CodeGeneratorTemplateParser)