Allow leading whitespace in .sym65 comments

We allow empty lines and lines that begin with ';' in .sym65.  Lines
with nothing but whitespace, or comments with leading whitespace,
caused a warning.  It can be aesthetically nice to line up the start
of comments, and lines with pointless whitespace aren't problematic,
so we now allow these without complaint.

Added some samples to the 20170-external-symbols data file.  No
change to the test output.
This commit is contained in:
Andy McFadden 2021-10-24 13:46:05 -07:00
parent 6e9ff395d2
commit 236cf1d4a3
2 changed files with 11 additions and 2 deletions

View File

@ -141,8 +141,9 @@ namespace SourceGen {
int lineNum = 0;
foreach (string line in lines) {
lineNum++; // first line is line 1, says Vim and VisualStudio
if (string.IsNullOrEmpty(line) || line[0] == ';') {
// ignore
string trimLine = line.Trim();
if (string.IsNullOrEmpty(trimLine) || trimLine[0] == ';') {
// all whitespace, or just a comment; ignore
} else if (line[0] == '*') {
if (line.StartsWith(TAG_CMD)) {
tag = ParseTag(line);

View File

@ -121,3 +121,11 @@ TooLong @ $c0f8 $a
*MULTI_MASK $ffff $ffff $fffff ;range
*MULTI_MASK
; The following lines have nothing but whitespace.
;Comment with leading spaces.
;leading tab