2018-04-12 23:07:37 +00:00
|
|
|
[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"
|
2018-04-12 23:07:37 +00:00
|
|
|
authors = ["Sergio Benitez <sb@sergio.bz>"]
|
|
|
|
description = "Procedural macros for the Rocket web framework."
|
2020-10-21 11:54:24 +00:00
|
|
|
documentation = "https://api.rocket.rs/master/rocket_codegen/"
|
2018-04-12 23:07:37 +00:00
|
|
|
homepage = "https://rocket.rs"
|
|
|
|
repository = "https://github.com/SergioBenitez/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"
|
2019-06-13 01:59:25 +00:00
|
|
|
edition = "2018"
|
2018-04-12 23:07:37 +00:00
|
|
|
|
|
|
|
[lib]
|
|
|
|
proc-macro = true
|
|
|
|
|
|
|
|
[dependencies]
|
2018-09-20 04:47:58 +00:00
|
|
|
indexmap = "1.0"
|
2019-09-05 22:43:57 +00:00
|
|
|
quote = "1.0"
|
2021-05-21 16:13:47 +00:00
|
|
|
syn = { version = "1.0.72", features = ["full", "visit", "visit-mut", "extra-traits"] }
|
|
|
|
proc-macro2 = "1.0.27"
|
2021-05-26 09:26:11 +00:00
|
|
|
devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "f2431b" }
|
2021-05-21 16:13:47 +00:00
|
|
|
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"
|
2020-02-15 11:43:47 +00:00
|
|
|
glob = "0.3"
|
2018-08-07 02:58:07 +00:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2021-05-26 09:26:11 +00:00
|
|
|
rocket = { version = "0.5.0-dev", path = "../lib", features = ["json"] }
|
2020-07-20 22:02:10 +00:00
|
|
|
version_check = "0.9"
|
|
|
|
trybuild = "1.0"
|
2021-03-27 01:38:17 +00:00
|
|
|
time = "0.2.11"
|