Commit Graph

119 Commits

Author SHA1 Message Date
Bart
e19b8a86f9 Masks: cosmetic: indentation. 2023-01-15 11:44:06 +01:00
Bart
7b8159908e Masks: remove TWindowsMaskList.MatchesWindowsMask. It should never have been there, since it does not resolve a backwards compatibility issue (there never existed a TWindowsMaskList before). 2023-01-14 19:16:59 +01:00
Bart
408f319004 Masks: introduce the possibility for a MaskListClass factory. 2023-01-14 13:56:19 +01:00
Bart
3b1bba21ff Masks: rename TMask.Compile to TMask.PrepareCompile and make it set fMaskIsCompiled to False.
TMaskUTF8.Compile is now the base method for compiling the mask.
Add a comment about fMaskIsCompiled.
Reasons:
- TMask.Compile did not really compile anything.
- fMaskIsCompiled should only be set to True if (real) compilation of the mask is succesfull
2023-01-10 12:52:45 +01:00
mattias
0f871f2237 lazutils: clean up 2022-04-11 09:43:22 +02:00
Bart
9b61164125 LazUtils: Masks: move the logic of #a9457c2f2bd1412ef2c8ed9dc7e468eff6453bf4 to CompileAnyCharOrNone. 2022-01-02 13:20:37 +01:00
Bart
a9457c2f2b LazUtils: Masks: if mocSet, mocRange of mocAnyCharOrNone is enabled an unescaped '[' must always start such a construct and cannot be a literal. 2022-01-01 13:20:42 +01:00
Bart
ef131e6c46 LazUtils: Masks: modifiy comment about wqAnyExtension 2021-11-20 13:25:33 +01:00
Bart
ac380781cd LazUtils: Masks: re-arrange some definitions. No functional changes. 2021-11-20 13:21:15 +01:00
Bart
7c0fdd1281 LazUtils: Masks: on Windows 'foo.*' should also match 'foo' (depends on quirks used). Patch by Jose Mejuto. Issue #39462. 2021-11-20 12:57:08 +01:00
Bart
eb63676746 LazUtils: Masks: remove wqFileNameEnd from DefaultWindowsQuirks, as it's behaviour is a bit unexpected for the common user. 2021-11-10 21:52:47 +01:00
Bart
3af786d415 LazUtils: Masks: TMaskUtf8.intMatches: comment out debug writeln.
All debug writeln's are disabled by default now.
2021-11-10 21:43:05 +01:00
Bart
c5a2248d1e LazUtils: Masks: Compile: ifdef (or comment out) debug writeln's.
Note: code still contains writeln's, so it will crash if no console is available.
2021-11-10 21:37:58 +01:00
Bart
7a4464df4e LazUtils: Masks: CompileRange: comment out debug a piece of code that is (if I am correct) dead (see the comments).
Note: code still contains writeln's, so it will crash if no console is available.
2021-11-10 21:35:08 +01:00
Bart
355912f3cd LazUtils: Masks: CompileRange: comment out debug statements. Remove commented (and factored) out code.
Note: code still contains writeln's, so it will crash if no console is available.
2021-11-10 21:18:15 +01:00
Bart
cb530a9063 LazUtils: CompileAnyCharOrNone: ifdef all debug output. Remove unneeded comments.
Note: code still contains writeln's, so it will crash if no console is available.
2021-11-10 21:15:36 +01:00
Bart
905d99b813 LazUtils: use CompileAnyCharOrNone in TWindowsMaskUTF8.CompileOtherSpecialChars.
Fix not including wqFileNameEnd in fWindowsQuirksInUse.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-10 18:55:47 +01:00
Bart
ad69e5b56b LazUtils: prepare CompileAnyCharOrNone so that if can be re-used in TWindowsMaskUTF8.CompileOtherSpecialChars.
Fix compilation in TWindowsMaskUTF8.CompileOtherSpecialChars
Fix off by 1 error on errormessage in CompileAnyCharOrNone.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-10 18:39:00 +01:00
Bart
36cc485850 LazUtils: add (hopefully redundant) check in TWindowsMaskUTF8.CompileOtherSpecialChars.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-10 18:14:47 +01:00
Bart
939c2d26d6 LazUtils: only conditionally compile some checks in CompileAnyCharOrNone.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-10 18:05:07 +01:00
Bart
4602ea4e19 LazUtils: rename a method, no functional changes.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-10 18:00:09 +01:00
Bart
a45b237a29 LazUtils: Add a note in CompileRange for possible future optimization.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-10 17:58:49 +01:00
Bart
15fe156691 LazUtils: Masks: fix and use CompileAnyCharOrNone in CompileRange.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 23:24:51 +01:00
Bart
6cd54a131e LazUtils: Masks: start factoring out CompileAnyCharOrNone (later to be extended and uses by TWindowsMask.CompileOtherSpecialChars).
Code is unused for now.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 19:39:31 +01:00
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