mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-11-09 07:33:43 +01:00
add support for interface block
This commit is contained in:
parent
7a4b8cb8dc
commit
5e15a7ad05
@ -37,12 +37,12 @@ re_enddo = re.compile("end\s+do")
|
|||||||
re_endtype= re.compile("end\s+type")
|
re_endtype= re.compile("end\s+type")
|
||||||
re_endmodule = re.compile("end\s+module")
|
re_endmodule = re.compile("end\s+module")
|
||||||
re_endselect = re.compile("end\s+select")
|
re_endselect = re.compile("end\s+select")
|
||||||
|
re_endinterface = re.compile("end\s+interface")
|
||||||
|
|
||||||
# Local variables
|
# Local variables
|
||||||
Free_form = 0
|
Free_form = 0
|
||||||
Fixed_form = 1
|
Fixed_form = 1
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Dictionary of simple statements
|
# Dictionary of simple statements
|
||||||
simple_dict = {
|
simple_dict = {
|
||||||
@ -95,6 +95,9 @@ def get_type (i, filename, line, is_doc):
|
|||||||
assert type(line) == str
|
assert type(line) == str
|
||||||
assert type(is_doc) == bool
|
assert type(is_doc) == bool
|
||||||
|
|
||||||
|
# add support for interface block
|
||||||
|
has_interface = False
|
||||||
|
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
line = line.replace("$IRP_ALIGN",command_line.align)
|
line = line.replace("$IRP_ALIGN",command_line.align)
|
||||||
lower_line0 = line.lstrip().lower()
|
lower_line0 = line.lstrip().lower()
|
||||||
@ -107,6 +110,7 @@ def get_type (i, filename, line, is_doc):
|
|||||||
lower_line = re_endmodule.sub("endmodule",lower_line)
|
lower_line = re_endmodule.sub("endmodule",lower_line)
|
||||||
lower_line = re_endif.sub("endif",lower_line)
|
lower_line = re_endif.sub("endif",lower_line)
|
||||||
lower_line = re_endselect.sub("endselect",lower_line)
|
lower_line = re_endselect.sub("endselect",lower_line)
|
||||||
|
lower_line = re_endinterface.sub("endinterface",lower_line)
|
||||||
|
|
||||||
for c in """()'"[]""":
|
for c in """()'"[]""":
|
||||||
lower_line = lower_line.replace(c," "+c+" ")
|
lower_line = lower_line.replace(c," "+c+" ")
|
||||||
@ -122,6 +126,14 @@ def get_type (i, filename, line, is_doc):
|
|||||||
firstword = buffer[0]
|
firstword = buffer[0]
|
||||||
|
|
||||||
# Identify line
|
# Identify line
|
||||||
|
if firstword == "endinterface":
|
||||||
|
has_interface = False
|
||||||
|
return [ Simple_line (i,line,filename) ], False
|
||||||
|
|
||||||
|
if firstword == "interface" or has_interface:
|
||||||
|
has_interface = True
|
||||||
|
return [ Simple_line (i,line,filename) ], False
|
||||||
|
|
||||||
if firstword == "end_doc":
|
if firstword == "end_doc":
|
||||||
return [ End_doc (i,line,filename) ], False
|
return [ End_doc (i,line,filename) ], False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user