Closed theNestruo closed 4 years ago
Nice! Thanks a lot for the initial tniasm support theNestruo!!! I see a couple of things that might be the cause of the problem, let me merge and check it out! I see the parseLine method of the tniasm dialect class does something different from what the code actually expects. So, will do a couple of fixes after I merge :)
Ok, I figured out what was happening. The bug was not on your side, but on the preProcessor. I just fixed it and it works. Sorry for the bug!!! cartridge.asm is properly parsed now :)
Btw, when defining a dialect, you only need to worry about the keywords that are not already parsed by MDL. No need for "org", "db", "dw", etc. as those will never be passed to the dialect. You only need to add support for the dialect specific keywords.
About spilling into the ExpressionPaser, (for XOR, AND, etc.). It's totally ok! If we have a similar issue with some other dialect, we can generalize and add a "synonym" hashMap like in the LineParser and PreProcessor classes that the Dialect classes can fill in. But for now, I think it's ok :)
Preliminary tniASM syntax support. It is not completely functional yet!
This pull request is a little/bit rough around the edges because
Dialect
cannot contain entire definition of a dialect (some parts of tniASM syntax support ended up inExpresisonParser
andPreProcessor
/SourceMacro
...)At the moment, lib/msx/cartridge.asm cannot be parsed. But I have been unable to understand the exact cause of problem... so I guess I'll make the pull request now and investigate further later O:-)