[Lazarus] TMask revisited

Bart bartjunk64 at gmail.com
Sat Oct 23 12:02:45 CEST 2021


On Thu, Oct 21, 2021 at 10:29 AM José Mejuto via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

> So the question is, why sets if ranges can be used ? Because sometimes
> you need to exclude strings that starts with number 1:
>
> "[0234567989][a-z]"
>
> > Naming them different just confuses me (which probably is my fault).
>
> Because they are different beast in the code and in the syntax, many
> times ranges apparently are syntactic sugar for sets, but ranges have a
> begin and an end, and both have a mission, one, ranges, add clarity to
> the desired match, and the second, sets, add flexibility to the mask write.
>

I can understand why having [a-e] is good (and better than [abcde]).
I was just confused by the fact that these had different names.

since we are still looking for a better (?) name for the
eMaskOpcodeOptionalChar enum:
When eMaskOpcodeOptionalChar enables the use of [abcde] and
eMaskOpcodeRange enables the use of [a-z] and syntactically there is a
difference between ranges [a-e] and sets [abcde], then a potentially
better name could be eMaskOpcodeSet(s)?

-- 
Bart


More information about the lazarus mailing list