Skip to content

Commit e039616

Browse files
committed
Move postfix config value into Config
1 parent d15d865 commit e039616

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tool/rawstr4c/lib/Config.rakumod

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,22 @@ class SectionConfig {
7979
return self.get-inherited-config('prefix', '_rawstr4c');
8080
}
8181

82-
#| RS4C-Mode 或 RS4C-String
82+
#| RS4C-String
8383
method postfix() {
84-
return self.get-inherited-config('postfix', ':use-language');
84+
# RS4C-Mode 或 RS4C-String
85+
my $config-postfix = self.get-inherited-config('postfix', ':use-language');
86+
87+
my $language = self.language.string-value;
88+
my $postfix;
89+
90+
if $config-postfix.is-mode() && $config-postfix.mode-value() eq 'use-language' {
91+
$postfix = 'in_' ~ $language;
92+
} else {
93+
# 如果不是模式,那就是用户给了一个具体的字符串
94+
$postfix = $config-postfix.string-value();
95+
}
96+
97+
return Parser::ConfigItem's-Value.new($postfix);
8598
}
8699

87100
#| RS4C-Bool

0 commit comments

Comments
 (0)