just a few more parser fixes

This commit is contained in:
marketideas 2019-11-19 09:22:27 -08:00
parent b391c9b729
commit 572bdd5879
4 changed files with 16 additions and 13 deletions

15
asm.cpp
View File

@ -174,7 +174,7 @@ void CLASS::print(uint32_t lineno)
{
pcol += printf("%c", comment[cc]);
comct++;
if ((comment[cc] <= ' ') && (pcol >= (commentcol + savpcol + 10)))
if ((comment[cc] <= ' ') && (pcol >= (commentcol + savpcol + 20)))
{
printf("\n");
pcol = 0;
@ -416,6 +416,11 @@ void CLASS::set(std::string line)
restofline = Poco::trim(tline.substr(i, tline.length())) + " ";
//printf("ROL: |%s|\n",restofline.c_str());
if (restofline=="")
{
i=l;
break;
}
strs.clear();
x = 0;
try
@ -478,9 +483,7 @@ void CLASS::set(std::string line)
i = l;
if (!match)
{
opcode = ":::"; // let assembler figure out this is a bad opcode
// SGQ maybe error here
//printf("---No Match %s\n", restofline.c_str());
// if you are here, there probably isn't an operand and/or comment after opcode
}
}
break;
@ -491,7 +494,7 @@ void CLASS::set(std::string line)
if (x > 1)
{
// SGQ M32 syntax
#if 0
#if 1
while ((x > 1) && (lable[x - 1] == ':'))
{
lable = lable.substr(0, x - 1);
@ -1419,7 +1422,7 @@ void CLASS::initpass(void)
merlinerrors = getBool("asm.merlinerrors", true);
trackrep = getBool("asm.trackrep", false);
merlincompat = getBool("asm.merlincompatible", true);
//merlincompat = getBool("asm.merlincompatible", true);
allowdup = getBool("asm.allowduplicate", true);
skiplist = false;

2
asm.h
View File

@ -335,7 +335,7 @@ public:
bool casesen;
bool showmx;
bool trackrep;
bool merlincompat;
//bool merlincompat;
bool merlinerrors;
bool allowdup;
uint8_t mx;

View File

@ -6,6 +6,7 @@ logfile=mylog.log
[option]
debug=1
nocolor=false
syntax=merlin
;debug must be an integer. Code can use this as a level
[application]
@ -26,10 +27,9 @@ startmx=3
lst=true
; can be M6502, M65C02, M65816
cpu=M65816
trackrep=true
trackrep=false
allowduplicate=true
merlinerrors=false
merlincompatible=true
merlinerrors=true
symcolumns=3
[reformat]

View File

@ -307,7 +307,7 @@ myQuit
sbc ^$012345
sbc |$012345
asll $1234
;asll $1234
lda <$fff0+24 ;zp
lda >$fff0+24 ;ABS (lo word)
@ -411,8 +411,8 @@ L00BC bit L00BC
asc 02,15,?123456?
asc 02,15,>123456>
asc 02,15,<123456<
asc 02,15,5,"123456"
asc 02,15,"123456
asc 02,15,05,"123456"
asc 02,15,"123456"
asc 0215"1234"1502