-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solve year-suffix / no-date interaction #137
Conversation
Test results (failure; full results): 4 regressions, 2 new passing testsregression: csl_test_suite::variables_TitleShortOnShortTitleNoTitleCondition.txt
My Long Title 1 has title-short
My Long Title 2 does not have title-short
-[CSL STYLE ERROR: reference with no printed form.]
+does not have title-short
regression: csl_test_suite::bugreports_ChicagoAuthorDateLooping.txt
-(Manstein 1982; [CSL STYLE ERROR: reference with no printed form.]; [CSL STYLE ERROR: reference with no printed form.])
+(Manstein 1982; Anon.; Anon.)
regression: csl_test_suite::bugreports_DoubleEncodedAngleBraces.txt
regression: csl_test_suite::bugreports_SingleQuoteXml.txt
-[[CSL STYLE ERROR: reference with no printed form.] ; O A. "hello" <i>Book Title</i>]
+[Cite with a composer ; O A. "hello" <i>Book Title</i>]
added passing tests:
|
delete 'recompute queueing node' log
Fixes ref-ir mismatch in bugreports_ByBy.txt
You can see how the issue might apply to the GroupVars promote_plain()'s match self { Plain | Important => Important, _ => self }
Test results (success; full results): 2 new passing testsadded passing tests:
|
Test results (success; full results): 2 new passing testsadded passing tests:
|
if added_suffix { | ||
tree.recompute_group_vars(); | ||
return; | ||
} | ||
|
||
// Then attempt to do it for the ones that are embedded in date output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicit year suffixes weren't recomputing the tree's groupvars, only implicit ones were.
let gv = if let csl::TextTermSelector::Simple(csl::SimpleTermSelector::Misc( | ||
csl::MiscTerm::NoDate, | ||
_, | ||
)) = term_selector | ||
{ | ||
GroupVars::Important // Make this Important (same for element.rs) to have no-date act as a variable | ||
} else { | ||
GroupVars::Plain | ||
}; | ||
(RefIR::Edge(content), gv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we make the no date
term behave like a variable
@@ -120,7 +120,7 @@ impl Disambiguation<Markup> for Element { | |||
let gv = GroupVars::rendered_if(edge.is_some()); | |||
return (RefIR::Edge(edge), gv); | |||
} else { | |||
return (RefIR::Edge(None), GroupVars::Plain); | |||
return (RefIR::Edge(None), GroupVars::Missing); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we remove the special case for YearSuffix
As discussed in andras-simonyi/citeproc-el#70 (comment)
This makes the "no date" term behave like a variable for group suppression. It also makes the GroupVars code work less by accident and more on purpose.