MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / OPTIONSMAP

Class OPTIONSMAP

src/main/java/wycc/util/OptArg.java:260–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258 }
259
260 private static final class OPTIONSMAP implements Kind {
261 @Override
262 public void process(String arg, String option, Map<String,Object> options) {
263 String[] name = option.split(":");
264 Map<String, Object> config = Collections.EMPTY_MAP;
265 if (name.length > 1) {
266 config = splitConfig(name[1]);
267 }
268 Map<String,Map<String,Object>> values = (Map<String,Map<String,Object>>) options.get(arg);
269
270 if(values == null) {
271 values = new HashMap<>();
272 options.put(arg, values);
273 }
274
275 Map<String,Object> attributes = values.get(name[0]);
276
277 if(attributes == null) {
278 values.put(name[0], config);
279 } else {
280 attributes.putAll(config);
281 }
282 }
283 @Override
284 public String toString() {
285 return "name:[attribute=value]+";
286 }
287 }
288
289 /**
290 * Parse options from the list of arguments, removing those which are

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected