Skip to content

Commit

Permalink
Use ArgListParser in HandlePutBasic
Browse files Browse the repository at this point in the history
  • Loading branch information
mungre committed Oct 16, 2022
1 parent 4492a69 commit 2192975
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,29 +1598,10 @@ void LineParser::HandlePutFileCommon( bool bText )
/*************************************************************************************************/
void LineParser::HandlePutBasic()
{
string hostFilename = EvaluateExpressionAsString();
string beebFilename = hostFilename;

if ( AdvanceAndCheckEndOfStatement() )
{
// see if there's a second parameter

if ( m_line[ m_column ] != ',' )
{
throw AsmException_SyntaxError_MissingComma( m_line, m_column );
}

m_column++;

beebFilename = EvaluateExpressionAsString();
}

// check this is now the end

if ( AdvanceAndCheckEndOfStatement() )
{
throw AsmException_SyntaxError_InvalidCharacter( m_line, m_column );
}
ArgListParser args(*this);
string hostFilename = args.ParseString();
string beebFilename = args.ParseString().Default(hostFilename);
args.CheckComplete();

if ( GlobalData::Instance().IsSecondPass() &&
GlobalData::Instance().UsesDiscImage() )
Expand Down

0 comments on commit 2192975

Please sign in to comment.