10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-11-12 17:13:42 +01:00

Optimization => Faster by 20%

Version:1.1.30
This commit is contained in:
Anthony Scemama 2009-09-29 15:01:34 +02:00
parent dfe5442c46
commit bcc3b5838b
2 changed files with 7 additions and 6 deletions

View File

@ -33,19 +33,20 @@ from subroutines import subroutines
import regexps
import error
vtuple = map(lambda v: (v, variables[v], variables[v].same_as, variables[v].regexp), variables.keys())
def find_variables_in_line(line):
assert isinstance(line,Line)
result = []
sub_done = False
buffer = line.text.lower()
for v in variables.keys():
var = variables[v]
if var.name in buffer:
for v,var,same_as,regexp in vtuple:
if v in buffer:
if not sub_done:
buffer = regexps.re_string.sub('',buffer)
sub_done = True
if var.regexp.search(buffer) is not None:
result.append(var.same_as)
if regexp.search(buffer) is not None:
result.append(same_as)
return result
def find_subroutine_in_line(line):

View File

@ -1 +1 @@
version = "1.1.29"
version = "1.1.30"