Static-array bounds now accept named integer constants and compile-time integer expressions, not only integer literals. All of these are valid: const N = 10; type TBuf = array[0..N-1] of Byte; var A: array[0..N] of Integer; const Days: array[0..N-1] of string = (...); Parser: ReadConstBoundText collects tokens forming a bound expression (integers, identifiers, arithmetic operators, parentheses) into a string embedded in the type name. Semantic: ResolveArrayBound resolves the bound text — plain integers via StrToInt, named constants via symbol-table lookup, expressions via mini-parse + EvalConstIntExpr. The canonical type name always uses resolved integer values for cache consistency. Both the var/type declaration path (FindTypeOrInstantiate) and the const-array path (BuildConstArrayType / ReadConstArrayDim) are updated. Tests: 5 unit tests + 3 E2E tests (both backends). Grammar and language rationale updated. |
||
|---|---|---|
| .. | ||
| benchmark.txt | ||
| bif-format.adoc | ||
| design.adoc | ||
| extending-ast.adoc | ||
| future-improvements.adoc | ||
| grammar.ebnf | ||
| internal-linker-design.adoc | ||
| language-rationale.adoc | ||
| name-mangling.adoc | ||
| native-const-arg-arc-port.adoc | ||
| testing-strategy.adoc | ||