Commit Graph

95 Commits

Author SHA1 Message Date
Bart
b68d0b882a LazUtils: Masks: only conditionally compile TMaskUtf8.DumpMaskColpiled.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 19:16:34 +01:00
Bart
3679a90e37 LazUtils: Masks: rename ReverseRange to AddRangeReverse.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 19:06:49 +01:00
Bart
ef974cb238 LazUtils: Masks: suppress a hint.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 19:02:50 +01:00
Bart
aae437d605 LazUtils: Masks: disallow #0 in the user supplied mask for TWindowsMask.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 18:55:15 +01:00
Bart
cd4ce74027 LazUtils: Masks: cleanup.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-08 22:54:00 +01:00
Bart
3c6c852bc1 LazUtils: Masks: revert most of #78148e42 since wqFileNameEnd no longer requires mocAnyCharOrNone.
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-08 22:43:20 +01:00
Bart
09dcf62106 LazUtils: Masks: use TWindowsMaskUtf8.CompileSpecialChars to handle the wqFileNameEnd quirk.
This now no longer depends on mocAnyCharOrNone, so do not enforce that any longer if wqFileNameEnd is enabled.
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-08 22:31:32 +01:00
Bart
a0d01a5922 LazUtils: Masks: make CompileSpecialChars and CompileEscapeCharPlusLiteral methods of TMaskUtf8 instead of nested procs.
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-08 22:07:30 +01:00
Bart
e76d29f85b LazUtils: Masks: simplify TWindowsMaskUtf8.CompileOtherSpecialChars.
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-08 19:06:36 +01:00
Bart
0be73871b5 LazUtils: Masks: implement a crude TWindowsMaskUtf8.CompileOtherSpecialChars to handle #0's.
Probably this could be sped up by counting the #0's and adding them all at once?
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-07 23:17:47 +01:00
Bart
50811399e4 LazUtils: Masks: lay out the infrastructure to handle other special characters in the mask.
Will be used for the handling of wqFileNameEnd in TWindowsMaskUTF8.
2021-11-07 18:11:48 +01:00
Bart
2f07ee8783 LazUtils: Masks: factor out the handling of escaped literals and of special chars in TMaskUtf8.Compile.
The logic of the main while loop becomes more clear (it spanned too much screens).
Also add a comment about possible dead code in HandleSpecialChar.
2021-11-06 15:39:51 +01:00
Bart
91bde5f636 LazUtils: Masks: fix potential range error in TMaskUtf8.Compile. 2021-11-06 13:39:46 +01:00
Bart
5dff088116 LazUtils: Masks: replace some lines of code with a single AddLiteral. 2021-11-06 13:32:38 +01:00
Bart
f4996fb470 LazUtils: Masks: fix spelling errors in a comment. 2021-11-05 18:32:15 +01:00
Bart
2ce594217a LazUtils: Masks: fix TWindowsMaskUtf8.Matches not calling Compile.
Now all tests in the testsuite are OK again.
2021-11-03 20:04:51 +01:00
Bart
3d0b1cc901 LazUtils: Masks: TMask.Compile: do not call CompileRange when mocAnyCharOrNone is enabled, but mocRange and mocSet are disabled,
in taht case '[a' is a valid mask (of 2 literals).
2021-11-03 19:14:22 +01:00
Bart
a9c7e4196b LazUtils: Masks: fix a deprecated message. 2021-11-03 19:07:31 +01:00
Bart
78148e42f5 LazUtils: Masks: since wqFilenameEnd (internally) requires mocAnyCharOrNone, include the latter in MaskOpCodes if wqFilenameEnd is used.
Also include mocAnyCharOrNone in DefaultMaskOpcodes, otherwise the default behaviour between TMask and TWindowsMask
for a mask containing [?] would differ.
Add comments to the long and winding if then else blocks in CompileRange
2021-11-03 19:05:45 +01:00
Bart
a22cac6853 LazUtils: fix not adding '[' as a literal to the internal mask if ranges and sets are disabled:
MatchesMask('a[b]c','a[b]c',False,MaskOpCodesDisableRange) now correctly evaluates to True.
2021-11-02 23:09:00 +01:00
Bart
0ed2398c32 LazUtils: Masks: remove commented out code and associated comment. 2021-11-02 19:03:37 +01:00
Bart
61789da61d LazUtils: Masks: add comment about EscapeChar property. 2021-11-02 19:01:30 +01:00
Bart
8ba7c4fedc LazUtils: Masks: move some comments. 2021-11-02 19:00:16 +01:00
Bart
1d8110d62e LazUtils: Masks: fix comment for mocRange (now that escaping works properly). 2021-11-02 18:52:30 +01:00
Bart
5c7690081c LazUtils: Masks: vanity change. 2021-11-02 18:49:58 +01:00
Bart
7a80001488 LazUtils: Masks: implement property TMaskList.CaseSensitive. 2021-11-02 18:48:36 +01:00
Bart
becd9a5374 LazUtils: Masks: implement property TMaskList.AutoReverseRange. 2021-11-02 18:44:40 +01:00
Bart
f269492d19 LazUtils: Masks: there is no need to regenerate the the indivual fMasks.Items in TMaskList.SetMaskOpCodes. 2021-11-02 18:39:55 +01:00
Bart
4ae0dac7da LazUtils: Masks: make property TMaskBase.CaseSensitive read/write. 2021-11-02 18:31:52 +01:00
Bart
88f6d76cfc LazUtils: Masks: move TMaskFailCause type inside the TMaskBase class. It is not needed outside. 2021-11-02 18:28:26 +01:00
Bart
19feb31030 LazUtils: Masks: add some ToDo comments for properties not yet (r/w) implemented. 2021-11-01 23:22:26 +01:00
Bart
ff2b30b7c0 LazUtils: Masks: also force a new Compile when EscapeChar is changed. 2021-11-01 23:12:17 +01:00
Bart
ca93bfbd58 LazUtils: Masks: property AutoReverseRange needs a setter as well. 2021-11-01 23:07:27 +01:00
Bart
d374385885 LazUtils: Masks: if Compile fails, don't set fMaskIsCompiled to True. 2021-10-31 20:42:34 +01:00
Bart
cf6d6c626c LazUtils: Masks: make TWindowsMaskList.Quirks read/write. 2021-10-31 20:12:22 +01:00
Bart
3be1973992 LazUtils: Masks: fix TMaskList.SetMask and .SetMaskOpCodes. 2021-10-31 20:06:24 +01:00
Bart
8a550c1678 LazUtils: Masks: implement TMaskList.MaskOpCodes property. 2021-10-31 19:44:31 +01:00
Bart
1a0f808921 LazUtils: Masks: implement TMaskList.Mask property. 2021-10-31 19:41:00 +01:00
Bart
1543c68c73 LazUtils: Masks: make TWindowsMask.Quirks read/write. 2021-10-31 19:07:43 +01:00
Bart
dd4c515dc6 LazUtils: Masks: when setting Mask property invalidate fInternalMask. 2021-10-31 19:02:24 +01:00
Bart
421f894acb LazUtils: Masks: properly implement property TMaskBase.MaskOpCodes, remove property OPCodesAllowed. 2021-10-31 18:52:32 +01:00
Bart
ebabdd0bba LazUtils: Masks: implement property TMaskBase.MaskOpCodes. 2021-10-31 18:21:39 +01:00
Bart
71623760cb LazUtils: Masks: simplify TMaskList.MatchesWindowsMask. 2021-10-31 18:15:39 +01:00
Bart
2cab533808 LazUtils: Masks: also do not compile the mask in the constructor of TWindowsMaskList. 2021-10-31 18:04:51 +01:00
Bart
181e410434 LazUtils: Masks: don not disable ranges and sets in TWindowsMask, and do not compile the mask in the constructor, so the constructor won't fail if a mask is invalid. 2021-10-31 17:27:04 +01:00
Bart
0a32776e98 LazUtils: Masks: an empty negated set is also an empty set, so don't allow that as well. 2021-10-31 16:19:49 +01:00
Bart
20f3e55048 LazUtils: Masks: support escaping in ranges/sets (part 2). Based on original code by Jose Mejuto
(https://github.com/JoshyFun/pascal_tmask/blob/main/umask.pas)
2021-10-31 16:17:32 +01:00
Bart
4ba6ff00d7 LazUtils: Masks: support escaping in ranges (part 1). Based on original code by Jose Mejuto
(https://github.com/JoshyFun/pascal_tmask/blob/main/umask.pas)
2021-10-30 14:46:59 +02:00
Bart
61a1afe43f LazUtils: Masks: cosmetic (fix indentation). 2021-10-29 23:08:40 +02:00
Bart
e4f572e8a6 LazUtils: Masks: add a TWindowsQuirks parameter to MatchesWindowsMaskList (MatchesWindowsMask already had this). 2021-10-29 23:02:57 +02:00