lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Implement tool to check sorting of lists, etc.


From: Mark Polesky
Subject: [PATCH] Implement tool to check sorting of lists, etc.
Date: Sun, 26 Jul 2009 21:39:09 -0700 (PDT)

Hey everyone, here's my latest attempt at an idea I had a
while ago. The idea was to find a way to quickly check if
certain lists and alists appear in order in the source code
itself. This will help to keep our code organized. I suppose
there are other ways to do it, but for the way I ended up
designing it, here's how a developer might use it:

1) compile (new file) check-sorting.ly.
2) look at the console output.
3) make changes to files if necessary.

Note that this will identify some "problems" that should be
ignored. For example, the all-internal-grob-properties list
in define-grob-properties.scm appears to have some out-of-
order properties. But if you look at the source, you will
see that they're intentionally arranged in three groups:

   grobs & grob arrays
   other
   ancient notation

But otherwise, I think this can be a useful time-saver for
future code-janitors. In the attached patch, I've tested
eight lists/alists from 6 different scm files as a
demonstration. It shouldn't be too much trouble to add more.

Can someone test this and let me know what they think? Feel
free to intentionally move things out of order in the files
affected to see how it works.

Also, is there a more preferable way to do it?

Thanks!
- Mark

ps. example output...

----------------------------------------

define-context-properties.scm:
* all-user-translation-properties (list)
  + Properly sorted.

* all-internal-translation-properties (list)
  + Properly sorted.

----------------------------------------

define-grob-properties.scm:
* all-user-grob-properties (list)
  + Properly sorted.

* all-internal-grob-properties (list)
  + All elements appear only once.
  - The following pairs of consecutive
    elements are out of order:
      Y-common   adjacent-pure-heights
      use-breve-rest   add-cauda

----------------------------------------

define-grobs.scm:
* all-grob-descriptions (alist)
  + All grob descriptions are pairs.
  + All meta fields are in proper tail position.
  - The following grobs have duplicate properties:
      TextScript: (direction)
  + All grobs are in order.
  - The properties of the following
    grobs are not in order.
      BarLine
      SpanBar
  + All grob interfaces are in order.

----------------------------------------

define-music-display-methods.scm:
* post-event-list (list)
  + Properly sorted.

----------------------------------------

define-music-properties.scm:
* all-music-properties (list)
  + Properly sorted.

----------------------------------------

define-music-types.scm:
* music-descriptions (alist)
  + Properly sorted.



      

Attachment: 0001-Implement-tool-to-check-sorting-of-lists-etc.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]