Open rebcabin opened 2 years ago
Can you give an example? I can't reproduce it. The following Fortran code:
integer :: x(2:4, 3)
Prints as:
x:
(Variable
2
x
Local
()
()
Default
(Integer 4 [((IntegerConstant 2 (Integer 4 []))
(IntegerConstant 3 (Integer 4 [])))
((IntegerConstant 1 (Integer 4 []))
(IntegerConstant 3 (Integer 4 [])))])
Source
Public
Required
.false.
)
Which already seems exactly in the form that you want.
Is the long-form acceptable input to ASR processors?
Yes, I would recommend to only use long form. We use short form in AST, but it doesn't seem worth it, because one looks at it infrequently, and when one does look at it, it's better to use longform so that one knows exactly what nodes are in there.
Investigating ... I thought I saw this in one of the LPython xxx.stdout
examples.
I noticed that while
dimension
is spec'ced as followsconcrete examples of dimension print out as in the following
instead of as
This is surprising because 2, 3, and 4 in
[2 3] [4]
are notexpr
s.Is this just shorthand in the printout? Is the long-form acceptable input to ASR processors?