File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,12 @@ my class CVariableNameGenerator {
8080 $ global-config . get (' keep-postfix' , ' true' ). as-bool();
8181
8282 my $ name = $ section-config . get (' name' , $ title . lc ). as-string();
83- $ name = $ name . subst (/\s + /, ' _' , : g);
83+ # 替换非法字符
84+ $ name = $ name . subst (/<- [ a..z A..Z 0..9 _ ] > /, ' _' , : g);
85+ # 合并连续的下划线
86+ $ name = $ name . subst (/_+ /, ' _' , : g);
87+ # 移除结尾的下划线
88+ $ name = $ name . subst (/_+ $ /, ' ' );
8489
8590 # 组装变量名
8691 my $ var-name = " " ;
Original file line number Diff line number Diff line change 1010
1111unit module Version ;
1212
13- constant VERSION = " 0.1.0.1 " ;
13+ constant VERSION = " 0.1.0.2 " ;
1414constant RELEASE_DATE = " 2025/07/14" ;
1515
1616constant Maintain_URL = " https://github.com/RubyMetric/chsrc/blob/dev/tool/rawstr4c" ;
You can’t perform that action at this time.
0 commit comments