Skip to content

Commit daa6c6e

Browse files
Update to new full-moon version v1.1.1 (#854)
* Update to new full-moon version * simplify err message * fix token * Support Lua version customisation * compile full moon with release optimisations * Update to Boxed anonymous function * Add proper handling for shebang * Set default lua version to all features, to make it easier to get started Means its technically not a breaking change * Handle left associativity of type unions / intersections * Update callback hanging snapshot This formatting is actually correct - we don't have type pack unions, so we should be hanging at the union type after the return * Support LuaJIT as a separate syntax option * Rename config option from `lua_version` to `syntax` * Fix tests and re-enable large example in debug mode * Use released full moon v1.1.0 * Add command line option to configure syntax and update changelog * Bump full-moon to 1.1.1 * Fix compilation for luau * Handle access modifier in type array and tables * Handle new type info and union set up Somewhat ugly code, designed to ensure there is snapshot diff. But, the code can be made nicer in #910 * Cleanup * Fix verify_ast for luajit * Fix wasm build on CI * Update changelog about luajit
1 parent cfc5d33 commit daa6c6e

File tree

23 files changed

+1018
-812
lines changed

23 files changed

+1018
-812
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ jobs:
2121
- name: Test (Luau)
2222
run: cargo test --features luau
2323

24-
# TODO: ideally this step isn't needed, but we have to gate some tests behind release mode
25-
# we do this to ensure they still run in CI
26-
# https://github.com/Kampfkarren/full-moon/issues/140
27-
test_luau_release:
28-
runs-on: ubuntu-latest
29-
steps:
30-
- uses: actions/checkout@v4
31-
- name: Test (Luau - Release mode)
32-
run: cargo test --features luau --release
33-
3424
test_lua52:
3525
runs-on: ubuntu-latest
3626
steps:
@@ -52,14 +42,21 @@ jobs:
5242
- name: Test (Lua 5.4)
5343
run: cargo test --features lua54
5444

45+
test_luajit:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Test (LuaJIT)
50+
run: cargo test --features luajit
51+
5552
test_wasm:
5653
runs-on: ubuntu-latest
5754
steps:
5855
- uses: actions/checkout@v4
5956
- name: Test Build (wasm)
6057
run: |
6158
rustup target add wasm32-unknown-unknown
62-
cargo check --target wasm32-unknown-unknown
59+
cargo check --target wasm32-unknown-unknown --features luau,lua52,lua53,lua54,luajit
6360
6461
test_wasm_build:
6562
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
sudo apt install ${{ matrix.linker }}
6868
6969
- name: Build Binary (All features)
70-
run: cargo build --verbose --locked --release --features lua52,lua53,lua54,luau --target ${{ matrix.cargo-target }}
70+
run: cargo build --verbose --locked --release --features lua52,lua53,lua54,luau,luajit --target ${{ matrix.cargo-target }}
7171
env:
7272
CARGO_TARGET_DIR: output
7373

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Added runtime syntax configuration option `syntax` to help handle ambiguous syntax. By default, StyLua builds and runs with a parser to handle all Lua versions. However, the syntax of some Lua versions conflict with eachother: most notably, Lua 5.2+ goto label syntax `::label::` and Luau type assertion operator `::`. This option allows choosing what syntax to parse, to handle these conflicts. ([#407](https://github.com/JohnnyMorganz/StyLua/issues/407))
1213
- Added configuration option `space_after_function_names` to specify whether to include a space between a function name and parentheses ([#839](https://github.com/JohnnyMorganz/StyLua/issues/839))
1314

15+
### Changed
16+
17+
- Update internal Lua parser version (full-moon) to v1.1.0. This includes parser performance improvements. ([#854](https://github.com/JohnnyMorganz/StyLua/issues/854))
18+
- LuaJIT is now separated from Lua52, and is available in its own feature and syntax flag
19+
1420
### Fixed
1521

1622
- Fixed formatting of method call chain when there is a comment between the colon token `:` and the function name ([#890](https://github.com/JohnnyMorganz/StyLua/issues/890))

0 commit comments

Comments
 (0)