PDA

View Full Version : Import ZASM: Leading Spaces



ZoriaRPG
05-29-2017, 12:19 AM
This has been an issue for ages, and we should fix it.

When loading a ZASM script, any instruction that does not begin with a leading space (or a leading tab) will halt the import and generate an error.


https://youtu.be/h9wGq76O0vw

Note than I import ZASM for one of three main reasons:

When a quester provides a quest in which they need me to add an ffc, but they do not apply, or they do not have all of the ZScript files.
When recompiling requires rearranging headers, and importing precompiled ZASM is easier.
When I wish to 'idiot-proof' adding a script; usually ffcs.

DarkDragon
06-15-2017, 03:37 PM
I don't think that's a bug... just part of the ZASM spec. Every line begins with a label and a space, and if there is no label, there must still be a space.

ZoriaRPG
06-16-2017, 09:23 AM
I don't think that's a bug... just part of the ZASM spec. Every line begins with a label and a space, and if there is no label, there must still be a space.

Are you saying that the spec is:

LABEL SPACE INSTRUCTION <VALUES>

?

Or by label, do you mean instruction? If so, then this is still odd, because it does not see the first instruction without a leading space. CR should e treated as a space in the spec, too, FWIW.

DarkDragon
06-16-2017, 10:45 AM
The former. The label is the string used for absolute jumps etc.

ZoriaRPG
06-17-2017, 03:42 AM
I see. There is nothing in place to check if a potential label is identical to a instruction ID, and to skip ahead if it encounters an instruction with no label or leading space. Lovely.

DarkDragon
06-19-2017, 03:53 AM
Nope. The ZASM parser could use a rewrite. But to be honest it's extremely low priority, as long as it works for the ZScript compiler output.

Tamamo
06-19-2017, 07:50 AM
Wrong DarkDragon
The whole engine could use a rewrite.
We're all just to damn lazy to actually do something about it... Hence why it can't actually happen.

ZoriaRPG
06-19-2017, 03:27 PM
Wrong DarkDragon
The whole engine could use a rewrite.
We're all just to damn lazy to actually do something about it... Hence why it can't actually happen.

(Emphasis, mine.)
This is, essentially true. (We're doing that in little bits, as needed, or as we feel like doing it.)