lilypond-devel
[Top][All Lists]
Advanced

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

Re: Don't hardcode a limited set of markup signatures. (issue969046)


From: hanwenn
Subject: Re: Don't hardcode a limited set of markup signatures. (issue969046)
Date: Sat, 01 May 2010 19:56:08 +0000


http://codereview.appspot.com/969046/diff/7001/8002
File lily/lexer.ll (right):

http://codereview.appspot.com/969046/diff/7001/8002#newcode545
lily/lexer.ll:545: // loop will be EXPECT_NO_MORE_ARGS.
wouldnt it be clearer to have a function

  void translate_markup_signature(SCM predicate_list,
     vector<int> expect_tokens);

which generates the [expect_scm, expect_scm, expect_markup] (possibly
with expect_no_more_args) in a vector, and then push the tokens one by
one in the desired order?

Also, I think it is better to not use fall-through switches, as they are
a uncommon and tricky idiom.

I would expect something like

 if(pred == bla("markup?")
   token = EXPECT_MARKUP;
 else if (pred == bla("markup-list?")
   token = EXPECT_MARKUP_LIST;
 else if (pred == bla("scm?")
   token = EXPECT_SCM;

http://codereview.appspot.com/969046/show




reply via email to

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