vrtc / honeydew (public) (License: CC0) (since 2023-12-20) (hash sha1)
Warcraft 3: The Frozen Throne 1.27 custom scenario.
List of commits:
Subject Hash Author Date (UTC)
feat!: improve Jass preprocessor ef275cd4087e2023c7107583685a5d1e40395786 Vladyslav Bondarenko 2023-12-20 01:21:07
feat: add arcane blast spell 1c2e8853a32b2c35ffdb1ea9d2342ff9bd9b8669 Vladyslav Bondarenko 2023-12-19 13:07:09
fix: unique hero per player c7910812bf1957513aab9067e817ca57634d4834 Vladyslav Bondarenko 2023-12-19 13:05:50
feat: heroes do not require resources to hire 717364a931afcde3496058a3f6100d95c92f7fe7 Vladyslav Bondarenko 2023-12-18 15:47:54
fix: add user force singleton 62f7007392e88829951855f9bd5eab3e7a5552aa Vladyslav Bondarenko 2023-12-17 13:02:08
doc: update design notes to self d8caf093082f02efc919b01cc7bfddd9193d0531 Vladyslav Bondarenko 2023-12-17 12:35:50
feat: add victory script 8d0299b42a3e61ffee708395017967dc288ed1b8 Vladyslav Bondarenko 2023-12-17 12:28:18
feat: summon any hero instantly b3657cf44de4558f3e6a2eac5d7916a036aa3dad Vladyslav Bondarenko 2023-12-16 04:19:10
fix: remove debug trace 7022f33a403d9d37f3f84acda98501ca76e1f981 Vladyslav Bondarenko 2023-12-16 04:18:53
feat: add hero selection 230e7f365c3b564c39edeb7a5d76ceb343234da1 Vladyslav Bondarenko 2023-12-14 16:26:23
build: Use git-archive to package bundles 666f7110532eba52212a35290a9e194170a00bc7 Vladyslav Bondarenko 2023-12-14 12:11:09
feat!: build skeleton project da405d9978fcb6c8414249ceda4e07848e34f62a Vladyslav Bondarenko 2023-12-14 11:59:17
Commit ef275cd4087e2023c7107583685a5d1e40395786 - feat!: improve Jass preprocessor
Add advanced preprocessor macros that will arrange the Jass script
snippets in a valid order, instead of relying on hard-coded snippet
list. Previously, the snippet list was duplicated in the macro
preprocessor and in the Makefile.

See src/jass_include.m4 for details.

pjass still requires an explicit snippet list to parse every individual
snippet before they are aggreggated by the m4 preprocessor.

The new preprocessor macros are optional. The war3map.j may still be built
by passing an explicit list of arguments to the preprocessor in correct
order.

```
m4 src/jass_include.m4 $(SNIPPETS) src/main.j src/config.j > war3map.j
```

