Synopsis
vasm [FILE…] [OPTIONS…]
Description
stylist is a program engrained in VASM designed to enforce good and compliant styles within LunarRED assembly code. The stylist program can be found in the actual vasm program and can be used to lint source code at face value.
Options (for vasm)
- --enforce-stylist
-
Error when stylist reports anything wrong or suggests anything with the source code. This option is by default off and recommended to be on when working on consistent code bases.
Stylist Reports
- S000 (Trailing Comma)
-
Trailing comma at the end of a statement. These can usually be omitted and are unnecessary especially in simple contexts.
_start:
init R1, <----- error happens here
- S0001 (Space after comma)
-
To make code look nicer and more laid out, it is better to add a space before each parameter.
_start:
mov R1,5
^ add a space here
_start:
mov R1, 5
^ good! :)
- S0004 (No Final Line)
-
The file does not end with a newline. A majority of text editors/IDEs will remind you of this but its always good to leave one.
_start:
init R1
Versus:
_start:
init R1
\n <--- newline (don't actually write it out, just press enter)
- S0005 (Long JMP Name)
-
JMP is an instruction specific to bytecode formats that have a custom procedure mechanism. VASM compiles procedure headers by the first letter of their name. There are plans to change this into a hashing system.
jmp abc
^~~ anything extra shouldn't be there, the procedure A is still being called.