"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "SCons/Scanner/D.py" between
scons-4.2.0.tar.gz and SCons-4.3.0.tar.gz

About: SCons is a software construction tool (a Python script and a set of modules as a superior alternative to the classic "Make" build tool).

D.py  (scons-4.2.0):D.py  (SCons-4.3.0)
skipping to change at line 29 skipping to change at line 29
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""Scanner for the Digital Mars "D" programming language. """Scanner for the Digital Mars "D" programming language.
Coded by Andy Friesen, 17 Nov 2003 Coded by Andy Friesen, 17 Nov 2003
""" """
import SCons.Scanner import SCons.Node.FS
from . import Classic
def DScanner(): def DScanner():
"""Return a prototype Scanner instance for scanning D source files""" """Return a prototype Scanner instance for scanning D source files"""
ds = D() ds = D()
return ds return ds
class D(SCons.Scanner.Classic): class D(Classic):
def __init__ (self): def __init__(self):
SCons.Scanner.Classic.__init__ ( super().__init__(
self, name="DScanner",
name = "DScanner", suffixes='$DSUFFIXES',
suffixes = '$DSUFFIXES', path_variable='DPATH',
path_variable = 'DPATH', regex=r'(?:import\s+)([\w\s=,.]+)(?:\s*:[\s\w,=]+)?(?:;)',
regex = r'(?:import\s+)([\w\s=,.]+)(?:\s*:[\s\w,=]+)?(?:;)'
) )
def find_include(self, include, source_dir, path): def find_include(self, include, source_dir, path):
# translate dots (package separators) to slashes # translate dots (package separators) to slashes
inc = include.replace('.', '/') inc = include.replace('.', '/')
i = SCons.Node.FS.find_file(inc + '.d', (source_dir,) + path) i = SCons.Node.FS.find_file(inc + '.d', (source_dir,) + path)
if i is None: if i is None:
i = SCons.Node.FS.find_file (inc + '.di', (source_dir,) + path) i = SCons.Node.FS.find_file(inc + '.di', (source_dir,) + path)
return i, include return i, include
def find_include_names(self, node): def find_include_names(self, node):
includes = [] includes = []
for iii in self.cre.findall(node.get_text_contents()): for iii in self.cre.findall(node.get_text_contents()):
for jjj in iii.split(','): for jjj in iii.split(','):
kkk = jjj.split('=')[-1] kkk = jjj.split('=')[-1]
includes.append(kkk.strip()) includes.append(kkk.strip())
return includes return includes
 End of changes. 3 change blocks. 
10 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)