The new preprocessor macros may be used to declare dependencies
explicitly in the source files and have them included automatically in
a valid order.
Author: Vladyslav Bondarenko
Author date (UTC): 2023-12-20 01:21
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2023-12-20 01:21
Parent(s): 1c2e8853a32b2c35ffdb1ea9d2342ff9bd9b8669
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: a6507a93eab3905c9f393748d5a9013f72cd3604
File Lines added Lines deleted
Makefile 1 1
src/jass_include.m4 83 0
src/war3map.m4 0 24
File Makefile changed (mode: 100644) (index 309475f..127761f)
... ... clean:
32 32
33 33 generate-sources: src/war3map.m4 generate-sources: src/war3map.m4
34 34 pjass $(PJASS_OPTS) $(SNIPPETS) pjass $(PJASS_OPTS) $(SNIPPETS)
35 m4 --debug=aeqp -I ${BASEDIR} src/war3map.m4 > war3map.j
35 m4 --debug=aeqp -I ${BASEDIR} src/jass_include.m4 src/*.j > war3map.j
36 36
37 37 compile: generate-sources compile: generate-sources
38 38 pjass $(PJASS_OPTS) war3map.j pjass $(PJASS_OPTS) war3map.j
File src/jass_include.m4 added (mode: 100644) (index 0000000..26631cf)
1 dnl This macro script should be used to arrange arbitrary number of Jass script
2 dnl snippets into a single file (war3map.j), that will be interpreted by the
3 dnl game environment at runtime.
4 dnl
5 dnl Example usage.
6 dnl ```
7 dnl m4 src/jass_include.m4 src/*.j > war3map.j
8 dnl pjass etc/common.j Blizzard.j war3map.j
9 dnl ```
10 dnl
11 dnl Most importantly, this script will ensure that there is only one globals
12 dnl block. The parsing tool pjass that is used by the community will interpret
13 dnl multiple globals blocks correctly. The game runtime environment itself will
14 dnl not.
15 dnl
16 dnl Optionally, this script will re-arrange and re-order separate Jass script
17 dnl snippets, in accordance with their dependencies. For this feature to work,
18 dnl the snippets themselves must incorporate macros into their source. The
19 dnl snippet may still be parsed normally with pjass or the game runtime
20 dnl environment with the macros included. For details, see the definitions of
21 dnl jass_module and jass_include macros. See src/*.j files in the repository
22 dnl for example usage of the preprocessor macros in Jass script snippets.
23 dnl
24 define(`jass_divert_globals',
25 `define(`globals', `divert(0)divert(1)')define(`endglobals', `divert(0)divert(2)')dnl'
26 )dnl
27 define(`jass_undivert_globals',
28 `undefine(`globals')undefine(`endglobals')dnl'
29 )dnl
30 dnl Divert globals to be re-inserted after all input was processed.
31 jass_divert_globals()dnl
32 dnl
33 dnl jass_module macro should be used in the file that defines the module.
34 dnl A module is a Jass script snippet in a single file that pjass should parse
35 dnl successfully.
36 dnl
37 dnl When Jass module is declared, check if it was already declared previously.
38 dnl Given the module was already declared, skip the contents of the file,
39 dnl and stop diverting globals.
40 dnl Given the module is yet unknown, then declare the module,
41 dnl include the content normally, and resume to divert globals.
42 dnl
43 dnl (Note, to be frank, I am not entirely sure why toggling globals is needed
44 dnl here, but it certainly is needed. Probably has something to do with
45 dnl diversions in the definition of the offending macro.)
46 dnl
47 define(`jass_module',
48 `ifdef(`$1',
49 `skip `$1' jass_undivert_globals()divert(-1)',
50 `module `$1' define($1, 1)jass_divert_globals()'
51 )dnl'
52 )dnl
53 dnl
54 dnl jass_include macro should be used to declare dependency of a module,
55 dnl on distinct another module.
56 dnl
57 dnl When Jass dependency is declared, check if the required module
58 dnl was already included.
59 dnl Given the module was already declared as included,
60 dnl then do nothing.
61 dnl Given the module was not yet included,
62 dnl then include it and declare it to be included,
63 dnl to inform the rest of the script that it mustn't be duplicated.
64 dnl dnl
65 define(`jass_include',
66 `ifdef(`$1',
67 `requires $2',
68 `insert `$1' include($2)define(`$1', 1)'
69 )dnl'
70 )dnl
71 dnl
72 dnl Divert functions to be re-inserted after all input was processed.
73 divert(2)dnl
74 dnl
75 dnl After all input was processed, undivert globals and functions,
76 dnl to be re-inserted in a valid order.
77 m4wrap(dnl
78 `divert(0)undefine(`globals')undefine(`endglobals')dnl
79 globals
80 undivert(1)dnl
81 endglobals
82 undivert(2)dnl'
83 )dnl
File src/war3map.m4 deleted (index 8f35e87..0000000)
1 define(globals, `divert(0)divert(1)')dnl # Cut and paste 'globals' blocks
2 define(endglobals, `divert(0)divert(2)')dnl
3 divert(2)dnl
4 dnl # WARNING: included files must never contain the tilde glyph,
5 dnl # otherwise this m4 script produces malformed *.j snippet
6 include(`src/spell.j')dnl
7 include(`src/abla.j')dnl
8 include(`src/user.j')dnl
9 include(`src/herotoken.j')dnl
10 include(`src/altar.j')dnl
11 include(`src/revive.j')dnl
12 include(`src/defeat.j')dnl
13 include(`src/victory.j')dnl
14 include(`src/main.j')dnl
15 include(`src/config.j')dnl
16 divert(0)dnl
17 undefine(`globals')dnl # Leave 'globals' token as it is
18 undefine(`endglobals')dnl # Leave 'endglobals' token as it is
19
20 globals
21 undivert(1)
22 endglobals
23
24 undivert(2)
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/vrtc/honeydew

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/vrtc/honeydew

Clone this repository using git:
git clone git://git.rocketgit.com/user/vrtc/honeydew

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main