Skip to content

Commit

Permalink
Auto remove quotes of a zone name if it has some
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgRottensteiner committed Apr 24, 2019
1 parent 76897ff commit e54187b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@
/Sample Projects/MacroTest/macro_set_var.prg
/OtherAssemblersDoc/64er_sonderheft_21 (1).pdf
*.dump
/Sample Projects/MacroTest/zones_with_quotes.prg
16 changes: 15 additions & 1 deletion C64Models/Parser/ASMFileParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7789,7 +7789,8 @@ private string[] PreProcess( string[] Lines, string ParentFilename, ProjectConfi
}
else
{
m_CurrentZoneName = lineTokenInfos[1].Content;
m_CurrentZoneName = DeQuote( lineTokenInfos[1].Content );

zoneToken = lineTokenInfos[1];
}
info.Zone = m_CurrentZoneName;
Expand Down Expand Up @@ -8626,6 +8627,19 @@ private string[] PreProcess( string[] Lines, string ParentFilename, ProjectConfi



private string DeQuote( string Content )
{
if ( ( Content.StartsWith( "\"" ) )
&& ( Content.EndsWith( "\"" )
&& ( Content.Length >= 2 ) ) )
{
return Content.Substring( 1, Content.Length - 2 );
}
return Content;
}



private bool MatchesMacroByType( string Token, MacroInfo.MacroType Type )
{
string upToken = Token.ToUpper();
Expand Down
Binary file modified Sample Projects/MacroTest/MacroTest.c64
Binary file not shown.
Binary file modified Sample Projects/MacroTest/MacroTest.s64
Binary file not shown.
8 changes: 8 additions & 0 deletions Sample Projects/MacroTest/zones_with_quotes.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* = $0801


!zone "start here"

!basic

rts

0 comments on commit e54187b

Please sign in to comment.