Rocket/core/codegen/Cargo.toml

38 lines
992 B
TOML
Raw Permalink Normal View History

[package]
2018-10-22 06:53:09 +00:00
name = "rocket_codegen"
2023-11-18 10:30:50 +00:00
version = "0.6.0-dev"
authors = ["Sergio Benitez <sb@sergio.bz>"]
description = "Procedural macros for the Rocket web framework."
2023-11-18 10:30:50 +00:00
documentation = "https://api.rocket.rs/master/rocket_codegen/"
homepage = "https://rocket.rs"
repository = "https://github.com/rwf2/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.75"
[lints]
workspace = true
[lib]
proc-macro = true
[dependencies]
indexmap = "2"
quote = "1.0"
2023-03-23 02:30:26 +00:00
syn = { version = "2.0", features = ["full", "visit", "visit-mut", "extra-traits"] }
proc-macro2 = "1.0.60"
2023-03-23 02:30:26 +00:00
devise = "0.4"
2023-11-18 10:30:50 +00:00
rocket_http = { version = "0.6.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"
version_check = "0.9"
glob = "0.3"
[dev-dependencies]
rocket = { path = "../lib", features = ["json", "msgpack"] }
time = { version = "0.3", features = ["macros"] }
pretty_assertions = "1"
version_check = "0.9"
trybuild = "1.0"