You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#276 fixes what appears to be a mistake in the F77 parser, where a span isn't set properly: a list is reversed before being placed in the AST, but the span uses the yet-reversed list. The problematic call was getTransSpan:
getSpan []=error"Trying to find how long an empty list spans for."
getSpan [x] = getSpan x
getSpan (x:xs) = getTransSpan x (last xs)
setSpan _ _ =error"Cannot set span to an array"
And following the recursive getTransSpan, we see that by calling this on a reversed list, we accidentally span to the end of the first element instead of the last. Spanning requires things to go from left to right, it doesn't re-order automagically.
I noted another likely mistake in the F2003 parser. This probably happens a handful of times in the parsers.
The text was updated successfully, but these errors were encountered:
#276 fixes what appears to be a mistake in the F77 parser, where a span isn't set properly: a list is reversed before being placed in the AST, but the span uses the yet-reversed list. The problematic call was
getTransSpan
:fortran-src/src/Language/Fortran/Util/Position.hs
Lines 160 to 163 in 6388025
which calls
getSpan
on a list:fortran-src/src/Language/Fortran/Util/Position.hs
Lines 105 to 109 in 6388025
And following the recursive
getTransSpan
, we see that by calling this on a reversed list, we accidentally span to the end of the first element instead of the last. Spanning requires things to go from left to right, it doesn't re-order automagically.I noted another likely mistake in the F2003 parser. This probably happens a handful of times in the parsers.
The text was updated successfully, but these errors were encountered: