Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Get rid of peek_next_token in declarator() #507

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/data/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ mod tests {
"struct s",
];
for ty in types.iter() {
let printed_type_name =
analyze(*ty, Parser::type_name, |a, Locatable { data, location }| {
PureAnalyzer::parse_typename_test(a, data, location)
})
let analyze_func = |a: &mut PureAnalyzer, (Locatable { data, location }, _)| {
PureAnalyzer::parse_typename_test(a, data, location)
};
let printed_type_name = analyze(*ty, |p| Parser::type_name(p, &[]), analyze_func)
.unwrap()
.to_string();

Expand Down
4 changes: 3 additions & 1 deletion src/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ impl TryFrom<u32> for Radix {
}
}

/*
#[cfg(test)]
mod tests {
use crate::analyze::test::analyze;
Expand All @@ -103,11 +104,12 @@ mod tests {
"struct s",
];
for ty in types.iter() {
let parsed_ty = analyze(ty, Parser::type_name, |a, b| {
let parsed_ty = analyze(ty, |x| Parser::type_name(x, &[]), |a, (b, _)| {
a.parse_typename_test(b.data, b.location)
})
.unwrap();
assert_eq!(&parsed_ty.to_string(), *ty);
}
}
}
*/
Loading