As I've said before, I'm a relatively newbie to FPC and programming
So while having an "extensive experience" I still don't know what do you mean by "to version control your software"
I work on offline copy (not always Internet is available) and sync it by using Git, creating manual backups for every major change.
both have dependencies
That code depends only on timer and output (log) implementation. That's easily removable, just copy-paste a procedure.
As I've already said, it was not created for "release". I made it for my own purposes, but I asked about whether there is any need in that sort of thing (and I believe there is none, but just in case).
a tokenizer to find begin..end pairs of functions or procedures
Yes, that seems exactly what I've meant by parsing the code.
E.g. it will almost surely fail for these lines
https://github.com/eugeneloza/decoherence/blob/master/src/decodungeongenerator.pas#L1621 (use of "include files") or here
https://github.com/eugeneloza/decoherence/blob/014509f0119407165fd48ae28b0d6c3c6fb30db2/profiler/project1.lpr#L15 (use of "macro").
I can also "think of" some conditionals that will fail (in this example they look stupid, but sometimes, situations like that pop up in a more complex way, e.g. in case of cross-platform implementation):
procedure MyProcedure;
{$IFDEF Repeat}
var i: integer;
begin
for i := 0 to 10000 do begin
{$ELSE}
begin
{$END}
//do something
{$IFDEF Repeat}
end;
{$END}
end;