Diagnostics · limit

limit[boolean-tokens]

The text AND or OR occurs more than maxBooleanOperators (256) times.

The count is of occurrences anywhere outside strings, comments and source tags, including inside words: every FORBID and ENFORCEMENT_MODE contains OR. A contract with a few hundred clauses reaches it. Split the rules across several contracts and sources, or raise the limit for the call (up to 100,000).

Example

Through compileSource · shortened for display
CONTRACT Claim {
  ENFORCEMENT_MODE: enforced
  CONTEXT {
    ENTITIES Request {
      count: int
      region: string
      ready: bool
      ratio: float
    }
    CONSTANTS {
      zero: int == 0 [SOURCE:POLICY]
      cap: int == 25 [SOURCE:POLICY]
    }
  }
    // … 262 more lines, all checked by the build …
    FORBID grant WHEN Request.count == 258 [SOURCE:c258]
    FORBID grant WHEN Request.count == 259 [SOURCE:c259]
  }
}

rejected limit[boolean-tokens] at 274:6 boolean token cap exceeded

Fix

The same source, compiled with limits: { maxBooleanOperators: 1024 }.

Through compileSource(source, { limits: { maxBooleanOperators: 1024 } }) · shortened for display
CONTRACT Claim {
  ENFORCEMENT_MODE: enforced
  CONTEXT {
    ENTITIES Request {
      count: int
      region: string
      ready: bool
      ratio: float
    }
    CONSTANTS {
      zero: int == 0 [SOURCE:POLICY]
      cap: int == 25 [SOURCE:POLICY]
    }
  }
    // … 262 more lines, all checked by the build …
    FORBID grant WHEN Request.count == 258 [SOURCE:c258]
    FORBID grant WHEN Request.count == 259 [SOURCE:c259]
  }
}

accepted

See also: the specification.