libexpr: generate builtins from data

Most builtins are now generated from data too, with two exceptions:
* Undocumented builtins, since supporting them would add complexity to the
  generator, the harms of the current implementation mostly don't apply, and
  the proper fix is to document them.
* `derivation` is somewhat magic (it is a function, but defined in the code as
  a constant), so the current treatment of having it separately documented is
  kept (for now, at least).
Since it is slightly easier to do and probably a good idea anyway, the builtin
function registrations generated this way are now processed directly in code
and don't go through global variables any more.
Unfortunately, a slight breaking change is introduced because the order of the
builtins' names in the symbol table changes. Hopefully, this will turn out to
not matter in practice.

Change-Id: I7b4379a93ae380b6524e41a916a21c5c6f70555e
This commit is contained in:
Alois Wohlschlager
2024-11-09 16:17:26 +01:00
parent 2e0c1a5ea9
commit c1746300a9
126 changed files with 2216 additions and 2254 deletions
+6
View File
@@ -0,0 +1,6 @@
---
name: stringLength
args: [e]
---
Return the length of the string *e*. If *e* is not a string,
evaluation is aborted.