From 219297555928c59133b3009aac36be385b6110d3 Mon Sep 17 00:00:00 2001 From: Charles Reilly Date: Sun, 16 Oct 2022 23:06:43 +0100 Subject: [PATCH] Use ArgListParser in HandlePutBasic --- src/commands.cpp | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/commands.cpp b/src/commands.cpp index c53a8a2..20e1d79 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -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() )