summaryrefslogtreecommitdiff
path: root/volk/gen/volk_regexp.py
blob: eb4ceb54b24574c47ff05858d4a6b3d9b74719bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import re

remove_after_underscore = re.compile("_.*");
space_remove = re.compile(" ");
leading_space_remove = re.compile("^ *");
replace_arch = re.compile(", const char\* arch");
replace_bracket = re.compile(" {");
replace_volk = re.compile("volk");

def strip_trailing(tostrip, stripstr):
    lindex = tostrip.rfind(stripstr)
    tostrip = tostrip[0:lindex] + tostrip[lindex:len(tostrip)].replace(stripstr, "");
    return tostrip