scancscode 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,12 +6,12 @@ exports.CSCodeScanner = void 0;
6
6
  */
7
7
  class CSCodeScanner {
8
8
  // 正则表达式匹配 uictrl.text = $"..."; 的模式
9
- static assignmentPattern = /([\w\.]+\.text\s*=(?![=>])\s*)([^;]+)\s*;/mg;
9
+ static assignmentPattern = /([\w\.\u4e00-\u9fff]+\.text\s*=(?![=>])\s*)([^;]+)\s*;/mg;
10
10
  // 正则表达式匹配 匹配每个字符串
11
11
  static stringPattern = /\$?"([^"]*)"/mg;
12
12
  // 正则表达式匹配插值表达式 {...}
13
- static interpolationPattern = /\{([^}]+?)(\:[a-zA-Z\d-\.\#(?:\\\\:)]+)?\}/mg;
14
- static stringFormatPattern = /(?<![a-zA-Z_])([sS]tring\.Format)(?=\(.*?\))/mg;
13
+ static interpolationPattern = /\{([^}]+?)(\:[a-zA-Z\d-\.\#(?:\\\\:)\u4e00-\u9fff]+)?\}/mg;
14
+ static stringFormatPattern = /(?<![a-zA-Z_\u4e00-\u9fff])([sS]tring\.Format)(?=\(.*?\))/mg;
15
15
  static interpolationHeadPattern = /^[\$\@]*(.+)$/m;
16
16
  static isNativeString2(s) {
17
17
  return s == '""';
@@ -46,8 +46,8 @@ class LiteralCollector {
46
46
  return;
47
47
  }
48
48
  let files = glob_1.glob.sync("**/*.cs", { cwd: folder });
49
- let testFullPath = "@";
50
- // let testFullPath = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/Assets/Bundles/FGUI/Shop/SuperGiftsDialog.cs";
49
+ // let testFullPath = "@";
50
+ let testFullPath = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/Assets/Bundles/FGUI/ShopCommon/ShopCommonDialog.cs";
51
51
  for (const filePath of files) {
52
52
  let fullPath = folder + filePath;
53
53
  if (testFullPath != "@") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scancscode",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -6,14 +6,14 @@ import { CodeSnippet } from "./CodeSnippet";
6
6
 
7
7
  export class CSCodeScanner {
8
8
  // 正则表达式匹配 uictrl.text = $"..."; 的模式
9
- private static readonly assignmentPattern = /([\w\.]+\.text\s*=(?![=>])\s*)([^;]+)\s*;/mg;
9
+ private static readonly assignmentPattern = /([\w\.\u4e00-\u9fff]+\.text\s*=(?![=>])\s*)([^;]+)\s*;/mg;
10
10
 
11
11
  // 正则表达式匹配 匹配每个字符串
12
12
  private static readonly stringPattern = /\$?"([^"]*)"/mg;
13
13
  // 正则表达式匹配插值表达式 {...}
14
- private static readonly interpolationPattern = /\{([^}]+?)(\:[a-zA-Z\d-\.\#(?:\\\\:)]+)?\}/mg;
14
+ private static readonly interpolationPattern = /\{([^}]+?)(\:[a-zA-Z\d-\.\#(?:\\\\:)\u4e00-\u9fff]+)?\}/mg;
15
15
 
16
- private static readonly stringFormatPattern = /(?<![a-zA-Z_])([sS]tring\.Format)(?=\(.*?\))/mg;
16
+ private static readonly stringFormatPattern = /(?<![a-zA-Z_\u4e00-\u9fff])([sS]tring\.Format)(?=\(.*?\))/mg;
17
17
 
18
18
  private static readonly interpolationHeadPattern = /^[\$\@]*(.+)$/m;
19
19
 
@@ -14,8 +14,8 @@ export class LiteralCollector {
14
14
  }
15
15
 
16
16
  let files = glob.sync("**/*.cs", { cwd: folder });
17
- let testFullPath = "@";
18
- // let testFullPath = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/Assets/Bundles/FGUI/Shop/SuperGiftsDialog.cs";
17
+ // let testFullPath = "@";
18
+ let testFullPath = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/Assets/Bundles/FGUI/ShopCommon/ShopCommonDialog.cs";
19
19
  for (const filePath of files) {
20
20
  let fullPath = folder + filePath;
21
21
  if (testFullPath != "@") {
package/README.md DELETED
@@ -1 +0,0 @@
1
- # 多语言方案