Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4adffd5

Browse files
authored
Merge pull request#188 from UncoderIO/gis-7010
spl str value manager
2 parents8d06469 +4a1d3e3 commit4adffd5

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

‎uncoder-core/app/translator/platforms/base/spl/escape_manager.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77

88
classSplEscapeManager(EscapeManager):
9-
escape_map:ClassVar[dict[str,list[EscapeDetails]]]= {
10-
ValueType.value: [EscapeDetails(pattern='("|(?<!\\\\)\\\\(?![*?\\\\]))')]
11-
}
9+
escape_map:ClassVar[dict[str,list[EscapeDetails]]]= {ValueType.value: [EscapeDetails(pattern=r"([<>=\"'\|\\])")]}
1210

1311

1412
spl_escape_manager=SplEscapeManager()

‎uncoder-core/app/translator/platforms/base/spl/tokenizer.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
fromapp.translator.platforms.base.spl.constimportNO_QUOTES_VALUES_PATTERNasNO_Q_V_PATTERN
3030
fromapp.translator.platforms.base.spl.constimportNUM_VALUE_PATTERNasN_V_PATTERN
3131
fromapp.translator.platforms.base.spl.constimportSINGLE_QUOTES_VALUE_PATTERNasS_Q_V_PATTERN
32-
fromapp.translator.platforms.base.spl.escape_managerimportspl_escape_manager
32+
fromapp.translator.platforms.base.spl.str_value_managerimportspl_str_value_manager
3333
fromapp.translator.tools.utilsimportget_match_group
3434

3535

@@ -57,7 +57,7 @@ class SplTokenizer(QueryTokenizer, ANDLogicOperatorMixin):
5757

5858
wildcard_symbol="*"
5959

60-
escape_manager=spl_escape_manager
60+
str_value_manager=spl_str_value_manager
6161

6262
defget_operator_and_value(
6363
self,match:re.Match,mapped_operator:str=OperatorType.EQ,operator:Optional[str]=None
@@ -66,13 +66,13 @@ def get_operator_and_value(
6666
returnmapped_operator,num_value
6767

6868
if (no_q_value:=get_match_group(match,group_name=ValueType.no_quotes_value))isnotNone:
69-
returnmapped_operator,no_q_value
69+
returnmapped_operator,self.str_value_manager.from_str_to_container(no_q_value)
7070

7171
if (d_q_value:=get_match_group(match,group_name=ValueType.double_quotes_value))isnotNone:
72-
returnmapped_operator,self.escape_manager.remove_escape(d_q_value)
72+
returnmapped_operator,self.str_value_manager.from_str_to_container(d_q_value)
7373

7474
if (s_q_value:=get_match_group(match,group_name=ValueType.single_quotes_value))isnotNone:
75-
returnmapped_operator,self.escape_manager.remove_escape(s_q_value)
75+
returnmapped_operator,self.str_value_manager.from_str_to_container(s_q_value)
7676

7777
returnsuper().get_operator_and_value(match,mapped_operator,operator)
7878

‎uncoder-core/app/translator/platforms/logscale/tokenizer.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_operator_and_value(
5757
returnmapped_operator,num_value
5858

5959
if (d_q_value:=get_match_group(match,group_name=ValueType.double_quotes_value))isnotNone:
60-
returnmapped_operator,d_q_value
60+
returnmapped_operator,self.escape_manager.remove_escape(d_q_value)
6161

6262
if (re_value:=get_match_group(match,group_name=ValueType.regex_value))isnotNone:
6363
returnOperatorType.REGEX,re_value

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp