-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update error message for `order_by`. - Add some ALIASes. - Hide some internal methods exported by mistake. - Reorder dropdown in set. ![image](https://github.com/user-attachments/assets/7e6df21a-8ab6-4e6c-90ff-826e88f7b53d) ![image](https://github.com/user-attachments/assets/215b3b74-5718-4033-9ec9-468695f942b5) (cherry picked from commit a546de7)
- Loading branch information
1 parent
6efbf6f
commit d774465
Showing
10 changed files
with
60 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,7 +305,7 @@ Text.find_all self pattern:Text|Regex=".*" case_sensitivity:Case_Sensitivity=..S | |
compiled_pattern = Regex.compile pattern case_insensitive=case_insensitive | ||
compiled_pattern.match_all self | ||
|
||
## ALIAS check matches | ||
## ALIAS check matches, regex, like | ||
GROUP Text | ||
ICON preparation | ||
|
||
|
@@ -334,6 +334,7 @@ Text.find_all self pattern:Text|Regex=".*" case_sensitivity:Case_Sensitivity=..S | |
regex = ".+ct@.+" | ||
# Evaluates to true | ||
"[email protected]".match regex Case_Sensitivity.Insensitive | ||
@pattern Widget.Text_Input | ||
Text.match : Text|Regex -> Case_Sensitivity -> Boolean ! Regex_Syntax_Error | Illegal_Argument | ||
Text.match self pattern:Text|Regex=".*" case_sensitivity:Case_Sensitivity=..Sensitive -> Boolean ! Regex_Syntax_Error | Illegal_Argument = | ||
case_insensitive = case_sensitivity.is_case_insensitive_in_memory | ||
|
@@ -359,7 +360,7 @@ Text.match self pattern:Text|Regex=".*" case_sensitivity:Case_Sensitivity=..Sens | |
Text.to_regex : Boolean -> Regex ! Regex_Syntax_Error | Illegal_Argument | ||
Text.to_regex self case_insensitive=False = Regex.compile self case_insensitive | ||
|
||
## ALIAS split text | ||
## ALIAS tokenize, parse | ||
GROUP Conversions | ||
ICON split | ||
|
||
|
@@ -407,7 +408,7 @@ Text.split self delimiter="," case_sensitivity:Case_Sensitivity=..Sensitive use_ | |
if delimiter_is_singleton_vector then self.split delimiter=(delimiter.first) case_sensitivity=case_sensitivity use_regex=use_regex else | ||
case use_regex of | ||
False -> | ||
delimiters = split_find_delimiters self delimiter case_sensitivity | ||
delimiters = _split_find_delimiters self delimiter case_sensitivity | ||
Vector.new delimiters.length+1 i-> | ||
start = if i == 0 then 0 else | ||
delimiters.at i-1 . codeunit_end | ||
|
@@ -425,7 +426,8 @@ Text.split self delimiter="," case_sensitivity:Case_Sensitivity=..Sensitive use_ | |
combined_delimiter = parenthesize (delimiter.map parenthesize . join '|') | ||
self.split combined_delimiter case_sensitivity=case_sensitivity use_regex=True | ||
|
||
## ADVANCED | ||
## ALIAS split, parse, regex | ||
ADVANCED | ||
GROUP Conversions | ||
ICON split | ||
Takes an input string and and a pattern and returns all the matches as a | ||
|
@@ -452,6 +454,7 @@ Text.split self delimiter="," case_sensitivity:Case_Sensitivity=..Sensitive use_ | |
|
||
'Hello Big\r\nWide\tWorld\nGoodbye!' . tokenize "(\S+)(?:\s+|$)" | ||
== ["Hello","Big","Wide","World","Goodbye!"] | ||
@pattern Widget.Text_Input | ||
Text.tokenize : Text|Regex -> Case_Sensitivity -> Vector Text | ||
Text.tokenize self pattern:Text|Regex=(Missing_Argument.throw "pattern") case_sensitivity:Case_Sensitivity=..Sensitive = | ||
case_insensitive = case_sensitivity.is_case_insensitive_in_memory | ||
|
@@ -1075,7 +1078,7 @@ Text.take self range:(Text_Sub_Range | Index_Sub_Range | Range | Integer)=..Firs | |
Range.Between start end 1 -> | ||
Text_Utils.substring self start end | ||
Codepoint_Ranges.Value char_ranges _ -> | ||
slice_text self char_ranges | ||
_slice_text self char_ranges | ||
|
||
## ALIAS remove, skip | ||
GROUP Selections | ||
|
@@ -1130,7 +1133,7 @@ Text.drop self range:(Text_Sub_Range | Index_Sub_Range | Range | Integer)=..Firs | |
sorted_char_ranges_to_remove = ranges.sorted_and_distinct_ranges | ||
char_length = Text_Utils.char_length self | ||
inverted = invert_range_selection sorted_char_ranges_to_remove char_length needs_sorting=False | ||
slice_text self inverted | ||
_slice_text self inverted | ||
|
||
## ALIAS lower, proper, title, upper | ||
GROUP Text | ||
|
@@ -1972,7 +1975,7 @@ Text.substring self start:Integer length:Integer=self.length = | |
input's range. | ||
|
||
The input ranges are in UTF-16 code unit space. | ||
slice_text text char_ranges = | ||
private _slice_text text char_ranges = | ||
sb = StringBuilder.new | ||
char_ranges.map char_range-> | ||
sb.append text char_range.start char_range.end | ||
|
@@ -1981,8 +1984,8 @@ slice_text text char_ranges = | |
## PRIVATE | ||
|
||
Find occurrences of delimiters in a string. | ||
split_find_delimiters : Text -> Text | Vector Text -> Case_Sensitivity -> Vector Text | Illegal_Argument | ||
split_find_delimiters input delimiter case_sensitivity = | ||
_split_find_delimiters : Text -> Text | Vector Text -> Case_Sensitivity -> Vector Text | Illegal_Argument | ||
private _split_find_delimiters input delimiter case_sensitivity = | ||
Vector.from_polyglot_array <| case delimiter of | ||
_ : Text -> case case_sensitivity of | ||
Case_Sensitivity.Sensitive -> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters