Rocket/core/codegen/Cargo.toml

34 lines
987 B
TOML
Raw Normal View History

[package]
2018-10-22 06:53:09 +00:00
name = "rocket_codegen"
version = "0.5.0-rc.1"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Procedural macros for the Rocket web framework."
documentation = "https://api.rocket.rs/v0.5-rc/rocket_codegen/"
homepage = "https://rocket.rs"
repository = "https://github.com/SergioBenitez/Rocket"
2018-06-03 17:39:32 +00:00
readme = "../../README.md"
keywords = ["rocket", "web", "framework", "code", "generation"]
license = "MIT OR Apache-2.0"
2022-03-19 18:25:24 +00:00
edition = "2021"
rust-version = "1.56"
[lib]
proc-macro = true
[dependencies]
2018-09-20 04:47:58 +00:00
indexmap = "1.0"
quote = "1.0"
syn = { version = "1.0.72", features = ["full", "visit", "visit-mut", "extra-traits"] }
proc-macro2 = "1.0.27"
devise = "0.3.1"
rocket_http = { version = "0.5.0-rc.1", path = "../http/" }
Revamp codegen, fixing inconscpicuous bugs. This commit completely revamps the way that codegen handles route URI "parameters". The changes are largely internal. In summary, codegen code is better organized, better written, and less subject to error. There are three breaking changes: * `path` is now `uri` in `route` attribute: `#[route(GET, path = "..")]` becomes `#[route(GET, uri = "..")]`. * the order of execution for path and query guards relative to each-other is now unspecified * URI normalization now normalizes the query part as well. Several error messages were improved. A couple of bugs were fixed: * Prior to this commit, Rocket would optimistically try to parse every segment of a URI as an ident, in case one was needed in the future. A bug in rustc results in codegen "panicking" if the segment couldn't _lex_ as an ident. This panic didn't manifest until far after expansion, unfortunately. This wasn't a problem before as we only allowed ident-like segments (ASCII), but now that we allow any UTF-8, the bug surfaced. This was fixed by never attempting to parse non-idents as idents. * Prior to this commit, it was impossible to generate typed URIs for paths that ignored path parameters via the recently added syntax `<_>`: the macro would panic. This was fixed by, well, handling these ignored parameters. Some minor additions: * Added `RawStr::find()`, expanding its `Pattern`-based API. * Added an internal mechanism to dynamically determine if a `UriPart` is `Path` or `Query`.
2021-03-02 12:01:33 +00:00
unicode-xid = "0.2"
glob = "0.3"
[dev-dependencies]
rocket = { version = "0.5.0-rc.1", path = "../lib", features = ["json", "msgpack"] }
time = { version = "0.3", features = ["macros"] }
pretty_assertions = "1"
version_check = "0.9"
trybuild = "1.0"