• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wurstscript / WurstScript / 228

29 Nov 2023 05:00PM UTC coverage: 62.48% (-0.09%) from 62.574%
228

push

circleci

web-flow
Show dialog for choosing game path, cleanup (#1083)

* show dialog for choosing game path

* cleanup code

* remove logs and refactor

* remove confusing mpq error, make some mpq loads readonly

17295 of 27681 relevant lines covered (62.48%)

0.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.55
de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/WurstChecker.java
1
package de.peeeq.wurstscript;
2

3
import com.google.common.base.Preconditions;
4
import de.peeeq.wurstscript.ast.CompilationUnit;
5
import de.peeeq.wurstscript.ast.WurstModel;
6
import de.peeeq.wurstscript.attributes.ErrorHandler;
7
import de.peeeq.wurstscript.gui.WurstGui;
8
import de.peeeq.wurstscript.validation.TRVEHelper;
9
import de.peeeq.wurstscript.validation.WurstValidator;
10

11
import java.util.Collection;
12

13
public class WurstChecker {
14

15
    private final WurstGui gui;
16
    private final ErrorHandler errorHandler;
17

18
    public WurstChecker(WurstGui gui, ErrorHandler errorHandler) {
1✔
19
        this.gui = gui;
1✔
20
        this.errorHandler = errorHandler;
1✔
21
    }
1✔
22

23
    public void checkProg(WurstModel root, Collection<CompilationUnit> toCheck) {
24
        Preconditions.checkNotNull(root);
1✔
25
        Preconditions.checkNotNull(toCheck);
1✔
26
        if (root.isEmpty()) {
1✔
27
            return;
×
28
        }
29
        TRVEHelper.protectedVariables.clear();
1✔
30
        gui.sendProgress("Checking Files");
1✔
31

32
        if (errorHandler.getErrorCount() > 0) return;
1✔
33

34
        attachErrorHandler(root);
1✔
35

36
        expandModules(root);
1✔
37

38
        if (errorHandler.getErrorCount() > 0) return;
1✔
39

40
        // compute the flow attributes
41
        for (CompilationUnit cu : toCheck) {
1✔
42
            WurstValidator.computeFlowAttributes(cu);
1✔
43
        }
1✔
44

45

46
        // validate the resource:
47
        WurstValidator validator = new WurstValidator(root);
1✔
48
        validator.validate(toCheck);
1✔
49
        WLogger.info("debug - finished checkProg");
1✔
50
    }
1✔
51

52
    private void attachErrorHandler(WurstModel root) {
53
        for (CompilationUnit cu : root) {
1✔
54
            cu.getCuInfo().setCuErrorHandler(errorHandler);
1✔
55
        }
1✔
56
    }
1✔
57

58
    private void expandModules(WurstModel root) {
59
        for (CompilationUnit cu : root) {
1✔
60
            ModuleExpander.expandModules(cu);
1✔
61
        }
1✔
62
    }
1✔
63

64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc