Commit e995613b authored by Stefan Behnel's avatar Stefan Behnel

support cross-file utility code dependencies by writing '@requires: filename.c::utilname'

--HG--
extra : transplant_source : n%98%20%EE%A3N%1D%20%3F%88%2A%8B%FE%A0%01%97%9F%04%ED%23
parent 2b81fd27
...@@ -113,7 +113,7 @@ class UtilityCodeBase(object): ...@@ -113,7 +113,7 @@ class UtilityCodeBase(object):
replace_comments = re.compile(r'^\s*//.*|^\s*/\*[^*]*\*/').sub replace_comments = re.compile(r'^\s*//.*|^\s*/\*[^*]*\*/').sub
match_special = re.compile( match_special = re.compile(
(r'^%(C)s{5,30}\s*((?:\w|\.)+)\s*%(C)s{5,30}|' (r'^%(C)s{5,30}\s*((?:\w|\.)+)\s*%(C)s{5,30}|'
r'^%(C)s+@(requires)\s*:\s*((?:\w|\.)+)' # add more tag names here at need r'^%(C)s+@(requires)\s*:\s*((?:\w|[.:])+)' # add more tag names here at need
) % {'C':comment}).match ) % {'C':comment}).match
f = Utils.open_source_file(filename, encoding='UTF-8') f = Utils.open_source_file(filename, encoding='UTF-8')
...@@ -171,7 +171,9 @@ class UtilityCodeBase(object): ...@@ -171,7 +171,9 @@ class UtilityCodeBase(object):
load it from the file util_code_name.*. There should be only one load it from the file util_code_name.*. There should be only one
file matched by this pattern. file matched by this pattern.
""" """
if from_file is None: if '::' in util_code_name:
from_file, util_code_name = util_code_name.rsplit('::', 1)
if not from_file:
utility_dir = get_utility_dir() utility_dir = get_utility_dir()
prefix = util_code_name + '.' prefix = util_code_name + '.'
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment