Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/arr/compiler/well-formed.arr
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ fun ensure-distinct-lines(loc :: Loc, prev-is-template :: Boolean, stmts :: List
| link(first, rest) =>
cases(Loc) loc:
| builtin(_) => ensure-distinct-lines(first.l, A.is-s-template(first), rest)
| srcloc(_, _, _, _, end-line1, _, _) =>
| srcloc(end-source1, _, _, _, end-line1, _, _) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be named source1 -- the fields being extracted here are named end-line and start-line, and the suppliers are numbered 1 and 2. So if you're extracting a new field, just name it source

cases(Loc) first.l block:
| builtin(_) => ensure-distinct-lines(loc, prev-is-template, rest) # No need to preserve builtin() locs
| srcloc(_, start-line2, _, _, _, _, _) =>
when (end-line1 == start-line2):
| srcloc(start-source2, start-line2, _, _, _, _, _) =>
when (end-line1 == start-line2) and (end-source1 == start-source2):
if A.is-s-template(first) and prev-is-template:
add-error(C.template-same-line(loc, first.l))
else if not(A.is-s-template(first)) and not(prev-is-template):
Expand Down