1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 23:59:41 +02:00

Allow Nyquist header lines to start with $

This commit is contained in:
Paul Licameli 2018-03-01 22:14:20 -05:00
parent ba8e6bd465
commit ad4843621b

View File

@ -1953,26 +1953,35 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
while (!stream.Eof() && stream.IsOk())
{
wxString line = pgm.ReadLine().Trim(false);
if (line.Length() > 1 && line[0] == wxT(';'))
if (line.Length() > 1 &&
// New in 2.3.0: allow magic comment lines to start with $
// The trick is that xgettext will not consider such lines comments
// and will extract the strings they contain
(line[0] == wxT(';') || line[0] == wxT('$')))
{
Parse(line);
// Don't pass this line to the interpreter, so it doesn't get confused
// by $, but pass a blank,
// so that SAL effects compile with proper line numbers
mCmd += wxT('\n');
}
else if (!mFoundType && line.Length() > 0)
else
{
if (line[0] == wxT('(') ||
(line[0] == wxT('#') && line.Length() > 1 && line[1] == wxT('|')))
{
mIsSal = false;
mFoundType = true;
}
else if (line.Upper().Find(wxT("RETURN")) != wxNOT_FOUND)
{
mIsSal = true;
mFoundType = true;
if(!mFoundType && line.Length() > 0) {
if (line[0] == wxT('(') ||
(line[0] == wxT('#') && line.Length() > 1 && line[1] == wxT('|')))
{
mIsSal = false;
mFoundType = true;
}
else if (line.Upper().Find(wxT("RETURN")) != wxNOT_FOUND)
{
mIsSal = true;
mFoundType = true;
}
}
mCmd += line + wxT("\n");
}
// preserve comments so that SAL effects compile with proper line numbers
mCmd += line + wxT("\n");
}
if (!mFoundType && mIsPrompt)
{