koitsu wrote:
One thing that I noticed from perusing the code is that there's inconsistent use of hard tabs vs. spaces throughout the code (sometimes even on the same line), making it difficult to read. The file uses a modeline of
ts=8, but it doesn't appear that is actually maintained consistently throughout the file. It looks like (based on some of the other stock syntaxes) that whitespace should be used.
:set list is useful here.
Attached is a diff against master which cleans all that up (I find
git format-patch confusing, not to mention I couldn't get it to work today for whatever reason, probably user error).
Thanks for pointing this out; yeah, I started out by making modifications to the stock asm.vim, which used a mixture of tabs and spaces (shudder), and I neglected to continue doing so consistently. I've now turned everything into spaces, as you suggest.
koitsu wrote:
I'd also love to see bge/blt opcode aliases (for bcs/bcc) added since they're so incredibly common, but yeah I know ca65 only enables use of those by default in 65816 mode (which makes absolutely no sense, because those aliases aren't 65816-specific. That's a ca65 annoyance though and not your fault, but still...)
So here's a bigger question... should this syntax module just support all of ca65's instruction mnemonics for the various CPUs that it supports? How would you feel about a buffer-local variable (e.g., b:asm_ca65_cpu="65c02") that the user can set on a per-file basis (with a modeline or a filetype autocmd) that determines which mnemonics get highlighted?
Also, while persuing the ca65 source code, I noticed that the set of illegal instruction mnemonics supported by ca65 is actually larger than claimed in the documentation. Compare the list starting at
line 215 of instr.c to the
list in the documentation. Which set do think it makes sense to highlight? Maybe the discrepancy is something to file as in issue with the cc65 project.