MCPcopy Create free account
hub / github.com/crawl/crawl / parse

Method parse

crawl-ref/source/mapdef.cc:332–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332level_range level_range::parse(string s)
333{
334 level_range lr;
335 trim_string(s);
336
337 if (s == "*")
338 {
339 lr.set("any", 0, BRANCH_END);
340 return lr;
341 }
342
343 if (s[0] == '!')
344 {
345 lr.deny = true;
346 s = trimmed_string(s.substr(1));
347 }
348
349 string::size_type cpos = s.find(':');
350 if (cpos == string::npos)
351 parse_partial(lr, s);
352 else
353 {
354 string br = trimmed_string(s.substr(0, cpos));
355 string depth = trimmed_string(s.substr(cpos + 1));
356 parse_depth_range(depth, &lr.shallowest, &lr.deepest);
357
358 lr.set(br, lr.shallowest, lr.deepest);
359 }
360
361 return lr;
362}
363
364void level_range::parse_partial(level_range &lr, const string &s)
365{

Callers 1

_parse_weighted_strFunction · 0.45

Calls 11

trimmed_stringFunction · 0.85
str_to_fpropFunction · 0.85
strict_atonFunction · 0.85
split_stringFunction · 0.85
map_findFunction · 0.85
bad_map_flagClass · 0.85
substrMethod · 0.80
str_to_colourFunction · 0.70
setMethod · 0.45
findMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected