<div dir="ltr">Phab is slow in sending emails, but I have already uploaded one for you. <a href="https://reviews.llvm.org/D24089">https://reviews.llvm.org/D24089</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 31, 2016 at 10:48 AM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">grimar added a comment.<br>
<span class=""><br>
In <a href="https://reviews.llvm.org/D23609#530513" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23609#530513</a>, @ruiu wrote:<br>
<br>
> Obviously, this patch contains duplicate code which does not look good. Let me create a patch based on this to describe what I was trying to say.<br>
<br>
<br>
</span>Actually I think I completely understand what you want to see. Something like below probably.<br>
There are still duplications of messages, and only a part of code can be extracted here with no pain.<br>
I can continue working on that tomorrow if you think it is the right direction.<br>
<br>
  void ScriptParser::<wbr>readVersionScript() {<br>
    StringRef Msg = "anonymous version definition is used in "<br>
                    "combination with other version definitions";<br>
    if (skip("{")) {<br>
      readVersionDeclaration("");<br>
      if (!atEOF())<br>
        setError(Msg);<br>
      return;<br>
    }<br>
<br>
    while (!atEOF() && !Error)<br>
      readNamedVersion();<br>
  }<br>
<br>
  void ScriptParser::<wbr>readNamedVersion() {<br>
    StringRef Msg = "anonymous version definition is used in "<br>
                    "combination with other version definitions";<br>
    StringRef VerStr = next();<br>
    if (VerStr == "{") {<br>
      setError(Msg);<br>
      return;<br>
    }<br>
    expect("{");<br>
    readVersionDeclaration(VerStr)<wbr>;<br>
  }<br>
<br>
  void ScriptParser::readVersion() {<br>
    expect("{");<br>
    if (skip("{")) {<br>
      readVersionDeclaration("");<br>
      expect("}");<br>
      return;<br>
    }<br>
<br>
    while (!Error) {<br>
      readNamedVersion();<br>
      if (peek() == "}")<br>
        break;<br>
    }<br>
    expect("}");<br>
  }<br>
<br>
<br>
<a href="https://reviews.llvm.org/D23609" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23609</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>