This is an automated email from the ASF dual-hosted git repository. jimjag pushed a commit to branch openformula in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit c103570e07fedccdae1e6eb0c55cc0aa35b63905 Author: Jim Jagielski <[email protected]> AuthorDate: Sat Nov 14 15:01:32 2026 -0500 odf_docs: restore the Basic Limits and DCOUNT results, fix stale references --- odf_docs/openformula-milestone-g-sequence.md | 60 +++++++++++----------- odf_docs/openformula-small-group-audit.md | 14 ++--- odf_docs/openformula-small-group-semantic-audit.md | 21 ++++---- odf_docs/openformula-small-group-semantic-gaps.tsv | 16 +++--- 4 files changed, 55 insertions(+), 56 deletions(-) diff --git a/odf_docs/openformula-milestone-g-sequence.md b/odf_docs/openformula-milestone-g-sequence.md index efd25b7530..f512d3e585 100644 --- a/odf_docs/openformula-milestone-g-sequence.md +++ b/odf_docs/openformula-milestone-g-sequence.md @@ -10,13 +10,13 @@ | Phase | Status | Commit | Notes | |---|---|---|---| | G.1 | Complete | `41da3628f9` + Help topics commit | STRING_MAXLEN documented; ScDBCount empty-cell fix applied via `CountRecords()`; Help topics added for IFNA, SKEWP, BITAND, BITOR, BITXOR, BITLSHIFT, BITRSHIFT | -| G.2 | Implemented (source-level) | `efd87262f2` + regression tests | `ScDBCount()` missing-field path uses `CountRecords()` (dociter.cxx:685-716) which iterates row-by-row via `IsQueryValid()`; `ScDBCount2()` same pattern; calcval `DB.*` regression cases added | -| G.3 | Complete (decision documented) | `929fe7a9ce` | COUNTBLANK formula-cell `""` behavior decision: `lcl_IsCountBlankEmpty()` (interpr1.cxx:4745-4758) inspects formula results and treats formula-cell-returning-`""` as blank — implementation-defined per §6.13.8; no code change needed | -| G.4 | Compatibility audit complete (decision documented) | — | `bRowArray` shortcut present in `ScIndex()` (interpr1.cxx:7588-7612); `INDEX(H1:L1;3)` returns column value instead of ODF 1.4 Error; kept as legacy-compatible deviation | -| G.5 | Complete (source-level audit) | `fb522d42ea` | All 4 ODF 1.4 §3.7 Basic Limits source-audited; no blocking limits found; all classified RUNTIME_PENDING. Formula length: no cap (MAXCODE=2048 tokens). Parameters: no 30-param cap (MAX uses MustHaveParamCountMin(1)). String length: STRING_MAXLEN=65,535 > 32,767. Nesting depth: no depth limit. Runtime verification blocked (no build tree) | -| G.6 | Complete (source-level audit) | `fb522d42ea` | All 11 ODF 1.4 §2.3.2.B syntax requirements source-audited; implementation present for all; no blocking limits; all classified RUNTIME_PENDING. Includes Basic Expressions, Constant Numbers, Constant Strings, Operators, Functions, Nonstandard Function Names, References, Simple Named Expressions, Errors, Whitespace. Runtime verification blocked (no build tree) | +| G.2 | Fixed | `b5a1b43b5b`, `30877e2746` (fix); `ad46309f51` (docs, 3 test rows) | `ScDBCount()` missing-field path uses `CountRecords()` (dociter.cxx:685-716) which iterates row-by-row via `IsQueryValid()`; `ScDBCount2()` same pattern; calcval `DB.*` regression cases added. `DB.DCOUNT.nf.nocrit` gives 3 (was 0) | +| G.3 | Complete (decision documented) | `7e6ad45c82` | COUNTBLANK formula-cell `""` behavior decision: `lcl_IsCountBlankEmpty()` (interpr1.cxx:4745-4758) inspects formula results and treats formula-cell-returning-`""` as blank — implementation-defined per §6.13.8; no code change needed | +| G.4 | Compatibility audit complete (decision documented) | `ac2d06a54a` | `bRowArray` shortcut present in `ScIndex()` (interpr1.cxx:7588-7612); `INDEX(H1:L1;3)` returns column value instead of ODF 1.4 Error; kept as legacy-compatible deviation | +| G.5 | Run on Linux aarch64 | `1ac0d2f4ee`, `fb522d42ea` (source audit); results in `openformula-small-group-audit.md` | Formula length, parameter count and nesting: MET. String length: PARTIAL, string literals stop at about 1021 characters (Err:513), run-time strings reach 32767. Formula limit raised from 512 to 2048 tokens | +| G.6 | Complete (source-level audit) | `551759aef8` | All 11 ODF 1.4 §2.3.2.B syntax requirements source-audited; implementation present for all; no blocking limits; all classified RUNTIME_PENDING. Includes Basic Expressions, Constant Numbers, Constant Strings, Operators, Functions, Nonstandard Function Names, References, Simple Named Expressions, Errors, Whitespace. Runtime verification blocked (no build tree) | -**Blocker:** No configured AOO build tree; `sc`/`scaddins` not built; calcval harness cannot run. Runtime verification deferred to consolidated Calc testing phase. All G.1-G.6 source-level work is complete; runtime verification for G.2-G.6 awaits build environment. +**Runtime results:** the Basic Limits (G.5) rows were run on a Linux aarch64 build. Items marked RUNTIME_PENDING have no recorded run. ## Principles @@ -25,7 +25,7 @@ 2. **Dependency-ordered:** Changes with no dependencies first; dependent changes after. 3. **Risk-ordered:** Lower-risk, self-contained changes before higher-risk behavior changes. 4. **No LibreOffice code:** All fixes derived from AOO source inspection only. -5. **No production changes without runtime validation:** All changes deferred until a configured AOO build tree exists and calcval can run (currently macOS-only). +5. **No production changes without runtime validation.** ## Phase G.1 — Zero-Risk Documentation & Test Harness (No Code Changes) @@ -42,7 +42,7 @@ These items require no production source modification and can be completed immed ## Phase G.2 — Investigation Complete: Criteria Syntax Empty-Cell Fix (ScDBCount) -**STATUS: IMPLEMENTED (source-level)** — DCOUNT and DCOUNTA without a field count every matching record via `CountRecords()`; calcval `DB.*` regression cases added. Runtime verification blocked: no AOO build tree available. +**STATUS: FIXED** (`b5a1b43b5b`, `30877e2746`) — DCOUNT and DCOUNTA without a field count every matching record via `CountRecords()`; calcval `DB.*` regression cases added. `DB.DCOUNT.nf.nocrit` gives 3 (was 0). The root cause is confirmed: `ScQueryCellIterator` ("run through all not empty cells") skips empty cells, and `ScDBQueryDataIterator::getCurrent()` skips `CELLTYPE_NONE` via `default` case at `dociter.cxx:655-657`. Per ODF 1.4 §6.9.3, DCOUNT without a field should count ALL matching rows including those with empty result cells. @@ -61,7 +61,7 @@ The root cause is confirmed: `ScQueryCellIterator` ("run through all not empty c | G.2.1 | F-GAP-004 | Criteria — DCOUNT empty-cell matching | `interpr1.cxx:6838-6845` (was) → `interpr1.cxx:6879-6882` + `dociter.cxx:685-716` | ScDBCount missing-field path previously used `ScQueryCellIterator` which skips empty cells; DCOUNT undercounted when matching rows had empty result cells | Replaced with row-by-row `CountRecords()` using `IsQueryValid()` per row; counts all matching rows regardless of cell emptiness | Low — isolated to DCOUNT/DCOUNTA without field; documented T [...] **Dependencies:** None. -**Runtime validation needed:** Yes — DCOUNT/DCOUNTA with empty result cells. **Blocked:** No AOO build tree available; cannot build/test. +**Runtime validation needed:** the three `DB.*.zero` rows (numeric zero vs empty result cell). ## Phase G.3 — Medium-Risk: COUNTA/COUNTBLANK Behavior Review @@ -92,19 +92,19 @@ ODF 1.4 §6.14.6 removed the ODF 1.2/1.3 row-vector shortcut where `INDEX(rowvec ## Phase G.5 — Low-Risk: Basic Limits Source Audit -**STATUS: COMPLETE (source-level audit; runtime verification pending)** +**STATUS: RUN on Linux aarch64** (results in `openformula-small-group-audit.md`) -ODF 1.4 §3.7 requires: (1) formulas up to at least 1024 characters, (2) at least 30 parameters per function, (3) strings up to 32,767 ASCII characters, (4) at least 7 nesting levels of functions. Source audit found no blocking limits for any requirement. All four classified as RUNTIME_PENDING. +ODF 1.4 §3.7 requires: (1) formulas up to at least 1024 characters, (2) at least 30 parameters per function, (3) strings up to 32,767 ASCII characters, (4) at least 7 nesting levels of functions. Three are MET and one is PARTIAL. | Order | Gap ID | Area | Source Finding | Classification | |---|---|---|---|---| -| G.5.1 | F-GAP-006 | Formula length | No formula-text cap; MAXCODE=2048 tokens (compiler.hxx:59), MAXSTRLEN=1024 per symbol (compiler.hxx:60). 1026-char formula needs ~1025 tokens < 2048. | RUNTIME_PENDING | -| G.5.2 | F-GAP-007 | Parameter count | No global 30-param cap; MAX uses MustHaveParamCountMin(1) (interpr1.cxx:3396-3400); SUM supports 255 args (calcval SG.BL-255args). | RUNTIME_PENDING | -| G.5.3 | F-GAP-008 | String length | STRING_MAXLEN=65,535 (string.hxx:119, STRING32 not defined) > 32,767. CheckStringResultLen enforces at concatenation (interpre.hxx:930-936). String literals limited to 1023 chars (MAXSTRLEN=1024). | RUNTIME_PENDING | -| G.5.4 | F-GAP-009 | Nesting depth | No nesting depth limit (no MAXNEST or recursion depth guard). Parser uses recursive descent without depth guard (compiler.cxx:4134). | RUNTIME_PENDING | +| G.5.1 | F-GAP-006 | Formula length | The compiler limit was 512 tokens; it is now 2048 (MAXCODE, compiler.hxx:59). MAXSTRLEN=1024 per symbol (compiler.hxx:60). `SG.BL-001-1024chars` matches. | MET | +| G.5.2 | F-GAP-007 | Parameter count | No global 30-param cap; MAX uses MustHaveParamCountMin(1) (interpr1.cxx:3396-3400). `SG.BL-002-30params` matches; more than 255 arguments is an error. | MET | +| G.5.3 | F-GAP-008 | String length | STRING_MAXLEN=65,535 (string.hxx:119, STRING32 not defined) > 32,767; `SG.BL-003-32767chars` matches. A string literal of 1022 characters or more gives Err:513 (MAXSTRLEN=1024). | PARTIAL | +| G.5.4 | F-GAP-009 | Nesting depth | The parser stops at a recursion count of 42 (nRecursionMax, FormulaCompiler.cxx:782 and :1341). `SG.BL-004-7nesting` matches. | MET | **Dependencies:** None. -**Runtime validation needed:** Yes — all four calcval tests (SG.BL-001 through SG.BL-004). **Blocked:** No AOO build tree available; calcval cannot run. Source audit complete; no production code changes needed. +**Open:** string literals stop at about 1021 characters; not fixed. ## Phase G.6 — Low-Risk: Syntax Verification @@ -117,13 +117,13 @@ ODF 1.4 §2.3.2.B requires Small Group Evaluators to implement syntax from 11 se | G.6.1 | F-GAP-016 | Basic Expressions §5.2 | `Formula ::= Intro? Expression`; Expression supports Number, String, Array, PrefixOp, InfixOp, parenthesized, function call, Reference, QuotedLabel, AutomaticIntersection, NamedExpression, Error (`compiler.cxx:3570`, :3780) | RUNTIME_PENDING | | G.6.2 | F-GAP-017 | Constant Numbers §5.3 | `Number ::= StandardNumber | '.' [0-9]+ ([eE] [-+]? [0-9]+)?`; decimal '.', scientific E/e (`compiler.cxx:2650+`) | RUNTIME_PENDING | | G.6.3 | F-GAP-018 | Constant Strings §5.4 | `String ::= '"' ([^"#x00] | '""')* '"'`; double-quote escaped by duplication (`compiler.cxx:2682`) | RUNTIME_PENDING | -| G.6.4 | F-GAP-010 | Operators §5.5 | PrefixOp '+', '-'; PostfixOp '%'; InfixOp: Arithmetic, Comparison, String, Reference. Precedence: ! > : > prefix +,- > ^ > *,/ > +,- > & > comparison (`compiler.cxx` RangeLine→binary ops; `compiler.hxx:61` MAXJUMPCOUNT=32 CHOOSE only) | RUNTIME_PENDING | +| G.6.4 | F-GAP-010 | Operators §5.5 | PrefixOp '+', '-'; PostfixOp '%'; InfixOp: Arithmetic, Comparison, String, Reference. Precedence: ! > : > prefix +,- > ^ > *,/ > +,- > & > comparison (`compiler.cxx` RangeLine→binary ops; `compiler.hxx:61` MAXJUMPCOUNT=32, the jump targets of CHOOSE, IF and IFNA) | RUNTIME_PENDING | | G.6.5 | F-GAP-019 | Functions §5.6 | `FunctionName ::= LetterXML (LetterXML | DigitXML | '_' | '.' | CombiningCharXML)*`; case-insensitive; ';' separator; empty params allowed (`compiler.cxx:3648`, `interpre.hxx:897-927`) | RUNTIME_PENDING | -| G.6.6 | F-GAP-020 | Nonstandard Function Names §5.7 | Unknown functions → Error other than #N/A; names need prefix (`compiler.cxx` errNoName; `interpr4.cxx:3106`, :3205) | RUNTIME_PENDING | +| G.6.6 | F-GAP-020 | Nonstandard Function Names §5.7 | Unknown functions → Error other than #N/A; names need prefix (`compiler.cxx` errNoName; `FormulaCompiler.cxx:891-895`) | RUNTIME_PENDING | | G.6.7 | F-GAP-011 | References §5.8 | `Reference ::= '[' (Source? RangeAddress) \| ReferenceError ']'`; supports cell, row, column, whole-row, whole-column (`compiler.cxx` IsReference, PopDoubleRef/PopSingleRef) | RUNTIME_PENDING | | G.6.8 | F-GAP-012 | Simple Named Expressions §5.11 | `SimpleNamedExpression ::= Identifier | '$$' (Identifier | SingleQuoted)`; global scope, case-consistent (`compiler.cxx` NameLine/ocName) | RUNTIME_PENDING | -| G.6.9 | F-GAP-013 | Constant Errors §5.12 | `#N/A` required; others optional; Error syntax `'#' [A-Z0-9]+ ...` (`compiler.hrc:30-36`; `interpr4.cxx` PushError) | RUNTIME_PENDING | -| G.6.10 | F-GAP-014 | Whitespace §5.14 | Whitespace ::= #x20 | #x09 | #x0a | #x0d; ignored outside strings, around operators, before/after =, before function names (`compiler.cxx:3583-3593`, :3655-3667) | RUNTIME_PENDING | +| G.6.9 | F-GAP-013 | Constant Errors §5.12 | `#N/A` required; others optional; Error syntax `'#' [A-Z0-9]+ ...` (`compiler.hrc:58-64`; `interpr4.cxx` PushError) | RUNTIME_PENDING | +| G.6.10 | F-GAP-014 | Whitespace §5.14 | Whitespace ::= #x20 | #x09 | #x0a | #x0d; ignored outside strings, around operators, before/after =, before function names (`compiler.cxx:3583-3593`, :3655-3667); only #x20 is set as whitespace in the compiler character table (`compiler.cxx:448`), so #x09, #x0a and #x0d are unverified | RUNTIME_PENDING | **Dependencies:** None. **Runtime validation needed:** Yes — all syntax tests (SYN-001 through SYN-011). **Blocked:** No AOO build tree available; calcval cannot run. Source audit complete; no production code changes needed. @@ -132,8 +132,8 @@ ODF 1.4 §2.3.2.B requires Small Group Evaluators to implement syntax from 11 se ``` G.1 (docs, COMPLETE) ──┐ - ├── G.2 (ScDBCount empty-cell, IMPLEMENTED source-level) ──┐ -G.5 (limits audit, COMPLETE source-level) ──┤ ├── G.3 (COUNTBLANK decision, COMPLETE) + ├── G.2 (ScDBCount empty-cell, FIXED) ──┐ +G.5 (limits audit, RUN on Linux aarch64) ──┤ ├── G.3 (COUNTBLANK decision, COMPLETE) G.6 (syntax audit, COMPLETE source-level) ──┤ │ G.4 (INDEX compatibility) ──┘ └── (runtime-validated) ``` @@ -144,25 +144,25 @@ G.4 compatibility audit: `bRowArray` shortcut present (interpr1.cxx:7588-7612); | Phase | Complexity | Rationale | Status | |---|---|---|---| | G.1 (docs) | Trivial | No code changes | Complete | -| G.2 (ScDBCount) | Low | Fix applied via `CountRecords()`; regression tests added; runtime verification blocked | Implemented (source-level) | +| G.2 (ScDBCount) | Low | Fix applied via `CountRecords()`; regression tests added | Fixed | | G.3 (COUNTBLANK) | Low | Decision documented; implementation already in place via `lcl_IsCountBlankEmpty()` | Complete (decision documented) | | G.4 (INDEX compat) | Medium | Compatibility audit complete; `bRowArray` shortcut present; ODF 1.4 deviation documented | Compatibility audit complete (decision documented) | -| G.5 (limits audit) | Low | Source audit complete; no blocking limits found; all 4 classified RUNTIME_PENDING | Complete (source-level) | +| G.5 (limits audit) | Low | Run on Linux aarch64: 3 MET, 1 PARTIAL (string literals stop at about 1021 characters) | Run | | G.6 (syntax audit) | Low | Source audit complete; implementation present for all 11 syntax requirements; no blocking limits; all classified RUNTIME_PENDING | Complete (source-level) | ## Definition of Done for Milestone G - All G.1 documentation items complete (committed at `41da3628f9`; Help topics for 7 functions committed separately) - G.1 Help topics: IFNA, SKEWP, BITAND, BITOR, BITXOR, BITLSHIFT, BITRSHIFT — all HID_FUNC_* IDs resolve to topics, discoverable via Help index/search -- G.2 ScDBCount/DCOUNTA empty-cell fix implemented at source level: `CountRecords()` in `dociter.cxx:685-716`, used by `ScDBCount()` at `interpr1.cxx:6879-6882` and `ScDBCount2()` at `interpr1.cxx:6913-6917`; calcval `DB.*` regression cases added to `calcval-cases14.tsv` (DB.DCOUNT.f.zero, DB.DCOUNT.nf.zero, DB.DCOUNTA.f.zero) -- G.2 runtime verification: blocked — no AOO build tree available; calcval cannot run -- G.3 COUNTBLANK behavior: decision documented — `lcl_IsCountBlankEmpty()` (interpr1.cxx:4745-4758) inspects formula results and treats formula-cell-returning-`""` as blank for COUNTBLANK (implementation-defined per §6.13.8); ISBLANK (§6.13.14) returns FALSE for empty string — no conflict. No code change needed. +- G.2 ScDBCount/DCOUNTA empty-cell fix (`b5a1b43b5b`, `30877e2746`): `CountRecords()` in `dociter.cxx:685-716`, used by `ScDBCount()` at `interpr1.cxx:6879-6882` and `ScDBCount2()` at `interpr1.cxx:6913-6917`; calcval `DB.*` regression cases added to `calcval-cases14.tsv` (DB.DCOUNT.f.zero, DB.DCOUNT.nf.zero, DB.DCOUNTA.f.zero) +- G.2 result: `DB.DCOUNT.nf.nocrit` gives 3 (was 0); the three `DB.*.zero` rows are not yet recorded as run +- G.3 COUNTBLANK behavior: decision documented — `lcl_IsCountBlankEmpty()` (interpr1.cxx:4745-4758) inspects formula results and treats formula-cell-returning-`""` as blank for COUNTBLANK (implementation-defined per §6.13.8); ISBLANK (§6.13.14) returns FALSE for empty string — the two differ, which §6.13.8 allows. No code change needed. - G.4 INDEX compatibility: compatibility audit complete — `bRowArray` shortcut present in `ScIndex()` (interpr1.cxx:7588-7612); `INDEX(H1:L1;3)` returns column value instead of ODF 1.4 Error; kept as documented legacy-compatible deviation | -- G.5 Basic Limits: source audit complete — no blocking limits found for any of the 4 ODF 1.4 §3.7 requirements. All classified RUNTIME_PENDING. Formula length: no formula-text cap (MAXCODE=2048 tokens, MAXSTRLEN=1024 per symbol). Parameters: no global 30-param cap (MAX uses MustHaveParamCountMin(1)). String length: STRING_MAXLEN=65,535 > 32,767 minimum. Nesting depth: no depth limit found. Runtime verification blocked (no build tree). +- G.5 Basic Limits: run on Linux aarch64 — formula length, parameter count and nesting MET; string length PARTIAL (string literals stop at about 1021 characters, run-time strings reach 32767). Formula limit raised from 512 to 2048 tokens (MAXCODE). - G.6 Syntax Verification: source audit complete — implementation present for all 11 ODF 1.4 §2.3.2.B syntax requirements (Basic Expressions, Constant Numbers, Constant Strings, Operators, Functions, Nonstandard Function Names, References, Simple Named Expressions, Errors, Whitespace) plus Criteria §4.11.11 (covered under F-GAP-004). All classified RUNTIME_PENDING. Runtime verification blocked (no build tree). -- G.5/G.6 runtime tests: prepared, awaiting build environment +- G.6 runtime tests: prepared, not yet run - No production changes without corresponding calcval test coverage -- All G.1-G.3 requirements verified at source level against ODF 1.4 normative text; G.4 INDEX documented as known deviation (bRowArray shortcut, not ODF 1.4 compliant); runtime verification for G.5/G.6 pending build environment +- All G.1-G.3 requirements verified at source level against ODF 1.4 normative text; G.4 INDEX documented as known deviation (bRowArray shortcut, not ODF 1.4 compliant); G.6 runtime verification pending ## Deferred Items (Post-G) diff --git a/odf_docs/openformula-small-group-audit.md b/odf_docs/openformula-small-group-audit.md index 73a2b51bc1..806f842c03 100644 --- a/odf_docs/openformula-small-group-audit.md +++ b/odf_docs/openformula-small-group-audit.md @@ -33,12 +33,12 @@ Therefore **no conformance level (Small/Medium/Large) may be claimed for AOO Cal | ReqID | Requirement | Status | Source Evidence | Runtime Verified | |-------|-------------|--------|-----------------|-------------------| -| SG-BL-001 | Formula length >= 1024 characters | **RUNTIME_PENDING** | No formula-text length limit; MAXCODE=2048 tokens (compiler.hxx:59), MAXSTRLEN=1024 per symbol (compiler.hxx:60). 1026-char formula needs ~1025 tokens < 2048. Single string literal limited to 1023 chars (MAXSTRLEN). | No | -| SG-BL-002 | >= 30 parameters per function | **RUNTIME_PENDING** | No global 30-param cap; MAX uses MustHaveParamCountMin(nParamCount, 1) (interpr1.cxx:3396-3400). SUM supports 255 args (calcval SG.BL-255args). Param count via GetByte() supports up to 255; MAXCODE=2048 tokens is practical ceiling. | No | -| SG-BL-003 | Strings up to 32767 ASCII chars | **RUNTIME_PENDING** | STRING_MAXLEN=65,535 (string.hxx:119, STRING32 not defined) > 32,767. CheckStringResultLen enforces at concatenation (interpre.hxx:930-936). REPT("a";32767) creates 32,767-char string at runtime. String literals limited to 1023 chars (MAXSTRLEN=1024). | No | -| SG-BL-004 | >= 7 nesting levels of functions | **RUNTIME_PENDING** | No nesting depth limit found (no MAXNEST or recursion depth guard). Parser uses recursive descent without depth guard (compiler.cxx:4134). Evaluator stack-based without depth limit. MAXCODE=2048 tokens is practical ceiling. | No | +| SG-BL-001 | Formula length >= 1024 characters | **MET** | The compiler limit was 512 tokens, too few for 1024 characters of `1+1+...`; it is now 2048 (`MAXCODE`, compiler.hxx:59). Calcval `SG.BL-001-1024chars` (1026 characters, result 513) matches on a Linux aarch64 build. | Yes | +| SG-BL-002 | >= 30 parameters per function | **MET** | `SG.BL-002-30params` (MAX with 30 arguments) matches on a Linux aarch64 build; a call with more than 255 arguments is an error. | Yes | +| SG-BL-003 | Strings up to 32767 ASCII chars | **PARTIAL** | Strings produced at run time reach 32767 characters (`SG.BL-003-32767chars`, `LEN(REPT("a";32767))`, matches). A string literal in a formula is limited by `MAXSTRLEN` (1024): literals of 1022 characters or more give Err:513. Not fixed. | Partly | +| SG-BL-004 | >= 7 nesting levels of functions | **MET** | `SG.BL-004-7nesting` (7 nested IF levels) matches on a Linux aarch64 build. The parser has a recursion guard of 42 (`nRecursionMax`, FormulaCompiler.cxx:782 and :1341). | Yes | -**Finding:** All four Basic Limits requirements have source-level evidence supporting compliance, but none have been runtime-verified. No blocking limitations identified. STRING_MAXLEN=65,535 exceeds ODF's 32,767 minimum; MAXCODE=2048 tokens supports formulas with 1024+ characters when composed of short tokens. +**Finding:** the four limits were run on Linux aarch64. Formula length, parameter count and nesting meet the requirement. For strings only run-time results reach 32767 characters; string literals stop at about 1021 (open). --- @@ -174,14 +174,14 @@ The Small Group requires 110 functions (§2.3.2.E). All 110 have opcodes and imp - **SG-BL-001**: corrected to formula expression length 1026 chars (`=1` + `+1`*512), expected 513 (replaces `REPT("a";1024)` which measured string length, not formula length). - **SG-BL-004**: corrected to 7 genuinely nested function levels (`IF(TRUE;IF(...IF(TRUE;1;2)...))`, 7 nested IF calls), balanced parens, deterministic result 1. -- **All 4 Basic Limits (§3.7)**: Reclassified from MET/PARTIAL to RUNTIME_PENDING based on G.5 source audit. Source evidence supports compliance for all four requirements (no formula-text cap, no 30-param cap, STRING_MAXLEN=65,535 > 32,767, no nesting depth limit), but runtime verification blocked (no AOO build tree; calcval macOS-only). +- **All 4 Basic Limits (§3.7)**: run on a Linux aarch64 build; results are in the status table above. - **SG-SYN-001**: added Criteria syntax §4.11.11 test `SYN-001-criteria` (`=DCOUNT(R1:T6;;V1:V2)`, expected 4) using existing calcval database/criteria fixtures. - **SG-SYN-009**: marked not directly executable in calcval harness (requires pre-defined named expression `MYNAME`); test remains UNVERIFIED with explicit note. - **SG-FN-013/COUNTA**: fixtures added for truly empty cells and empty string "" per §6.13.7 (empty string non-blank). Harness-expressible via inline args; empty-cell cases use unset D6:D7. - **SG-FN-014/COUNTBLANK**: FN-014-COUNTBLANK-empty-cells (=COUNTBLANK(D6:D7), expected 2) covers truly empty cells. FN-014-COUNTBLANK-empty-string is retained as diagnostic only with expected - — it uses =COUNTBLANK(D6:D7) (genuinely empty cells, not ""), clearly labeled as NOT testing a cell containing ""; the required ""-in-cell fixture cannot be established by calcval harness (scratch cleared each case; no pre-populated "" data cells). ""-in-cell blankness is impl-defined per §6.13.8. - **SG-FN-016/FN-016-DATE-pre1583**: reclassified as implementation-defined/diagnostic (out-of-constraint Year < 1904), not mandatory #ERR. Normative expected value is - (not an ODF conformance error assertion). The calcval DATE.pre1583 row retains #ERR only as an explicitly identified AOO-specific diagnostic assertion (AOO observed #VALUE!), clearly labeled as not an ODF conformance assertion. - **BITAND arity**: confirmed `BITAND.3params` (`=BITAND(6;3;1)` expected `#ERR`) remains valid per §6.6.2 (`BITAND(Integer X; Integer Y)`); no classification change. -- **Runtime verification**: not performed (no AOO build tree; calcval harness macOS-only). Only static/syntax/fixture checks applied. +- **Runtime verification**: the Basic Limits results are in the status table above (Linux aarch64). ## 10. Runtime-Verification Limitations diff --git a/odf_docs/openformula-small-group-semantic-audit.md b/odf_docs/openformula-small-group-semantic-audit.md index 7de8033ae7..4ef07ba36c 100644 --- a/odf_docs/openformula-small-group-semantic-audit.md +++ b/odf_docs/openformula-small-group-semantic-audit.md @@ -3,7 +3,7 @@ **Branch:** `openformula` **Baseline:** `9c42008d93` **Scope:** Audit and report only. No production code modifications. -**Method:** Source-level static inspection only. No runtime verification possible (no AOO build tree; calcval harness macOS-only). +**Method:** Source-level static inspection. Items marked RUNTIME_PENDING have not been run; the Basic Limits results from the Linux aarch64 build are in `openformula-small-group-audit.md`. ## Normative Source @@ -190,8 +190,8 @@ ODF 1.4 §4.11.11: Criteria syntax supported in database functions (DCOUNT, DCOU ### AOO Implementation Locations -- `GetDBParams()` — `main/sc/source/core/tool/interpr1.cxx:6621` (parses database + field + criteria range) -- `DBIterator()` — `main/sc/source/core/tool/interpr1.cxx:6760` (iterates matching records for DBSum, DBAverage, DBMax, DBMin, DBProduct) +- `GetDBParams()` — `main/sc/source/core/tool/interpr1.cxx:6664` (parses database + field + criteria range) +- `DBIterator()` — `main/sc/source/core/tool/interpr1.cxx:6803` (iterates matching records for DBSum, DBAverage, DBMax, DBMin, DBProduct) - `ScDBCount()` — `main/sc/source/core/tool/interpr1.cxx:6828` (DCOUNT) - `ScDBCount2()` — `main/sc/source/core/tool/interpr1.cxx:6882` (DCOUNTA) - `ScDBSum()` — `main/sc/source/core/tool/interpr1.cxx:6821` (DSUM) @@ -255,7 +255,7 @@ None for database function empty-cell matching. The ScDBCount empty-cell limitat ### Recommended Implementation Changes -None required. The ScDBCount empty-cell fix (F-GAP-004) is implemented at source level; runtime verification pending (no AOO build tree available). +None required. The ScDBCount empty-cell fix (F-GAP-004) is in (commits b5a1b43b5b and 30877e2746). With an empty criteria cell the count is now all records (`DB.DCOUNT.nf.nocrit` gives 3, was 0). ### Suggested Regression Tests @@ -326,9 +326,8 @@ None required. The ScDBCount empty-cell fix (F-GAP-004) is implemented at source #### Nesting Depth — at least 7 levels **Source finding:** -- No nesting depth limit (no MAXNEST, recursion depth counter, or nDepth equivalent) found in `main/sc/source/core/tool/compiler.cxx` or `main/sc/source/core/tool/interpr1.cxx`. -- `main/sc/source/core/tool/compiler.cxx:4134`: Comment "RPN creation by recursion" — parser uses recursive descent without a depth guard. -- `main/sc/inc/compiler.hxx:61`: `MAXJUMPCOUNT = 32` — limits CHOOSE function jump targets, not general nesting. +- The recursive-descent parser is in `main/formula/source/core/api/FormulaCompiler.cxx`. `GetToken()` (:782) and `Expression()` (:1341) stop with errStackOverflow once the recursion count passes `nRecursionMax = 42`. +- `main/sc/inc/compiler.hxx:61`: `MAXJUMPCOUNT = 32` — limits the jump targets of CHOOSE; IF and IFNA use the same table with at most 3 and 2 jump targets (FormulaCompiler.cxx:1101-1103). - Evaluator is stack-based (`ScInterpreter::Push()`/`Pop()`) with no explicit evaluation depth limit beyond MAXCODE=2048 total tokens. - 7 nested `IF` levels uses ~15 tokens, well under MAXCODE=2048. - `test/odf-validate/calcval-cases14.tsv:198`: `SG.BL-004-7nesting` — 7 nested `IF` calls, expected result 1. @@ -348,11 +347,11 @@ None required. The ScDBCount empty-cell fix (F-GAP-004) is implemented at source | Constant Strings | §5.4 | `String ::= '"' ([^"#x00] | '""')* '"'`. Double-quote escaped by duplication. | `main/sc/source/core/tool/compiler.cxx:2682` (IsString), :2689-2691 (string literal overflow at MAXSTRLEN-1) | RUNTIME_PENDING | | Operators | §5.5 | PrefixOp '+', '-'; PostfixOp '%'; InfixOp: ArithmeticOp (+-*/^), ComparisonOp (=<> <> < > <= >=), StringOp (&), ReferenceOp (! ~ :). Precedence per Table 1: ! > : > prefix +,- > ^ > *,/ > +,- > & > comparison. | `main/sc/source/core/tool/compiler.cxx` RangeLine → IntersectionLine → RangeLine → UnaryLine → binary ops; `main/sc/inc/compiler.hxx:61` (MAXJUMPCOUNT=32, CHOOSE only) | RUNTIME_PENDING | | Functions and Function Parameters | §5.6 | `FunctionName ::= LetterXML (LetterXML | DigitXML | '_' | '.' | CombiningCharXML)*`. Case-insensitive. Semicolon ';' separator. Empty parameters allowed (considered 0 params, not one empty param). | `main/sc/source/core/tool/compiler.cxx:3648` (function name detection), :3661-3668 (must be followed by '('); `main/sc/source/core/inc/interpre.hxx:897-927` (MustHaveParamCount family) | RUNTIME_PENDING | -| Nonstandard Function Names | §5.7 | Function names not in spec need prefix (e.g., COM.FOO.BAR). Unknown functions → Error value other than #N/A. | `main/sc/source/core/tool/compiler.cxx:3741,:4029,:4072,:4091,:4101,:5493,:5501` (errNoName); `main/sc/source/core/tool/interpr4.cxx:3106,:3205` (PushError(errNoName)) | RUNTIME_PENDING | +| Nonstandard Function Names | §5.7 | Function names not in spec need prefix (e.g., COM.FOO.BAR). Unknown functions → Error value other than #N/A. | `main/sc/source/core/tool/compiler.cxx:3741,:4029,:4072,:4091,:4101,:5493,:5501` (errNoName); `main/formula/source/core/api/FormulaCompiler.cxx:891-895` (unknown name followed by '(' gives errNoName) | RUNTIME_PENDING | | References | §5.8 | `Reference ::= '[' (Source? RangeAddress) | ReferenceError ']'`. RangeAddress supports cell, row, column, whole-row, whole-column. References begin with '[' to disambiguate from function names. | `main/sc/source/core/tool/compiler.cxx` (IsReference, PopDoubleRef/PopSingleRef); `main/sc/inc/compiler.hxx` | RUNTIME_PENDING | | Simple Named Expressions | §5.11 | `SimpleNamedExpression ::= Identifier | '$$' (Identifier | SingleQuoted)`. Global scope, case-consistent matching. | `main/sc/source/core/tool/compiler.cxx` (NameLine, ocName opcode); `main/sc/source/core/inc/interpre.hxx` | RUNTIME_PENDING | -| Constant Errors | §5.12 | `#N/A` required; other Errors optional. Error syntax: `'#' [A-Z0-9]+ ([!?] | ('/' ([A-Z] | ([0-9] [!?])))`. Functions propagate Errors unless stated otherwise. | `main/formula/inc/formula/compiler.hrc:30-36` (SC_OPCODE_ERROR_NULL through SC_OPCODE_ERROR_NA); `main/sc/source/core/tool/interpr4.cxx` (PushError, NOTAVAILABLE) | RUNTIME_PENDING | -| Whitespace | §5.14 | Whitespace ::= #x20 \| #x09 \| #x0a \| #x0d. Ignored outside strings, around operators, before/after =, before function names (but not between name and '('). | `main/sc/source/core/tool/compiler.cxx:3583-3593` (NextNewToken generates ocSpaces), :3655-3667 (whitespace before '(' for function names) | RUNTIME_PENDING | +| Constant Errors | §5.12 | `#N/A` required; other Errors optional. Error syntax: `'#' [A-Z0-9]+ ([!?] | ('/' ([A-Z] | ([0-9] [!?])))`. Functions propagate Errors unless stated otherwise. | `main/formula/inc/formula/compiler.hrc:58-64` (SC_OPCODE_ERROR_NULL through SC_OPCODE_ERROR_NA); `main/sc/source/core/tool/interpr4.cxx` (PushError, NOTAVAILABLE) | RUNTIME_PENDING | +| Whitespace | §5.14 | Whitespace ::= #x20 \| #x09 \| #x0a \| #x0d. Ignored outside strings, around operators, before/after =, before function names (but not between name and '('). | `main/sc/source/core/tool/compiler.cxx:3583-3593` (NextNewToken generates ocSpaces), :3655-3667 (whitespace before '(' for function names). Only #x20 is set as whitespace in the compiler character table (`compiler.cxx:448`); #x09, #x0a and #x0d are unverified. | RUNTIME_PENDING | ### Coverage note: Criteria §4.11.11 @@ -370,7 +369,7 @@ Criteria syntax (§4.11.11) is also required by §2.3.2.B but is covered under * | Category | Count | Status | |---|---|---| -| Basic Limits (§3.7) | 4 | RUNTIME_PENDING — source capable for all 4; runtime verification blocked (no build tree) | +| Basic Limits (§3.7) | 4 | Run on Linux aarch64: 3 MET, 1 PARTIAL (string literals stop at about 1021 characters) | | Syntax (§5) | 11 | RUNTIME_PENDING — implementation present for all 11; runtime verification blocked (no build tree) | | COUNTA/COUNTBLANK (§6.13.7-8) | 2 | Fully matches; formula-cell `""` treated as blank per implementation-defined choice (§6.13.8) | | INDEX (§6.14.6) | 1 | NOT ODF 1.4 compliant — bRowArray shortcut present (undone by commit 8f3b3b25a2); INDEX(H1:L1;3) returns value instead of Error | diff --git a/odf_docs/openformula-small-group-semantic-gaps.tsv b/odf_docs/openformula-small-group-semantic-gaps.tsv index ef3f1c6ec4..0473c59e6b 100644 --- a/odf_docs/openformula-small-group-semantic-gaps.tsv +++ b/odf_docs/openformula-small-group-semantic-gaps.tsv @@ -2,20 +2,20 @@ GapID ODF Clause Requirement AOO Implementation Location Current Behavior Classi F-GAP-001 §6.13.7 COUNTA counts non-empty cells; empty string "" is not blank main/sc/source/core/tool/interpr1.cxx:3834 (ScCount2 via IterateParameters(ifCOUNT2) at :3487) COUNTA counts scalar string args including ""; counts cells where eCellType != CELLTYPE_NONE && != CELLTYPE_NOTE; matrix case counts ALL elements including strings; formula cells returning "" counted as non-blank based on CELLTYPE_FORMULA (result not checked) Required by ODF 1.4; implementation-defined for formula cel [...] F-GAP-002 §6.13.8 COUNTBLANK counts empty cells; cell returning "" blankness is implementation-defined main/sc/source/core/tool/interpr1.cxx:4714 (ScCountEmptyCells), :4745-4758 (lcl_IsCountBlankEmpty) COUNTBLANK uses lcl_IsCountBlankEmpty() which checks cell type AND formula result: CELLTYPE_NONE/CELLTYPE_NOTE/NULL → blank; non-FORMULA cell types → not blank; CELLTYPE_FORMULA with error or IsValue() → not blank; CELLTYPE_FORMULA with GetString().Len()==0 → blank (formula cell returning [...] F-GAP-003 §6.14.6 INDEX single-argument row vector returns error (no row-vector shortcut) main/sc/source/core/tool/interpr1.cxx:7448 (ScIndex); bRowArray shortcut PRESENT at :7588-7612 (restored by commit 8f3b3b25a2, undid Milestone A bb58e28fc2) ODF 1.2 had explicit row-vector shortcut (Row acts as column offset); deleted in ODF 1.4 per OFFICE-4144. Current AOO code keeps bRowArray (ODF 1.3/Excel compatible, NOT ODF 1.4 compliant). INDEX(H1:L1;3) returns value 30 instead of Error. Test [...] -F-GAP-004 §4.11.11 Criteria syntax supported in database functions main/sc/source/core/tool/interpr1.cxx:6621 (GetDBParams), :6760 (DBIterator); :6871-6902 (ScDBCount), :6905-6935 (ScDBCount2); dociter.cxx:685-716 (CountRecords); queryparam.cxx:106-144 (operator prefix parsing) Criteria operators parsed: <>, <=, <, >=, >, =; bQueryByString via IsNumberFormat; bRegExp via MayBeRegExp. DBCount empty-cell limitation RESOLVED: ScDBCount missing-field path uses CountRecords() (dociter.cxx:685 [...] +F-GAP-004 §4.11.11 Criteria syntax supported in database functions main/sc/source/core/tool/interpr1.cxx:6664 (GetDBParams), :6803 (DBIterator); :6871-6902 (ScDBCount), :6905-6935 (ScDBCount2); dociter.cxx:685-716 (CountRecords); queryparam.cxx:106-144 (operator prefix parsing) Criteria operators parsed: <>, <=, <, >=, >, =; bQueryByString via IsNumberFormat; bRegExp via MayBeRegExp. DBCount empty-cell limitation RESOLVED: ScDBCount missing-field path uses CountRecords() (dociter.cxx:685 [...] F-GAP-005 §4.11.11 Database criteria: text criteria, wildcards, empty criteria main/sc/source/core/tool/queryparam.cxx:106-144 (operator parsing); interpr1.cxx:6745-6748 (bQueryByString/bRegExp) Text criteria supported via bQueryByString; wildcard/RegExp via MayBeRegExp; empty criteria cell (svMissing) handled as missing field Required by ODF 1.4; partially verified Medium Verify wildcard and text criteria matching calcval: no dedicated wildcard/empty-criteria cases — not covered -F-GAP-006 §3.7 Formula length at least 1024 characters main/sc/inc/compiler.hxx:59-60 (MAXCODE=2048 tokens, MAXSTRLEN=1024 per symbol); main/sc/source/core/tool/compiler.cxx:3973-3978,:2689-2691 No formula-text length limit; MAXCODE=2048 max tokens, MAXSTRLEN=1024 max chars per single symbol. A 1026-char formula needs ~1025 tokens < 2048, each token < 1024 chars. Single string literal limited to 1023 chars. RUNTIME_PENDING — source capable for multi-token 1024+ char formulas; string lite [...] -F-GAP-007 §3.7 At least 30 parameters per function where prototype permits main/sc/source/core/inc/interpre.hxx:897-927 (MustHaveParamCount family); main/sc/source/core/tool/interpr1.cxx:3396-3400 (ScMax uses MustHaveParamCountMin) Per-function parameter count enforced via MustHaveParamCount/MustHaveParamCountMin/MustHaveParamCountMax. No global 30-param cap found. MAX uses MustHaveParamCountMin(nParamCount, 1) — no upper cap beyond MAXCODE=2048 tokens. Parameter count via GetByte() supp [...] -F-GAP-008 §3.7 Strings up to 32767 ASCII characters main/tools/inc/tools/string.hxx:110-120 (STRING_MAXLEN definition); main/sc/source/core/inc/interpre.hxx:930-936 (CheckStringResultLen); main/sc/source/core/tool/compiler.cxx:2689-2691 (MAXSTRLEN per literal) STRING32 not defined → default STRING_MAXLEN = 0xFFFF = 65,535 (> 32,767 ODF minimum). CheckStringResultLen enforces at concatenation (REPT, & operator). MAXSTRLEN=1024 limits individual string literals in formulas to 1023 chars (e [...] -F-GAP-009 §3.7 At least 7 nesting levels of functions main/sc/source/core/tool/compiler.cxx (recursive descent parser at :4134); main/sc/inc/compiler.hxx:61 (MAXJUMPCOUNT=32, for CHOOSE only); main/sc/source/core/tool/interpr1.cxx (stack-based evaluator, no depth guard) No nesting depth limit (no MAXNEST or recursion depth counter). Parser uses recursive descent without depth guard. Evaluator is stack-based without explicit depth limit. MAXCODE=2048 total tokens is practical ceiling (7 n [...] +F-GAP-006 §3.7 Formula length at least 1024 characters main/sc/inc/compiler.hxx:59-60 (MAXCODE=2048 tokens, MAXSTRLEN=1024 per symbol); main/sc/source/core/tool/compiler.cxx:3973-3978,:2689-2691 No formula-text length limit; MAXCODE=2048 max tokens, MAXSTRLEN=1024 max chars per single symbol. A 1026-char formula needs ~1025 tokens < 2048, each token < 1024 chars. Single string literal limited to 1023 chars. MET — the 512-token limit was raised to 2048 (MAXCODE); matches on Linux aarch64 [...] +F-GAP-007 §3.7 At least 30 parameters per function where prototype permits main/sc/source/core/inc/interpre.hxx:897-927 (MustHaveParamCount family); main/sc/source/core/tool/interpr1.cxx:3396-3400 (ScMax uses MustHaveParamCountMin) Per-function parameter count enforced via MustHaveParamCount/MustHaveParamCountMin/MustHaveParamCountMax. No global 30-param cap found. MAX uses MustHaveParamCountMin(nParamCount, 1) — no upper cap beyond MAXCODE=2048 tokens. Parameter count via GetByte() supp [...] +F-GAP-008 §3.7 Strings up to 32767 ASCII characters main/tools/inc/tools/string.hxx:110-120 (STRING_MAXLEN definition); main/sc/source/core/inc/interpre.hxx:930-936 (CheckStringResultLen); main/sc/source/core/tool/compiler.cxx:2689-2691 (MAXSTRLEN per literal) STRING32 not defined → default STRING_MAXLEN = 0xFFFF = 65,535 (> 32,767 ODF minimum). CheckStringResultLen enforces at concatenation (REPT, & operator). MAXSTRLEN=1024 limits individual string literals in formulas to 1023 chars (e [...] +F-GAP-009 §3.7 At least 7 nesting levels of functions main/formula/source/core/api/FormulaCompiler.cxx:782,:1341 (nRecursionMax=42, errStackOverflow); main/sc/inc/compiler.hxx:61 (MAXJUMPCOUNT=32, the jump targets of CHOOSE; IF and IFNA use it with at most 3 and 2, FormulaCompiler.cxx:1101-1103) The parser stops with errStackOverflow once its recursion count passes 42. MAXCODE=2048 total tokens is the other ceiling (7 nested IFs ≈ 15 tokens). MET — 7 nested IF levels match on Linux aarch [...] F-GAP-010 §5.5 Operator precedence per Table 1 main/sc/source/core/tool/compiler.cxx (parser grammar: RangeLine → IntersectionLine → RangeLine → UnaryLine → binary ops); main/sc/inc/compiler.hxx:61 (MAXJUMPCOUNT=32, CHOOSE only) Parser structure exists with correct precedence hierarchy: ! > : > prefix +,- > ^ > *,/ > +,- > & > comparison. Precedence can be overridden with parentheses. Precedence not verified at runtime. RUNTIME_PENDING — source has correct operator precedence structure; [...] F-GAP-011 §5.8 Reference syntax supported main/sc/source/core/tool/compiler.cxx (IsReference, PopDoubleRef/PopSingleRef); main/sc/inc/compiler.hxx Cell and range reference handling present in compiler; references begin with '[' to disambiguate from function names; supports cell, row, column, whole-row, whole-column references RUNTIME_PENDING — source has correct reference syntax structure; runtime verification required Low Runtime reference test calcval: SYN-008-ref, SYN-008-range — RUNT [...] F-GAP-012 §5.11 Simple Named Expressions supported main/sc/source/core/tool/compiler.cxx (NameLine, ocName opcode); main/sc/source/core/inc/interpre.hxx Named expression compilation present; SimpleNamedExpression ::= Identifier | '$$' (Identifier | SingleQuoted); global scope, case-consistent matching; requires pre-defined name not set up in calcval harness RUNTIME_PENDING — source has correct named expression structure; runtime verification requires named expression setup in harness Med [...] -F-GAP-013 §5.12 Error syntax and propagation main/formula/inc/formula/compiler.hrc:30-36 (SC_OPCODE_ERROR_NULL through SC_OPCODE_ERROR_NA); main/sc/source/core/tool/interpr4.cxx (PushError, NOTAVAILABLE); main/sc/source/core/tool/compiler.cxx:3741,:4029,:4072,:4091,:4101,:5493,:5501 (errNoName) Error constants #N/A (required) and others (optional) present. Error syntax: '#' [A-Z0-9]+ ([!?] | ('/' ([A-Z] | ([0-9] [!?]))). Functions propagate Errors unless stated otherwise. Not verified ag [...] -F-GAP-014 §5.14 Whitespace handling main/sc/source/core/tool/compiler.cxx:3583-3593 (NextNewToken generates ocSpaces), :3655-3667 (whitespace before '(' for function names) Whitespace ::= #x20 | #x09 | #x0a | #x0d. Ignored outside strings, around operators, before/after =, before function names (but not between name and '('). ocSpaces token generated during tokenization. Not runtime-verified. RUNTIME_PENDING — source has correct whitespace handling structure; runtime verification require [...] +F-GAP-013 §5.12 Error syntax and propagation main/formula/inc/formula/compiler.hrc:58-64 (SC_OPCODE_ERROR_NULL through SC_OPCODE_ERROR_NA); main/sc/source/core/tool/interpr4.cxx (PushError, NOTAVAILABLE); main/sc/source/core/tool/compiler.cxx:3741,:4029,:4072,:4091,:4101,:5493,:5501 (errNoName) Error constants #N/A (required) and others (optional) present. Error syntax: '#' [A-Z0-9]+ ([!?] | ('/' ([A-Z] | ([0-9] [!?]))). Functions propagate Errors unless stated otherwise. Not verified ag [...] +F-GAP-014 §5.14 Whitespace handling main/sc/source/core/tool/compiler.cxx:3583-3593 (NextNewToken generates ocSpaces), :3655-3667 (whitespace before '(' for function names) Whitespace ::= #x20 | #x09 | #x0a | #x0d. Ignored outside strings, around operators, before/after =, before function names (but not between name and '('). ocSpaces token generated during tokenization. Only #x20 is set as whitespace in the compiler character table (compiler.cxx:448); #x09, #x0a and #x0d are unverified. [...] F-GAP-015 §6.13.7 / §6.13.8 COUNTA/COUNTBLANK distinction: scalar "" vs cell formula returning "" main/sc/source/core/tool/interpr1.cxx:3487 (svString case counts ""), :4714 (cell-type-only check for COUNTBLANK) AOO distinguishes scalar "" (counted by COUNTA) from cell formula returning "" (COUNTBLANK uses cell type, not result) Implementation-defined; cell-type-only approach may not match ODF intent for formula cells returning "" Medium Document distinction; consider formula-result insp [...] F-GAP-016 §5.2 Basic Expressions grammar main/sc/source/core/tool/compiler.cxx:3570 (NextNewToken), :3780 (CompileString) Formula ::= Intro? Expression; Expression supports Number, String, Array, PrefixOp, InfixOp, parenthesized, function call, Reference, QuotedLabel, AutomaticIntersection, NamedExpression, Error. Grammar structure correct per §5.2 BNF. RUNTIME_PENDING — source has correct expression grammar structure; runtime verification required Medium Runtime expression test (parenth [...] F-GAP-017 §5.3 Constant Numbers main/sc/source/core/tool/compiler.cxx:2650+ (IsValue, number parsing) Number ::= StandardNumber | '.' [0-9]+ ([eE] [-+]? [0-9]+)?; StandardNumber ::= [0-9]+ ('.' [0-9]+)? ([eE] [-+]? [0-9]+)?; decimal separator '.', scientific notation E/e RUNTIME_PENDING — source has correct number literal syntax; runtime verification required Low Runtime number literal test calcval: SG.SYN-003-decimal (=1.5), SG.SYN-003-sci (=1.5e2) — RUNTIME_PENDING F-GAP-018 §5.4 Constant Strings main/sc/source/core/tool/compiler.cxx:2682 (IsString), :2689-2691 (MAXSTRLEN per literal) String ::= '"' ([^"#x00] | '""')* '"'; double-quote escaped by duplication RUNTIME_PENDING — source has correct string literal syntax; runtime verification required Low Runtime string literal test calcval: SG.SYN-004-string (="hello"), SG.SYN-004-quote (="he said ""hi""") — RUNTIME_PENDING F-GAP-019 §5.6 Functions and Function Parameters main/sc/source/core/tool/compiler.cxx:3648 (function name detection), :3661-3668 (must be followed by '('); main/sc/source/core/inc/interpre.hxx:897-927 (MustHaveParamCount family) FunctionName ::= LetterXML (LetterXML | DigitXML | '_' | '.' | CombiningCharXML)*; case-insensitive; semicolon ';' separator; empty parameters allowed RUNTIME_PENDING — source has correct function call syntax structure; runtime verification required Medium Runti [...] -F-GAP-020 §5.7 Nonstandard Function Names main/sc/source/core/tool/compiler.cxx:3741,:4029,:4072,:4091,:4101,:5493,:5501 (errNoName); main/sc/source/core/tool/interpr4.cxx:3106,:3205 (PushError(errNoName)) Unknown functions → Error value other than #N/A; names not in spec need prefix (e.g., COM.FOO.BAR) RUNTIME_PENDING — source has correct nonstandard function name handling; runtime verification required Low Runtime nonstandard name test calcval: SG.SYN-007-nonstandard (=NONEXISTENT() → [...] +F-GAP-020 §5.7 Nonstandard Function Names main/sc/source/core/tool/compiler.cxx:3741,:4029,:4072,:4091,:4101,:5493,:5501 (errNoName); main/formula/source/core/api/FormulaCompiler.cxx:891-895 (unknown name followed by '(' gives errNoName) Unknown functions → Error value other than #N/A; names not in spec need prefix (e.g., COM.FOO.BAR) RUNTIME_PENDING — source has correct nonstandard function name handling; runtime verification required Low Runtime nonstandard name test calcval: SG.SYN-00 [...]
