Workstream: Engine · Part of #89 · surfaced by #108
Context
CEL has no negative integer literal token — -9223372036854775808 is unary minus applied to the literal 9223372036854775808. But 9223372036854775808 (2^63) does not fit in i64 (max 9223372036854775807), so the #107 lexer rejects it before negation can apply. This makes i64::MIN unrepresentable and costs a couple of basic/comparisons conformance tests.
Approach
Match cel-go / cel-spec: allow the integer-literal magnitude 9223372036854775808 to parse specifically when it is the operand of a unary minus, folding -(2^63) to i64::MIN. Options:
- Lexer/parser cooperation: when a unary
- is immediately followed by an int literal whose magnitude is exactly 2^63, produce Int(i64::MIN) directly.
- Or carry an "out-of-range positive int literal" token that is only legal as a negation operand and errors otherwise.
Keep the error for a genuinely out-of-range positive literal (no leading -).
Acceptance
-9223372036854775808 parses and evaluates to i64::MIN.
- The corresponding
basic/comparisons conformance tests pass; raise MIN_PASS_BASELINE.
Dependencies: Refines #107 (parser). Soft.
Workstream: Engine · Part of #89 · surfaced by #108
Context
CEL has no negative integer literal token —
-9223372036854775808is unary minus applied to the literal9223372036854775808. But9223372036854775808(2^63) does not fit ini64(max9223372036854775807), so the #107 lexer rejects it before negation can apply. This makesi64::MINunrepresentable and costs a couple ofbasic/comparisonsconformance tests.Approach
Match cel-go / cel-spec: allow the integer-literal magnitude
9223372036854775808to parse specifically when it is the operand of a unary minus, folding-(2^63)toi64::MIN. Options:-is immediately followed by an int literal whose magnitude is exactly2^63, produceInt(i64::MIN)directly.Keep the error for a genuinely out-of-range positive literal (no leading
-).Acceptance
-9223372036854775808parses and evaluates toi64::MIN.basic/comparisonsconformance tests pass; raiseMIN_PASS_BASELINE.Dependencies: Refines #107 (parser). Soft.