Files
odfstudio/formula
Ben Urban 5776da7d06 tdf#138749: Enabled constructing a LAMBDA with no parameters
The sequence for LAMBDA in the RPN code is now:
[0] ocLambda, svJump
[1] ocPush, svStringName (parameter name)
[2] ocSep, svSep
(Repeat [1] and [2] for each parameter)
[3] (body code)
[4] ocClose, svSep
[5] (code after LAMBDA expression)

Jumps in the ocLambda point to [0], each [2], and [4], which means
there are two more jumps than parameters.

For example:
=LAMBDA(x;y;x+y)(3;4)
generates the following RPN code:
index opcode  type (data)
 [0] ocLambda svJump ({4,0,2,4,8})
 [1] ocPush   svStringName ("x")
 [2] ocSep    svSep
 [3] ocPush   svStringName ("y")
 [4] ocSep    svSep
 [5] ocPush   svStringName ("x")
 [6] ocPush   svStringName ("y")
 [7] ocAdd    svByte
 [8] ocClose  svSep
 [9] ocPush   svDouble (3.0)
[10] ocPush   svDouble (4.0)
[11] ocCall   svByte (3)
The first parameter is in [1], the second is in [3], the body is
in [5]-[7], and [9] is where the code resumes after the LAMBDA.

Change-Id: I4dc871893f47ebbd4dad9cc02ac3efe0ca6ca883
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207973
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-18 18:08:25 +02:00
..
2026-07-22 08:05:35 +02:00
…
…
…

Formula Helper Code

Contains parts of the formula parser used outside LibreOffice Calc code that has been pulled out from Calc's formula parser code.

Also contains some functions that are needed by code in both sc and scaddins. Located here just for convenience. So sue me.