We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78001c0 commit 4ac8ae9Copy full SHA for 4ac8ae9
2 files changed
tool/rawstr4c/lib/Generator.rakumod
@@ -80,7 +80,12 @@ my class CVariableNameGenerator {
80
$global-config.get('keep-postfix', 'true').as-bool();
81
82
my $name = $section-config.get('name', $title.lc).as-string();
83
- $name = $name.subst(/\s+/, '_', :g);
+ # 替换非法字符
84
+ $name = $name.subst(/<-[a..z A..Z 0..9 _]>/, '_', :g);
85
+ # 合并连续的下划线
86
+ $name = $name.subst(/_+/, '_', :g);
87
+ # 移除结尾的下划线
88
+ $name = $name.subst(/_+$/, '');
89
90
# 组装变量名
91
my $var-name = "";
tool/rawstr4c/lib/Version.rakumod
@@ -10,7 +10,7 @@
10
11
unit module Version;
12
13
-constant VERSION = "0.1.0.1";
+constant VERSION = "0.1.0.2";
14
constant RELEASE_DATE = "2025/07/14";
15
16
constant Maintain_URL = "https://github.com/RubyMetric/chsrc/blob/dev/tool/rawstr4c";
0 commit comments