Rocket/core/codegen/Cargo.toml

31 lines
918 B
TOML
Raw Normal View History

[package]
2018-10-22 06:53:09 +00:00
name = "rocket_codegen"
2019-05-13 23:18:48 +00:00
version = "0.5.0-dev"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Procedural macros for the Rocket web framework."
documentation = "https://api.rocket.rs/master/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"
2019-06-13 01:59:25 +00:00
edition = "2018"
[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 = { git = "https://github.com/SergioBenitez/Devise.git", rev = "df00b5" }
rocket_http = { version = "0.5.0-dev", 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]
2019-05-13 23:18:48 +00:00
rocket = { version = "0.5.0-dev", path = "../lib" }
version_check = "0.9"
trybuild = "1.0"