bass icon indicating copy to clipboard operation
bass copied to clipboard

'fill' keyword doesn't allow single quoted length

Open fraser125 opened this issue 3 years ago • 1 comments

The following line fails to assemble using the latest release of bass v18.

error: mismatched quotes in expression
Video002.asm:6:1: fill $0010'1000

This has worked in the past (Dec 2019). I'm really trying to narrow this issue down and did the following research.

  1. VALID: origin $0000'0000
  2. VALID: base $8000'0000
  3. Error message mismatched quotes in expression is from bass/core/utility.cpp function Bass::split
  4. The fill keyword uses the split function while the other mentioned keywords do not.
  5. The documentation isn't "conditional" for everything except 'fill' doc/basics.md regarding the use of the single quote character for making numbers easier to read.

It seems like there are a couple of different possible fixes, so I leave that up to you.

Please let me know if you need any further information.

fraser125 avatar Dec 02 '22 18:12 fraser125

It looks like the following code change caused the functionality change Old

if(s.match("fill ?*")) {
    lstring p = s.ltrim<1>("fill ").qsplit(",").strip();
    unsigned length = evaluate(p(0));
    unsigned byte = evaluate(p(1, "0"));
    while(length--) write(byte);
    return true;
  }

New

if(s.match("fill ?*")) {
    auto p = split(s.trimLeft("fill ", 1L));
    uint length = evaluate(p(0));
    uint byte = evaluate(p(1, "0"));
    while(length--) write(byte);
    return true;
  }

fraser125 avatar Dec 02 '22 20:12 fraser125