Skip to content
Browse files

Made core loop more readable

  • Loading branch information...
1 parent c16961d commit a31224d0ef44fa30aec6d82d600d315a4bb891c5 @DavyLandman committed Apr 23, 2012
Showing with 7 additions and 9 deletions.
  1. +7 −9 src/lang/StateDuino/semantics/StructureChecking.rsc
View
16 src/lang/StateDuino/semantics/StructureChecking.rsc
@@ -41,15 +41,13 @@ private set[Message] checkForDefineLoops(StateMachine sm) {
set[str] invalidChains = {};
solve(invalidChains) {
- for (c:chain(n:name(str st),_ ) <- sm.definitions) {
- if (<st, st> in chainPaths) {
- invalidChains += {st};
- result += error("<st> has a definition loop.", n@location);
- }
- else if ((chainPaths[st] & invalidChains) > {}) {
- invalidChains += {st};
- result += error("<st> calls a chain which has a definition loop.", n@location);
- }
+ for (chain(n:name(str st),_ ) <- sm.definitions, <st, st> in chainPaths) {
+ invalidChains += {st};
+ result += error("<st> has a definition loop.", n@location);
+ }
+ for (chain(n:name(str st),_ ) <- sm.definitions, (chainPaths[st] & invalidChains) > {}) {
+ invalidChains += {st};
+ result += error("<st> calls a chain which has a definition loop.", n@location);
}
}
return result;

0 comments on commit a31224d

Please sign in to comment.
Something went wrong with that request. Please try again.