Skip to content

Commit 6514aa8

Browse files
committed
q
Signed-off-by: Roman Lebedev <lebedev.ri@gmail.com>
1 parent d924099 commit 6514aa8

File tree

90 files changed

+8364
-6050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+8364
-6050
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ members = [
1616
"src/memory/fixed_length_load",
1717
"src/memory/variable_length_load",
1818
"src/metadata/camerasxml_parser",
19+
"src/metadata/xmltokendesparsifier",
20+
"src/metadata/xmltokenizer",
21+
"src/metadata/xmlparser",
1922
"src/misc/md5",
2023
"src/std",
2124
"src/std/ndslice",

src/metadata/camerasxml_parser/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ license.workspace = true
1313
workspace = true
1414

1515
[dependencies]
16-
proc-macro2 = { version = "1.0", default-features = false, features = [] }
17-
syn = { version = "2.0", default-features = false, features = ["parsing", "extra-traits"] }
16+
rawspeed-metadata-xmlparser = { path = "../xmlparser" }
1817

1918
[dev-dependencies]
2019

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,13 @@
1-
use super::*;
2-
3-
#[derive(Debug, PartialEq, Eq)]
4-
struct MaybeId {
5-
pub value: Option<id_attr::Id>,
6-
}
7-
8-
impl syn::parse::Parse for MaybeId {
9-
fn parse(input: syn::parse::ParseStream<'_>) -> syn::parse::Result<Self> {
10-
if input.peek(kw::id) {
11-
return Ok(Self {
12-
value: Some(input.parse()?),
13-
});
14-
}
15-
Ok(Self { value: None })
16-
}
17-
}
18-
19-
#[derive(Debug, PartialEq, Eq)]
20-
pub(crate) struct Alias {
21-
pub start_lt_token: syn::Token![<],
22-
pub start_token: kw::Alias,
23-
pub id: MaybeId,
24-
pub start_gt_token: syn::Token![>],
25-
pub value: VerbatimStr,
26-
pub end_lt_token: syn::Token![<],
27-
pub end_slash_token: syn::Token![/],
28-
pub end_token: kw::Alias,
29-
pub end_gt_token: syn::Token![>],
30-
}
31-
32-
impl syn::parse::Parse for Alias {
33-
fn parse(input: syn::parse::ParseStream<'_>) -> syn::parse::Result<Self> {
34-
let lookahead = input.lookahead1();
35-
if !lookahead.peek(syn::Token![<]) {
36-
return Err(lookahead.error());
37-
}
38-
Ok(Self {
39-
start_lt_token: input.parse()?,
40-
start_token: input.parse()?,
41-
id: input.parse()?,
42-
start_gt_token: input.parse()?,
43-
value: input.parse()?,
44-
end_lt_token: input.parse()?,
45-
end_slash_token: input.parse()?,
46-
end_token: input.parse()?,
47-
end_gt_token: input.parse()?,
48-
})
1+
use super::BodyStr;
2+
use super::id_attr;
3+
use super::xmlparser;
4+
5+
impl_elt_with_body_matcher!(
6+
struct Alias<'a> {
7+
id: Option<id_attr::Id<'a>>,
8+
value: BodyStr<'a>,
499
}
50-
}
10+
);
5111

5212
#[cfg(test)]
5313
mod tests;

0 commit comments

Comments
 (0)