Skip to main content

parse_req

Function parse_req 

Source
pub fn parse_req(input: &str) -> Result<Requirement>
Expand description

Parse a string into a Requirement

If reducibility is unspecified:

  • Unspecified atoms in OR clauses are reducible
  • Unspecified atoms in AND clauses are strict iff they have a singular stat.
  • Unspecified atoms in AND clauses are reducible if they are SUM types

Examples:

  • “90 FTD” -> AND clause with strict 90 Fortitude
  • “FTD = 90” -> Same thing but diff syntax, “ftd=90”, “90ftd” also are valid
  • “25 STR OR 25 AGL” -> OR clause with reducible atoms
  • “25S STR OR 25 AGL” -> OR clause with asymmetric reducability
  • “(LHT + MED + HVY = 90)” -> AND clause with sum atom (reducible by default)
  • “(LHT + MED + HVY = 90S)” -> Any stat that make up the sum cannot be reduced
  • “25S STR” -> strict atom
  • “25R STR” -> reducible atom
  • “reinforced = 90 FTD” -> named requirement (assignment syntax)