Skip to content

Commit 6c59566

Browse files
committed
Rewrite parser using typescript factory instead of string concatenation
1 parent bdcb1d4 commit 6c59566

32 files changed

+32741
-36967
lines changed

.github/workflows/check-api-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ jobs:
5757
uses: borales/actions-yarn@v4
5858
with:
5959
cmd: install
60-
- name: npm run rebuild
60+
- name: npm run build
6161
if: env.SKIP_ALL == 0
62-
run: npm run rebuild
62+
run: npm run build
6363
- name: update package version
6464
if: env.SKIP_ALL == 0
6565
run: npm version patch --no-git-tag-version

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
temp/**
2+
3+
# No longer exist, preserved for legacy compat
14
json_parser/runtime-api.json
25
json_parser/prototype-api.json
3-
temp/**
46

57
# Logs
68
logs

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ Primitive types like `uint8` or `nil` are preserved from the docs to better repr
3939

4040
Note that since typescript has a single `number` type, the compiler will **not** prevent things like passing a `float` to a method that expects `uint8` because these are both just `number` types under the hood.
4141

42+
## Lua tables
43+
44+
Various types in the Factorio API are implemented as lua tables, specifically those with a `complex_type` of `dictionary` or `LuaCustomTable`. These types have intentionally been implemented as [Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) types instead of TypescriptToLua's [Lua Table Type](https://typescripttolua.github.io/docs/advanced/language-extensions/#lua-table-types) because `LuaTable`s cannot be instantiated with `{ key1: 'value1', key2: 'value2' }` initializer syntax, and instead repeated calls to `set()` would be required, making initialization of such objects considerably more verbose.
45+
4246
## Lualib
4347

4448
Factorio makes various lua functions available to mods via [LuaLib](https://github.com/wube/factorio-data/tree/master/core/lualib)

0 commit comments

Comments
 (0)