Commit 00a7f918 authored by Gaurav Kukreja's avatar Gaurav Kukreja

Fixed Indentation in AliasFile.py, verified working.

parent 37eafe49
...@@ -4,30 +4,30 @@ import fn ...@@ -4,30 +4,30 @@ import fn
def process(sourceFile,fnHash): def process(sourceFile,fnHash):
f=open(sourceFile+ '.055t.alias');#'.t29.alias1'); f=open(sourceFile+ '.055t.alias');#'.t29.alias1');
line = f.readline(); line = f.readline();
re_fnStart=re.compile(';; Function'); re_fnStart=re.compile(';; Function');
re_word=re.compile('\w+'); re_word=re.compile('\w+');
re_varStart=re.compile('Referenced variables in '); re_varStart=re.compile('Referenced variables in ');
re_varLine=re.compile('Variable:'); re_varLine=re.compile('Variable:');
re_getVar=re.compile('Variable: |, |\n'); re_getVar=re.compile('Variable: |, |\n');
var_read=0 var_read=0
while line: while line:
if re_fnStart.match(line): if re_fnStart.match(line):
m=re_word.findall(line); m=re_word.findall(line);
fnName=m[1]; fnName=m[1];
fnHash[fnName]=fn.Function(fnName); fnHash[fnName]=fn.Function(fnName);
#print fnName; #############debugging #print fnName; #############debugging
if var_read==1: if var_read==1:
if re_varLine.match(line): if re_varLine.match(line):
m=re_getVar.split(line); m=re_getVar.split(line);
m[3]=re.sub(r'\{.*\}', '', m[3]); m[3]=re.sub(r'\{.*\}', '', m[3]);
fnHash[fnName].addVar(m[1].strip(),m[3].strip()); fnHash[fnName].addVar(m[1].strip(),m[3].strip());
elif line.strip(): elif line.strip():
var_read=0; var_read=0;
if re_varStart.match(line): if re_varStart.match(line):
var_read=1; var_read=1;
line=f.readline(); line=f.readline();
f.close(); f.close();
return 1; return 1;
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