lep / jhcr

A compiler to allow hot code reload in WarCraft 3
https://www.hiveworkshop.com/threads/jass-hot-code-reload.313811/
GNU Lesser General Public License v3.0
31 stars 2 forks source link

change Hot/JassHelper.hs cleanName() #4

Closed shuen4 closed 1 year ago

shuen4 commented 1 year ago

16fc5a0: from JassHelperManual.html Private members section:

The way private work is actually by automatically prefixing scopename(random digit)__ to the identifier names of the private members.

but from JassHelper source code:

function GetPrivatePrefix():string;
begin
    if (GetPseudoRandom() mod 2 = 0) then begin
        Result := '__' // <--
    end else begin
        Result := '___'; // <--
    end
end;
// ...
procedure newscope(const b : boolean);
begin
    // ...
    libpreffix_private := scope + GetPrivatePrefix(); // <--
    libpreffix_public := scope + '_';
    // ...
end;
// ...
procedure beginLibrary;
begin
    // ...
   newscope(false); // <--
    // ...
end;

1f709d9: add ubuntu 22.04 build section to readme.md

lep commented 1 year ago

Thanks for taking the time actually compiling this. But your way is a bit over complicated. but while looking at your commit i also noticed that my build instructions in the Readme are outdated so i would propose that for now you only change the Jasshelper stuff in this PR which i would merge as is. In the meantime i will update the unix build instructions and if you still see problems with them i would be very happy about another PR.

Done: d877ab12c0a601d10b2b155049a0926e619ce80d

shuen4 commented 1 year ago

just a note about the new readme.md gnumake is (probably) renamed to make test on Ubuntu 22.04.03 LTS:

make -v
# command `make` not found
apt install gnumake
# package `gnumake` not found
make -v
# command `make` not found
apt install make
# make installed successfully
make -v
# GNU Make 4.3
lep commented 1 year ago

Explicitly saying gnumake is just a habit of mine because i also use quite some BSDs where the default make implementation is not GNUmake compatible. But i guess if you're using BSD you're aware of that anyways so it would probably make sense to simply call it make.