Skip to content

Commit

Permalink
#1191 v4 script parser
Browse files Browse the repository at this point in the history
* Implement new flecs script parser

* Implement AST -> string conversion, parser fixes

* Add support for parsing if-else

* Implement new flecs script runtime

* Update testcases

* Fix script resource mgmt issues

* Port to new script variable API

* Cleanup script variable API

* Merge SCRIPT and EXPR addons

* Move script test suites to separate project

* Fix issue in sparse set with ensuring id that skipped generation

* Throw error when providing invalid token for number in expression

* Always call on_set hook for entity kind component

* Fix warnings

* Add script tests for if statements

* Fix more warnings/tests

* Switch CI to use bake master

* Fix CI issue for windows/clang
  • Loading branch information
SanderMertens committed Apr 20, 2024
1 parent ff0f99f commit 705abc4
Show file tree
Hide file tree
Showing 119 changed files with 55,297 additions and 49,059 deletions.
88 changes: 60 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -33,7 +33,7 @@ jobs:

- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -52,7 +52,7 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
cd bake\build-Windows
nmake
cd ..
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand Down Expand Up @@ -354,11 +354,6 @@ jobs:
bake rebuild --strict -D FLECS_CUSTOM_BUILD -D FLECS_META
bake rebuild --strict --cfg release -D FLECS_CUSTOM_BUILD -D FLECS_META
- name: FLECS_EXPR
run: |
bake rebuild --strict -D FLECS_CUSTOM_BUILD -D FLECS_EXPR
bake rebuild --strict --cfg release -D FLECS_CUSTOM_BUILD -D FLECS_EXPR
- name: FLECS_JSON
run: |
bake rebuild --strict -D FLECS_CUSTOM_BUILD -D FLECS_JSON
Expand Down Expand Up @@ -439,7 +434,7 @@ jobs:
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -466,7 +461,7 @@ jobs:
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -485,6 +480,9 @@ jobs:
- name: test meta
run: bake run test/meta -- -j 8

- name: test script
run: bake run test/script -- -j 8

- name: test collections
run: bake run test/collections -- -j 8

Expand Down Expand Up @@ -530,7 +528,7 @@ jobs:
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand Down Expand Up @@ -570,7 +568,7 @@ jobs:
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -592,7 +590,7 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
cd bake\build-Windows
nmake
cd ..
Expand All @@ -610,6 +608,9 @@ jobs:
- name: test meta
run: bake/bake run test\meta -- -j 8

- name: test script
run: bake/bake run test\script -- -j 8

- name: test collections
run: bake/bake run test\collections -- -j 8

Expand All @@ -623,15 +624,19 @@ jobs:
fail-fast: false
matrix:
include:
- { sys: mingw64 }
- { sys: mingw32 }
- { sys: ucrt64 }
- { sys: clang64 }
- { sys: mingw64, cc: gcc, cxx: g++ }
- { sys: mingw32, cc: gcc, cxx: g++ }
- { sys: ucrt64, cc: gcc, cxx: g++ }
- { sys: clang64, cc: clang, cxx: clang++ }

defaults:
run:
shell: msys2 {0}

env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}

steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
Expand All @@ -648,12 +653,12 @@ jobs:
- name: install bake
run: |
cp `which mingw32-make` /usr/bin/make
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-Mingw
bake/bake setup
- name: build flecs
run: bake/bake --strict
run: bake/bake --strict --trace

- name: test core
run: bake/bake run test/core -- -j 8
Expand All @@ -667,6 +672,9 @@ jobs:
- name: test meta
run: bake/bake run test/meta -- -j 8

- name: test script
run: bake/bake run test/script -- -j 8

- name: test collections
run: bake/bake run test/collections -- -j 8

Expand All @@ -686,7 +694,7 @@ jobs:
- uses: actions/checkout@v4
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -710,7 +718,7 @@ jobs:
- uses: actions/checkout@v4
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -734,7 +742,7 @@ jobs:
- uses: actions/checkout@v4
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -758,7 +766,7 @@ jobs:
- uses: actions/checkout@v4
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -769,6 +777,30 @@ jobs:
run: |
bake run test/meta --cfg sanitize -- -j 8
test-sanitized-script:
needs: [ build-linux ]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04 ]

steps:
- uses: actions/checkout@v4
- name: install bake
run: |
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
- name: build flecs
run: bake --strict

- name: run tests
run: |
bake run test/script --cfg sanitize -- -j 8
test-sanitized-collections:
needs: [ build-linux ]
runs-on: ${{ matrix.os }}
Expand All @@ -782,7 +814,7 @@ jobs:
- uses: actions/checkout@v4
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -806,7 +838,7 @@ jobs:
- uses: actions/checkout@v4
- name: install bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
make -C bake/build-$(uname)
bake/bake setup
Expand All @@ -830,7 +862,7 @@ jobs:
- uses: actions/checkout@v4
- name: clone bake
run: |
git clone -b test_params https://github.com/SanderMertens/bake
git clone https://github.com/SanderMertens/bake
- name: build flecs & tests
run: |
Expand Down
Loading

0 comments on commit 705abc4

Please sign in to comment.