Let's say I define data types as
byte ; the same as rb 1
byte [?] ; the same as rb 1
byte [3] ; the same as rb 3
byte [4] 5 ; the same as db 4 dup 5
etc.
Also, I add naturally aligned data types as
aligned word
aligned dword [4]
etc.
For this aligned types I use struc
struc aligned? args&
match =byte?, args
label .
byte [1]
else match =byte? more, args
label .
byte more
else match =word?, args
align 2
label .
word [1]
else match =word? more, args
align 2
label .
word more
end match
end struc
Here I must always match two variants: if data type has parameters following it or not.
Is it possible to somehow match only the beginning of the string so that it doesn't matter if 'more' is empty or not?