MCPcopy Create free account
hub / github.com/badvision/jace / extractOutput

Method extractOutput

src/main/java/jace/assembly/AcmeCompiler.java:134–153  ·  view source on GitHub ↗
(String output)

Source from the content-addressed store, hash-verified

132 }
133
134 public void extractOutput(String output) throws NumberFormatException {
135 for (String line : output.split("\\n")) {
136 rawOutput.add(line);
137 int lineNumberStart = line.indexOf(", line") + 6;
138 if (lineNumberStart > 6) {
139 int lineNumberEnd = line.indexOf(' ', lineNumberStart+1);
140 int actualLineNumber = Integer.parseUnsignedInt(line.substring(lineNumberStart, lineNumberEnd).trim());
141 String message = line.substring(lineNumberEnd).trim();
142 if (line.startsWith("Error")) {
143 errors.put(actualLineNumber, message);
144 } else {
145 warnings.put(actualLineNumber, message);
146 }
147 } else {
148 if (line.trim().length() > 1) {
149 otherWarnings.add(line);
150 }
151 }
152 }
153 }
154
155 public void restoreSystemOutput() {
156 System.setOut(systemOut);

Callers 1

invokeAcmeMethod · 0.95

Calls 1

addMethod · 0.80

Tested by

no test coverage detected