Skip to content

Commit

Permalink
Fixed Roblox standard library not including Lua 5.1 globals the first…
Browse files Browse the repository at this point in the history
… time you ran selene.
  • Loading branch information
Kampfkarren committed Nov 14, 2019
1 parent 84dd72e commit 5feef74
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## Unreleased

## [0.4.1] - 2019-11-13
### Fixed
- Fixed Roblox standard library not including Lua 5.1 globals the first time you ran selene.

## [0.4.0] - 2019-11-13
### Added
- A Roblox standard library can now be generated by simply having `std = "roblox"` in your configuration and running selene. If it does not exist, it will create one. This can also be initiated manually with `selene generate-roblox-std`.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion selene/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "selene"
version = "0.4.0"
version = "0.4.1"
license = "MPL-2.0"
authors = ["Kampfkarren <[email protected]>"]
description = "A blazing-fast modern Lua linter written in Rust"
Expand Down
9 changes: 2 additions & 7 deletions selene/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,8 @@ fn read<R: Read>(checker: &Checker<toml::value::Value>, filename: &Path, mut rea
},
);

codespan_reporting::term::emit(
&mut stdout,
&config,
&files,
&diagnostic,
)
.expect("couldn't emit to codespan");
codespan_reporting::term::emit(&mut stdout, &config, &files, &diagnostic)
.expect("couldn't emit to codespan");
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions selene/src/roblox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ impl RobloxGenerator {
)
.map_err(GenerateError::Io)?;

self.std.extend(
StandardLibrary::from_name(&self.std.meta.as_ref().unwrap().base.as_ref().unwrap())
.unwrap(),
);

Ok((bytes, self.std))
}

Expand Down

0 comments on commit 5feef74

Please sign in to comment.