diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2006-07-05 09:49:16 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2006-07-05 09:49:16 +0000 |
commit | 085ea43714e8f551d30840b0e60c7cc235ec53ff (patch) | |
tree | 679c98e64cb69c09d1a58eed61ccb39e54c9ede8 /numpy/f2py/lib/utils.py | |
parent | f72e5a81b1242f1d350b4a738393d085b4dba86b (diff) | |
download | numpy-085ea43714e8f551d30840b0e60c7cc235ec53ff.tar.gz |
Working on Fortran analyzer.
Diffstat (limited to 'numpy/f2py/lib/utils.py')
-rw-r--r-- | numpy/f2py/lib/utils.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/numpy/f2py/lib/utils.py b/numpy/f2py/lib/utils.py index 7a501144e..7a194c9c7 100644 --- a/numpy/f2py/lib/utils.py +++ b/numpy/f2py/lib/utils.py @@ -9,6 +9,9 @@ class AnalyzeError(Exception): pass is_name = re.compile(r'^[a-z_]\w*$',re.I).match +name_re = re.compile(r'[a-z_]\w*',re.I).match +is_entity_decl = re.compile(r'^[a-z_]\w*',re.I).match +is_int_literal_constant = re.compile(r'^\d+(_\w+|)$').match def split_comma(line, item = None, comma=','): items = [] @@ -26,7 +29,7 @@ def split_comma(line, item = None, comma=','): items.append(s) return items -def specs_split_comma(line, item = None): +def specs_split_comma(line, item = None, upper=False): specs0 = split_comma(line, item) specs = [] for spec in specs0: @@ -36,6 +39,8 @@ def specs_split_comma(line, item = None): v = spec[i+1:].strip() specs.append('%s = %s' % (kw, v)) else: + if upper: + spec = spec.upper() specs.append(spec) return specs @@ -51,8 +56,7 @@ def parse_bind(line, item = None): i = newline.find(')') assert i!=-1,`newline` args = [] - for a in specs_split_comma(newline[1:i].strip(), newitem): - if a=='c': a = a.upper() + for a in specs_split_comma(newline[1:i].strip(), newitem, upper=True): args.append(a) rest = newline[i+1:].lstrip() if item is not None: |