10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-06-19 11:42:08 +02:00
irpf90/src/regexps.py
2009-09-09 16:59:43 +02:00

31 lines
622 B
Python

#!/usr/bin/python
import re
re_comment = re.compile(r"^([^'!]*)('[^']*'[^']*)*!")
re_decl = re.compile( "".join( [ r"^\ *",
r"(integer[(::)?\* ,]+",
r"|double *precision[(::)?\* ,]+",
r"|logical[(::)?\* ,]+",
r"|character[(::)?\* ,]+",
r"|real[(::)?\* ,]+",
r"|dimension *(::)?",
r"|parameter *(::)?",
r"|data */",
r"|allocatable *(::)?",
r"|common */",
r"|namelist */",
r"|save */",
r"|complex[(::)?\* ,]+",
r"|intrinsic *(::)?",
r"|external *(::)?",
r"|equivalence *(::)?",
r")[^=(]"
] ) )
re_test = re.compile(r"\( *(.*)(\.[a-zA-Z]*\.|[<>]=?|[=/]=)([^=]*)\)")
re_string = re.compile(r"'.*'")