Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1899)

Issue 4951073: Fix 380: Try to auto-detect cyclic references in header fields (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by Reinhold
Modified:
12 years, 7 months ago
Reviewers:
pkx166h, joeneeman, hanwenn
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Fix 380: Try to auto-detect cyclic references in header fields Inside \fromproperty, simply change the props so that all references to the currently interpreted property point to a function that prints out a warning and returns a null markup, while interpreting the contents of the property.

Patch Set 1 #

Patch Set 2 : Fix compilation #

Total comments: 1

Patch Set 3 : Fix property override #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -1 line) Patch
A input/regression/header-cyclic-reference.ly View 1 1 chunk +12 lines, -0 lines 0 comments Download
M scm/define-markup-commands.scm View 1 2 2 chunks +10 lines, -1 line 0 comments Download

Messages

Total messages: 7
pkx166h
Passes make but fails reg test check: see http://code.google.com/p/lilypond/issues/detail?id=380#c15 for details (keeps the noise down ...
12 years, 8 months ago (2011-09-10 10:04:22 UTC) #1
pkx166h
patch 2 passes make and reg tests
12 years, 8 months ago (2011-09-10 10:39:44 UTC) #2
hanwenn
have you thought of fixing this generically instead? You could the hare/tortoise algorithm to detect ...
12 years, 7 months ago (2011-09-13 18:53:55 UTC) #3
joeneeman
http://codereview.appspot.com/4951073/diff/3001/scm/define-markup-commands.scm File scm/define-markup-commands.scm (right): http://codereview.appspot.com/4951073/diff/3001/scm/define-markup-commands.scm#newcode1897 scm/define-markup-commands.scm:1897: (interpret-markup layout (cons (list (list symbol `(,property-recursive-markup symbol))) props) ...
12 years, 7 months ago (2011-09-13 19:46:52 UTC) #4
Reinhold
On 2011/09/13 19:46:52, joeneeman wrote: > http://codereview.appspot.com/4951073/diff/3001/scm/define-markup-commands.scm > File scm/define-markup-commands.scm (right): > > http://codereview.appspot.com/4951073/diff/3001/scm/define-markup-commands.scm#newcode1897 > ...
12 years, 7 months ago (2011-09-14 22:20:42 UTC) #5
Reinhold
On 2011/09/13 18:53:55, hanwenn wrote: > have you thought of fixing this generically instead? > ...
12 years, 7 months ago (2011-09-14 23:28:09 UTC) #6
Reinhold
12 years, 7 months ago (2011-09-15 13:00:46 UTC) #7
On 2011/09/14 23:28:09, Reinhold wrote:
> On 2011/09/13 18:53:55, hanwenn wrote:
> > have you thought of fixing this generically instead?
> > 
> > You could the hare/tortoise algorithm to detect cycles in any markup, and
> could
> > run that on the entry point (not the recursive function) for evaluating
> markups
> > to stencils.
> 
> Actually, I fail to see how I can use the algorithm to detect cycles in
markups.
> First, a markup is a tree and a recursive function rather tan a chained
function
> application, so the algorithm would have to run on each branch. And second,
the
> markup => stencil conversion is done in Text_interface::interpret_markup by
> simply calling the first markup function, which then recursively evaluates all
> its subexpressions.
> We never actually get the intermediate values to run the algorithm. We can
only
> get the intermediate values by evaluating the markup, but then we are already
> inside the loop.

I updated this patch to correctly print out the warning, and also implemented
the hare+tortoise algorithm in patch http://codereview.appspot.com/5027042/

I'd like to apply both, because the general cycle detection is not able to print
useful error messages, while this patch does, although it works only for cyclic
\fromproperty.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b