Skip to content

Commit

Permalink
Update to new full-moon version v1.1.1 (#854)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
JohnnyMorganz authored Nov 16, 2024
1 parent cfc5d33 commit daa6c6e
Show file tree
Hide file tree
Showing 23 changed files with 1,018 additions and 812 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ jobs:
- name: Test (Luau)
run: cargo test --features luau

# TODO: ideally this step isn't needed, but we have to gate some tests behind release mode
# we do this to ensure they still run in CI
# https://github.com/Kampfkarren/full-moon/issues/140
test_luau_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test (Luau - Release mode)
run: cargo test --features luau --release

test_lua52:
runs-on: ubuntu-latest
steps:
Expand All @@ -52,14 +42,21 @@ jobs:
- name: Test (Lua 5.4)
run: cargo test --features lua54

test_luajit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test (LuaJIT)
run: cargo test --features luajit

test_wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test Build (wasm)
run: |
rustup target add wasm32-unknown-unknown
cargo check --target wasm32-unknown-unknown
cargo check --target wasm32-unknown-unknown --features luau,lua52,lua53,lua54,luajit
test_wasm_build:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
sudo apt install ${{ matrix.linker }}
- name: Build Binary (All features)
run: cargo build --verbose --locked --release --features lua52,lua53,lua54,luau --target ${{ matrix.cargo-target }}
run: cargo build --verbose --locked --release --features lua52,lua53,lua54,luau,luajit --target ${{ matrix.cargo-target }}
env:
CARGO_TARGET_DIR: output

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- 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))
- 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))

### Changed

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

### Fixed

- 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))
Expand Down
Loading

0 comments on commit daa6c6e

Please sign in to comment.