-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace panics with JS exceptions in npm package (#489)
Closes #464
- Loading branch information
1 parent
ba5ea9a
commit 15c34a7
Showing
28 changed files
with
223 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"changelog": minor | ||
--- | ||
|
||
replace panics with JS exceptions in npm package |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 12 additions & 13 deletions
25
crates/solidity/outputs/cargo/crate/src/generated/language.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
crates/solidity/outputs/cargo/crate/src/generated/parser_output.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use semver::Version; | ||
use slang_solidity::{language::Language, syntax::parser::ProductionKind}; | ||
|
||
#[test] | ||
fn unsupported_language_version() { | ||
let version = Version::parse("0.0.0").unwrap(); | ||
let error = Language::new(version).unwrap_err(); | ||
|
||
assert_eq!( | ||
error.to_string(), | ||
"Unsupported Solidity language version '0.0.0'." | ||
); | ||
} | ||
|
||
#[test] | ||
fn invalid_production_version() { | ||
let version = Version::parse("0.4.11").unwrap(); | ||
let language = Language::new(version).unwrap(); | ||
let error = language | ||
.parse(ProductionKind::ConstructorDefinition, "") | ||
.unwrap_err(); | ||
|
||
assert_eq!( | ||
error.to_string(), | ||
"Production 'ConstructorDefinition' is not valid in this version of Solidity." | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#[cfg(test)] | ||
mod cst_output; | ||
#[cfg(test)] | ||
mod errors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.