|
|
@@ -38,13 +38,15 @@ def separate_imports(content):
|
|
|
imports = []
|
|
|
|
|
|
filename = '[a-zA-Z0-9\._-]+'
|
|
|
- comma = re.compile(' *, *(?:\\\\\r?\n *)?')
|
|
|
+ comma = re.compile(' *, *(?:\\\\\r?\n *)?', re.M)
|
|
|
file_list = '%s(?:%s%s?)*' % (filename, comma.pattern, filename)
|
|
|
- m = re.match('^import (%s)(?:(?:\r?\n)+(.*))?$' % file_list, content, re.M)
|
|
|
+ m = re.match('^import (%s)(?:(?:\r?\n)+((?:.|\n)*))?$' % file_list,
|
|
|
+ content, re.M)
|
|
|
|
|
|
if m:
|
|
|
imports = comma.split(m.group(1))
|
|
|
content = m.group(2)
|
|
|
+ print 'groups:', m.groups()
|
|
|
|
|
|
if not content:
|
|
|
content = ''
|
|
|
@@ -136,6 +138,9 @@ class Importer(Cache):
|
|
|
|
|
|
# Parse imports from file content
|
|
|
imports, content = separate_imports(raw)
|
|
|
+ if imports:
|
|
|
+ print 'imports:', imports
|
|
|
+ print 'content:', content
|
|
|
self.import_map.update({path: imports})
|
|
|
|
|
|
# Only add imported files that have not been loaded yet
|
|
|
@@ -159,7 +164,7 @@ class Importer(Cache):
|
|
|
#concat += self.concatenate(new_imports, path)
|
|
|
|
|
|
concat += content
|
|
|
- self.loaded += path
|
|
|
+ self.loaded.append(path)
|
|
|
|
|
|
return concat
|
|
|
|