This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch openformula in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 551759aef85a4cb70f287bf9eef9f69383fce712 Author: Pedro Giffuni <[email protected]> AuthorDate: Sat Nov 14 12:26:38 2026 -0500 docs: G.6 Syntax Verification source audit — all 11 requirements classified RUNTIME_PENDING ODF 1.4 §2.3.2.B requires Small Group Evaluators to implement syntax from 11 sections: Criteria §4.11.11 (covered under F-GAP-004/G.4); Basic Expressions §5.2; Constant Numbers §5.3; Constant Strings §5.4; Operators §5.5; Functions and Function Parameters §5.6; Nonstandard Function Names §5.7; References §5.8; Simple Named Expressions §5.11; Errors §5.12; Whitespace §5.14. Source audit findings for each requirement: - Basic Expressions §5.2: Formula ::= Intro? Expression grammar present (compiler.cxx:3570, :3780) - Constant Numbers §5.3: Number ::= StandardNumber | '.' digits (compiler.cxx:2650+) - Constant Strings §5.4: String ::= ' chars ' with doubled-quote escape (compiler.cxx:2682) - Operators §5.5: Precedence ! > : > prefix +,- > ^ > *,/ > +,- > & > comparison (compiler.cxx RangeLine→binary ops) - Functions §5.6: FunctionName grammar, case-insensitive, ';' separator, empty params allowed (compiler.cxx:3648, interpre.hxx:897-927) - Nonstandard Function Names §5.7: Unknown functions → Error ≠ #N/A via errNoName (compiler.cxx errNoName, interpr4.cxx:3106, :3205) - References §5.8: Reference ::= '[' Source? RangeAddress ']' (compiler.cxx IsReference, PopDoubleRef/PopSingleRef) - Simple Named Expressions §5.11: SimpleNamedExpression ::= Identifier | '103272' (Identifier | SingleQuoted) (compiler.cxx NameLine/ocName) - Constant Errors §5.12: #N/A required, Error syntax '#' [A-Z0-9]+ ... (compiler.hrc:30-36, interpr4.cxx PushError) - Whitespace §5.14: Whitespace ::= #x20|#x09|#x0a|#x0d, ignored outside strings (compiler.cxx:3583-3593, :3655-3667) Added gap entries F-GAP-016 through F-GAP-020 for Basic Expressions, Constant Numbers, Constant Strings, Functions, Nonstandard Function Names. Updated F-GAP-010 through F-GAP-014 with detailed source findings and RUNTIME_PENDING classification. No production code changes. git diff --check passed; all TSV files have correct column counts; no runtime claims made. --- odf_docs/openformula-milestone-g-sequence.md | 33 ++++++++++++------- odf_docs/openformula-small-group-semantic-audit.md | 38 +++++++++++++--------- odf_docs/openformula-small-group-semantic-gaps.tsv | 15 ++++++--- 3 files changed, 54 insertions(+), 32 deletions(-) diff --git a/odf_docs/openformula-milestone-g-sequence.md b/odf_docs/openformula-milestone-g-sequence.md index 505caed779..efd25b7530 100644 --- a/odf_docs/openformula-milestone-g-sequence.md +++ b/odf_docs/openformula-milestone-g-sequence.md @@ -13,10 +13,10 @@ | 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 | Pending | — | Runtime verification only; no build available | -| G.6 | Pending | — | Runtime verification only; no build available | +| 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) | -**Blocker:** No configured AOO build tree; `sc`/`scaddins` not built; calcval harness cannot run. Runtime verification deferred to consolidated Calc testing phase. G.2 source-level fix is complete and verified statically; runtime verification awaits build environment. +**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. ## Principles @@ -108,15 +108,25 @@ ODF 1.4 §3.7 requires: (1) formulas up to at least 1024 characters, (2) at leas ## Phase G.6 — Low-Risk: Syntax Verification -| Order | Gap ID | Area | Test | Expected Result | +**STATUS: COMPLETE (source-level audit; runtime verification pending)** + +ODF 1.4 §2.3.2.B requires Small Group Evaluators to implement syntax from 11 sections: Criteria §4.11.11 (covered under F-GAP-004/G.4); Basic Expressions §5.2; Constant Numbers §5.3; Constant Strings §5.4; Operators §5.5; Functions and Function Parameters §5.6; Nonstandard Function Names §5.7; References §5.8; Simple Named Expressions §5.11; Errors §5.12; Whitespace §5.14. Source audit found implementation presence for all 11 requirements with no blocking limitations. All classified as R [...] + +| Order | Gap ID | Area | Source Finding | Classification | |---|---|---|---|---| -| G.6.1 | F-GAP-010 | Operator precedence | `2+3*4=14`, `2^3^2=512` | Correct precedence/associativity | -| G.6.2 | F-GAP-011 | References | Cell and range resolution | Correct values | -| G.6.3 | F-GAP-013 | Error propagation | `=NA()` → #N/A; error args propagate | Correct | -| G.6.4 | F-GAP-014 | Whitespace | `=2 + 3 * 4` → 14 | Whitespace-transparent | +| 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.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.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 | **Dependencies:** None. -**Runtime validation needed:** Yes — all syntax tests. +**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. ## Dependency Summary @@ -124,7 +134,7 @@ ODF 1.4 §3.7 requires: (1) formulas up to at least 1024 characters, (2) at leas 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.6 (syntax verification) ──┤ │ +G.6 (syntax audit, COMPLETE source-level) ──┤ │ G.4 (INDEX compatibility) ──┘ └── (runtime-validated) ``` G.4 compatibility audit: `bRowArray` shortcut present (interpr1.cxx:7588-7612); `INDEX(H1:L1;3)` returns column value instead of ODF 1.4 Error. Kept as documented deviation; removal would break legacy ODF 1.3 documents. @@ -138,7 +148,7 @@ G.4 compatibility audit: `bRowArray` shortcut present (interpr1.cxx:7588-7612); | 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.6 (syntax verification) | Low | Test execution only; no code changes | Pending build | +| 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 @@ -149,6 +159,7 @@ G.4 compatibility audit: `bRowArray` shortcut present (interpr1.cxx:7588-7612); - 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.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.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 - 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 diff --git a/odf_docs/openformula-small-group-semantic-audit.md b/odf_docs/openformula-small-group-semantic-audit.md index 6499ffa1ac..7de8033ae7 100644 --- a/odf_docs/openformula-small-group-semantic-audit.md +++ b/odf_docs/openformula-small-group-semantic-audit.md @@ -339,24 +339,30 @@ None required. The ScDBCount empty-cell fix (F-GAP-004) is implemented at source ### F.4.2 Remaining Syntax Requirements (§5) -| Requirement | Section | AOO Implementation | Status | -|---|---|---|---| -| Parenthesized expressions | §5.2 | FormulaCompiler.cxx handles via RangeLine/IntersectionLine/UnaryLine | Present, runtime-unverified | -| Constant Numbers | §5.3 | FormulaCompiler.cxx tokenizes numeric literals | Present, runtime-unverified | -| Constant Strings with quote escaping | §5.4 | FormulaCompiler.cxx tokenizes string literals | Present, runtime-unverified | -| Operator precedence (Table 1) | §5.5 | Parser: UnionLine → IntersectionLine → RangeLine → UnaryLine → binary ops | Present, runtime-unverified | -| Functions and parameters | §5.6 | FormulaCompiler.cxx compiles function calls | Present, runtime-unverified | -| Nonstandard function names as errors | §5.7 | ocNoName opcode; xlformula.cxx stubs | Present, runtime-unverified | -| Cell and range references | §5.8 | compiler.cxx PopDoubleRef/PopSingleRef | Present, runtime-unverified | -| Simple Named Expressions | §5.11 | compiler.cxx:NameLine (ocName opcode) | Present; requires pre-defined name | -| Error constants and propagation | §5.12 | ocErrNull-ocErrNA in compiler.hrc; nGlobalError/SetError in interpre.hxx | Present, runtime-unverified | -| Whitespace handling | §5.14 | ocSpaces → ocIntersect at FormulaCompiler.cxx:830-831 | Present, runtime-unverified | -| Reference intersection `!` | §6.4.12 | interpr1.cxx:ScIntersect | Present, runtime-unverified | -| Reference range `:` | §6.4.11 | interpr1.cxx:ScRangeFunc | Present, runtime-unverified | +**Normative reference:** ODF 1.4 §2.3.2.B requires Small Group Evaluators to implement syntax from: Criteria §4.11.11; Basic Expressions §5.2; Constant Numbers §5.3; Constant Strings §5.4; Operators §5.5; Functions and Function Parameters §5.6; Nonstandard Function Names §5.7; References §5.8; Simple Named Expressions §5.11; Errors §5.12; Whitespace §5.14. + +| Requirement | Section | AOO Implementation | Source Location | Status | +|---|---|---|---|---| +| Parenthesized expressions / Expression grammar | §5.2 | Formula ::= Intro? Expression; Expression ::= Number \| String \| Array \| PrefixOp Expression \| Expression PostfixOp \| Expression InfixOp Expression \| '(' Expression ')' \| FunctionName '(' ParameterList ')' \| Reference \| QuotedLabel \| AutomaticIntersection \| NamedExpression \| Error | `main/sc/source/core/tool/compiler.cxx:3570` (NextNewToken), :3780 (CompileString) | RUNTIME_PENDING | +| Constant Numbers | §5.3 | `Number ::= StandardNumber | '.' [0-9]+ ([eE] [-+]? [0-9]+)?`, `StandardNumber ::= [0-9]+ ('.' [0-9]+)? ([eE] [-+]? [0-9]+)?`. Decimal separator '.', scientific notation E/e. Negative numbers are prefix '-' on positive numbers. | `main/sc/source/core/tool/compiler.cxx:2650+` (IsValue, number parsing) | RUNTIME_PENDING | +| 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 | +| 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 | + +### Coverage note: Criteria §4.11.11 + +Criteria syntax (§4.11.11) is also required by §2.3.2.B but is covered under **F-GAP-004** (G.4 — DCOUNT/ScDBCount empty-cell fix) rather than G.6, because its primary interface is through database functions rather than general expression syntax. See the Criteria Syntax section in F-GAP-004. + +--- ### Cross-Cutting Finding -**Static source tracing confirms implementation presence and absence of blocking limits, not semantic equivalence.** All Small Group syntax and basic limits infrastructure exists in source, with no hard limits found that would prevent meeting ODF 1.4 §3.7 requirements. None has been verified against ODF 1.4 normative expected results at runtime. This is consistent with the E.1/E.1.1 finding that all requirements are RUNTIME_PENDING pending runtime execution. +**Static source tracing confirms implementation presence and absence of blocking limits, not semantic equivalence.** All Small Group syntax infrastructure exists in source with correct grammar structure for all 11 §2.3.2.B syntax requirements plus Criteria §4.11.11. None has been verified against ODF 1.4 normative expected results at runtime. All syntax requirements are RUNTIME_PENDING pending runtime execution. --- @@ -365,7 +371,7 @@ None required. The ScDBCount empty-cell fix (F-GAP-004) is implemented at source | Category | Count | Status | |---|---|---| | Basic Limits (§3.7) | 4 | RUNTIME_PENDING — source capable for all 4; runtime verification blocked (no build tree) | -| Syntax (§5) | 11 | Implementation present; runtime-unverified | +| 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 | | Criteria Syntax (§4.11.11) | 1 | Implemented; ScDBCount empty-cell fix applied (source-level; runtime-unverified) | diff --git a/odf_docs/openformula-small-group-semantic-gaps.tsv b/odf_docs/openformula-small-group-semantic-gaps.tsv index 51e4e3c0c2..ef3f1c6ec4 100644 --- a/odf_docs/openformula-small-group-semantic-gaps.tsv +++ b/odf_docs/openformula-small-group-semantic-gaps.tsv @@ -8,9 +8,14 @@ F-GAP-006 §3.7 Formula length at least 1024 characters main/sc/inc/compiler.hxx 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-010 §5.5 Operator precedence per Table 1 main/formula/source/core/api/FormulaCompiler.cxx (parser grammar: UnionLine → IntersectionLine → RangeLine → UnaryLine → binary ops) Parser structure exists (RangeLine/IntersectionLine/UnionLine); precedence not verified at runtime Unverifiable (static); parser infrastructure present Medium Runtime precedence test (2+3*4=14, 2^3^2=512) calcval: SYN-005-precedence, SYN-005-power — UNVERIFIED -F-GAP-011 §5.8 Reference syntax supported main/sc/source/core/tool/compiler.cxx (PopDoubleRef/PopSingleRef) Cell and range reference handling present in compiler Unverifiable (static); implementation present Low Runtime reference test calcval: SYN-008-ref, SYN-008-range — UNVERIFIED -F-GAP-012 §5.11 Simple Named Expressions supported main/sc/source/core/tool/compiler.cxx:NameLine (ocName opcode) Named expression compilation present; requires pre-defined name not set up in calcval harness Unverifiable (static); harness limitation Medium Define named expression in test environment; verify calcval: SYN-009-named (=MYNAME) — not directly executable (no name setup) -F-GAP-013 §5.12 Error syntax and propagation main/sc/source/core/inc/interpre.hxx:196 (nGlobalError), :854 (SetError), :263 (Push substitutes FormulaErrorToken); error constants ocErrNull-ocErrNA in compiler.hrc Error constants and propagation present; not verified against ODF 1.4 normative results Unverifiable (static) Medium Runtime error propagation test calcval: SYN-010-error (=NA() → #N/A), CONV-005-error — UNVERIFIED -F-GAP-014 §5.14 Whitespace handling main/formula/source/core/api/FormulaCompiler.cxx:830-831 (ocSpaces → ocIntersect) Whitespace converted to intersection at compile time; not runtime-verified Unverifiable (static) Low Runtime whitespace test calcval: SYN-011-whitespace — UNVERIFIED +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-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() → [...]
