Skip to content
  • Reinhold Kainhofer's avatar
    Implement custom variable definitions · 307d7108
    Reinhold Kainhofer authored
    -) Implement custom definitions (Variable or Definition as keyword) of the form:
        Variable|Definition=VARNAME; [Value=]SOMECOMPLEXVALUE
    -) Such defined variables can be used in all further rules.
    -) Add "Condition=" keyword to indicate that a certain value is a condition (e.g. a variable defined as implemented here).
       This is needed to distinguish single-variable (or function-call) conditions from shipping costs, where the "Shipping=" was left out.
       Previously, only terms that contained a comparison operator were detected to be conditions. This excluded conditions like
       "issubset(...)" or "MyZIPConditions" (i.e. functions returning boolean values and boolean values stored in variables).
    -) The rule-matching code was moved to its own function, so the logic to distinguish variable definitions and (later on) modifiers
       is in only one place.