Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions build/add-copyright.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# BLIS
# BLIS
# An object-based framework for developing high-performance BLAS-like
# libraries.
#
Expand Down Expand Up @@ -200,7 +200,7 @@ def main():
file_string = "".join( file_lines )

# Search for an existing copyright line.
has_cr = re.search( 'Copyright \(C\)', file_string )
has_cr = re.search( r'Copyright \(C\)', file_string )

# If the file does not have any copyright notice in it already, we
# assume we don't need to update it.
Expand All @@ -210,7 +210,7 @@ def main():

# Check whether the file already has a copyright for the_org. We may
# need to use this information later.
has_org_cr = re.search( 'Copyright \(C\) ([0-9][0-9][0-9][0-9]), %s' % the_org, file_string )
has_org_cr = re.search( r'Copyright \(C\) ([0-9][0-9][0-9][0-9]), %s' % the_org, file_string )

# Initialize the list of processed (potentially modified) file lines.
mod_file_lines = []
Expand All @@ -225,7 +225,7 @@ def main():
# Iterate through the lines in the current file.
for line in file_lines:

result = re.search( 'Copyright \(C\) ([0-9][0-9][0-9][0-9]), %s' % the_org, line )
result = re.search( r'Copyright \(C\) ([0-9][0-9][0-9][0-9]), %s' % the_org, line )

# If the current line matches a copyright line for the_org...
if result:
Expand Down Expand Up @@ -253,7 +253,7 @@ def main():

# Add the unchanged line to the running list.
mod_file_lines += line

else:
# Add the unchanged line to the running list.
mod_file_lines += line
Expand Down Expand Up @@ -284,8 +284,8 @@ def main():
line_next = file_lines[i]

# Try to match both the current line and the next line.
result = re.search( 'Copyright \(C\) ([0-9][0-9][0-9][0-9]), (.*)', line )
resnext = re.search( 'Copyright \(C\) ([0-9][0-9][0-9][0-9]), (.*)', line_next )
result = re.search( r'Copyright \(C\) ([0-9][0-9][0-9][0-9]), (.*)', line )
resnext = re.search( r'Copyright \(C\) ([0-9][0-9][0-9][0-9]), (.*)', line_next )

# Parse the results.
if result:
Expand All @@ -301,7 +301,7 @@ def main():
# The current line matches but the next does not. Thus,
# this branch only executes for the *last* copyright line
# in the file.

# Extract the year and organization from the matched
# string.
old_year = result.group(1)
Expand Down
8 changes: 4 additions & 4 deletions build/flatten-headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def print_usage():

def canonicalize_ws( s ):

return re.sub( '\s+', ' ', s ).strip()
return re.sub( r'\s+', ' ', s ).strip()

# ---

Expand Down Expand Up @@ -166,7 +166,7 @@ def list_contains_header( items ):
rval = False
for item in items:

is_h = re.search( "\.h", item )
is_h = re.search( r"\.h", item )

if is_h:
rval = True
Expand Down Expand Up @@ -198,7 +198,7 @@ def get_header_path( filename, header_dirpaths ):

def strip_cstyle_comments( string ):

return re.sub( "/\*.*?\*/", "", string, flags=re.S )
return re.sub( r"/\*.*?\*/", "", string, flags=re.S )

# ------------------------------------------------------------------------------

Expand Down Expand Up @@ -527,7 +527,7 @@ def main():
# Precompile the main regular expression used to isolate #include
# directives and the headers they reference. This regex object will
# get reused over and over again in flatten_header().
regex = re.compile( '^[\s]*#include (["<])([\w\.\-/]*)([">])' )
regex = re.compile( r'^[\s]*#include (["<])([\w\.\-/]*)([">])' )

# Recursively substitute headers for occurrences of #include directives.
final_string = flatten_header( inputfile, header_dirpaths, nestsp )
Expand Down