-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proper README, updated docs, added .travis.yml.
- Loading branch information
1 parent
7ebe2ce
commit aca384a
Showing
9 changed files
with
200 additions
and
14 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,19 @@ | ||
language: rust | ||
sudo: false | ||
rust: | ||
- 1.15.0 | ||
- stable | ||
- beta | ||
- nightly | ||
os: | ||
- linux | ||
- osx | ||
matrix: | ||
allow_failures: | ||
- rust: nightly | ||
env: | ||
global: | ||
- LD_LIBRARY_PATH: /usr/local/lib | ||
script: | ||
- cargo test -p hexf-parse -v | ||
- cargo test -v |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ authors = ["Kang Seonghoon <[email protected]>"] | |
|
||
description = "Hexadecimal float support for Rust" | ||
homepage = "https://github.com/lifthrasiir/hexf" | ||
#documentation = "https://docs.rs/hexf/" | ||
documentation = "https://docs.rs/hexf/" | ||
repository = "https://github.com/lifthrasiir/hexf" | ||
readme = "README.md" | ||
license = "CC0-1.0" | ||
|
@@ -14,7 +14,7 @@ license = "CC0-1.0" | |
members = ["parse/", "impl/"] | ||
|
||
[dependencies] | ||
proc-macro-hack = "0.3" | ||
hexf-parse = { path = "parse/" } | ||
hexf-impl = { path = "impl/" } | ||
proc-macro-hack = "0.3.3" | ||
hexf-parse = { version = "0.1.0", path = "parse/" } | ||
hexf-impl = { version = "0.1.0", path = "impl/" } | ||
|
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 |
---|---|---|
|
@@ -5,15 +5,15 @@ authors = ["Kang Seonghoon <[email protected]>"] | |
|
||
description = "Hexadecimal float support for Rust (auxiliary crate; see also hexf)" | ||
homepage = "https://github.com/lifthrasiir/hexf" | ||
#documentation = "https://docs.rs/hexf/" | ||
documentation = "https://docs.rs/hexf/" | ||
repository = "https://github.com/lifthrasiir/hexf" | ||
license = "CC0-1.0" | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
proc-macro-hack = "0.3" | ||
proc-macro-hack = "0.3.3" | ||
syn = "0.11" | ||
hexf-parse = { path = "../parse/" } | ||
hexf-parse = { version = "0.1.0", path = "../parse/" } | ||
|
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 |
---|---|---|
|
@@ -3,9 +3,9 @@ name = "hexf-parse" | |
version = "0.1.0" | ||
authors = ["Kang Seonghoon <[email protected]>"] | ||
|
||
description = "Hexadecimal float support for Rust (auxiliary crate; see also hexf)" | ||
description = "Parses hexadecimal floats (see also hexf)" | ||
homepage = "https://github.com/lifthrasiir/hexf" | ||
#documentation = "https://docs.rs/hexf/" | ||
documentation = "https://docs.rs/hexf-parse/" | ||
repository = "https://github.com/lifthrasiir/hexf" | ||
license = "CC0-1.0" | ||
|
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 |
---|---|---|
@@ -1,10 +1,44 @@ | ||
//! Hexadecimal float support for Rust 1.15 or later. | ||
//! | ||
//! ```rust | ||
//! #[macro_use] extern crate hexf; | ||
//! | ||
//! # fn main() { | ||
//! assert_eq!(hexf32!("0x1.99999ap-4"), 0.1f32); | ||
//! assert_eq!(hexf64!("0x1.999999999999ap-4"), 0.1f64); | ||
//! # } | ||
//! ``` | ||
|
||
#[macro_use] extern crate proc_macro_hack; | ||
#[macro_use] #[allow(unused_imports)] extern crate hexf_impl; | ||
extern crate hexf_parse; | ||
|
||
pub use hexf_parse::{ParseHexfError, parse_hexf32, parse_hexf64}; | ||
pub use hexf_impl::*; | ||
#[doc(hidden)] pub use hexf_impl::*; | ||
|
||
proc_macro_expr_decl! { | ||
/// Expands to a `f32` value with given hexadecimal representation. | ||
/// | ||
/// # Example | ||
/// | ||
/// ```rust | ||
/// # #[macro_use] extern crate hexf; fn main() { | ||
/// assert_eq!(hexf32!("0x1.99999ap-4"), 0.1f32); | ||
/// # } | ||
/// ``` | ||
hexf32! => hexf32_impl | ||
} | ||
|
||
proc_macro_expr_decl!(hexf32! => hexf32_impl); | ||
proc_macro_expr_decl!(hexf64! => hexf64_impl); | ||
proc_macro_expr_decl! { | ||
/// Expands to a `f64` value with given hexadecimal representation. | ||
/// | ||
/// # Example | ||
/// | ||
/// ```rust | ||
/// # #[macro_use] extern crate hexf; fn main() { | ||
/// assert_eq!(hexf64!("0x1.999999999999ap-4"), 0.1f64); | ||
/// # } | ||
/// ``` | ||
hexf64! => hexf64_impl | ||
} | ||
|
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