Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 076781b

Browse files
committed
Fixed layout
1 parent 66f40e1 commit 076781b

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/org/rascalmpl/core/library/lang/rascalcore/check/RascalConfig.rsc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,18 @@ Accept rascalIsAcceptableSimple(loc def, Use use, Solver s){
8989
}
9090
}
9191
return ignoreContinue();
92-
} else if(!isEmpty(use.idRoles & defBeforeUseRoles) // If we encounter a use before def
93-
&& isContainedIn(def, use.scope) // in an idRole that requires def before use
94-
){ // and the definition is in the same scope as the use
95-
// then only allow this when inside explicitly defined areas (typically the result part of a comprehension)
96-
if(lrel[loc,loc] allowedParts := s.getStack(key_allow_use_before_def)){
97-
list[loc] parts = allowedParts[use.scope];
98-
return !isEmpty(parts) && any(part <- parts, isContainedIn(use.occ, part)) ? acceptBinding() : ignoreContinue();
99-
} else {
100-
throw "Inconsistent value stored for <key_allow_use_before_def>: <s.getStack(key_allow_use_before_def)>";
101-
}
102-
}
92+
} else
93+
if(!isEmpty(use.idRoles & defBeforeUseRoles) // If we encounter a use before def
94+
&& isContainedIn(def, use.scope) // in an idRole that requires def before use
95+
){ // and the definition is in the same scope as the use
96+
// then only allow this when inside explicitly defined areas (typically the result part of a comprehension)
97+
if(lrel[loc,loc] allowedParts := s.getStack(key_allow_use_before_def)){
98+
list[loc] parts = allowedParts[use.scope];
99+
return !isEmpty(parts) && any(part <- parts, isContainedIn(use.occ, part)) ? acceptBinding() : ignoreContinue();
100+
} else {
101+
throw "Inconsistent value stored for <key_allow_use_before_def>: <s.getStack(key_allow_use_before_def)>";
102+
}
103+
}
103104
}
104105
105106
// Uses of a keyword formal inside its initializing expression are rejected

0 commit comments

Comments
 (0)