2018-04-12 23:07:37 +00:00
|
|
|
[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"
|
2018-04-12 23:07:37 +00:00
|
|
|
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/"
|
2018-04-12 23:07:37 +00:00
|
|
|
homepage = "https://rocket.rs"
|
2023-11-21 15:29:44 +00:00
|
|
|
repository = "https://github.com/rwf2/Rocket"
|
2018-06-03 17:39:32 +00:00
|
|
|
readme = "../../README.md"
|
2018-04-12 23:07:37 +00:00
|
|
|
keywords = ["rocket", "web", "framework", "code", "generation"]
|
2020-06-04 05:36:42 +00:00
|
|
|
license = "MIT OR Apache-2.0"
|
2022-03-19 18:25:24 +00:00
|
|
|
edition = "2021"
|
2023-12-14 01:49:05 +00:00
|
|
|
rust-version = "1.64"
|
2018-04-12 23:07:37 +00:00
|
|
|
|
|
|
|
[lib]
|
|
|
|
proc-macro = true
|
|
|
|
|
|
|
|
[dependencies]
|
2023-10-10 00:03:21 +00:00
|
|
|
indexmap = "2"
|
2019-09-05 22:43:57 +00:00
|
|
|
quote = "1.0"
|
2023-03-23 02:30:26 +00:00
|
|
|
syn = { version = "2.0", features = ["full", "visit", "visit-mut", "extra-traits"] }
|
2023-12-14 01:49:05 +00:00
|
|
|
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"
|
2023-09-20 22:33:54 +00:00
|
|
|
version_check = "0.9"
|
2020-02-15 11:43:47 +00:00
|
|
|
glob = "0.3"
|
2018-08-07 02:58:07 +00:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2022-05-09 10:40:34 +00:00
|
|
|
rocket = { path = "../lib", features = ["json", "msgpack"] }
|
2021-08-20 02:42:18 +00:00
|
|
|
time = { version = "0.3", features = ["macros"] }
|
2022-02-16 18:26:24 +00:00
|
|
|
pretty_assertions = "1"
|
2020-07-20 22:02:10 +00:00
|
|
|
version_check = "0.9"
|
|
|
|
trybuild = "1.0"
|