已合并
【社区学习赛】docs: 修改错误的print说明main.cj #1266
【社区学习赛】docs: 修改错误的print说明main.cj #1266
已合并
2501_93903314创建于 9月3日
共 1 个文件变更+5-5
@@ -103,7 +103,7 @@ main(args: Array<String>) {
103 103 
104 // check whether cjbind exists104 // check whether cjbind exists
105 if (!(exists(cla.bindingsPath) && FileInfo(cla.bindingsPath).isRegular())) {105 if (!(exists(cla.bindingsPath) && FileInfo(cla.bindingsPath).isRegular())) {
106- println("Error: generation failed! cjbind file ${cla.bindingsPath} not exists, please download cjbind or build it first!")106+ println("Error: generation failed! cjbind file ${cla.bindingsPath} does not exist, please download cjbind or build it first!")
107 return 1107 return 1
108 }108 }
109 109 
@@ -206,8 +206,8 @@ func generateCangjieBindingsForC(moduleName: String, filePath: String, outDir: S
206func parseCommandLine(pa: ParsedArguments): Unit {206func parseCommandLine(pa: ParsedArguments): Unit {
207 let currentPath = getHomeDirectory().toString()207 let currentPath = getHomeDirectory().toString()
208 208 
209- cla.arkpath = (pa.options.get("i") ?? "") // 输入的ArkTS文件路径209+ cla.arkpath = (pa.options.get("i") ?? "") // 输入的 d.ts 或 d.ets 文件路径
210- cla.outDir = (pa.options.get("o") ?? currentPath) // 输出的Cangjie文件路径210+ cla.outDir = (pa.options.get("o") ?? currentPath) // 输出的Cangjie文件目录
211 if (!cla.outDir.endsWith("/")) {211 if (!cla.outDir.endsWith("/")) {
212 cla.outDir += "/"212 cla.outDir += "/"
213 }213 }
@@ -302,7 +302,7 @@ func parseFilesSpawn(f: FileInfo, dir: Path, name: String, gconfigList: Concurre
302 let basePath = dir.toString().replace("\\", "/")302 let basePath = dir.toString().replace("\\", "/")
303 let moduleName = f.path.toString().replace("\\", "/")303 let moduleName = f.path.toString().replace("\\", "/")
304 304 
305- // Get each file's relative path to input direcotry305+ // Get each file's relative path to input directory
306 var relativeFilePath = ""306 var relativeFilePath = ""
307 let splitResult = moduleName.split(basePath)307 let splitResult = moduleName.split(basePath)
308 if (splitResult.size > 1) {308 if (splitResult.size > 1) {
@@ -411,7 +411,7 @@ func parseFile(arkpath: String, outDir: String, jsASTPath: String, gconfig: Glob
411 }411 }
412 412 
413 //扫描整个ark json文件,将内容保存在全局变量gconfig里,gconfig的声明在globalConfig.cj413 //扫描整个ark json文件,将内容保存在全局变量gconfig里,gconfig的声明在globalConfig.cj
414- //如若需要指定cj json,可以考虑扩容Global414+ //如若需要指定cj json,可以考虑扩容GlobalConfig 类
415 let fileContent = String.fromUtf8(File.readFrom(arkJson))415 let fileContent = String.fromUtf8(File.readFrom(arkJson))
416 let transform = Transform(fileContent)416 let transform = Transform(fileContent)
417 let jsonContent = JsonValue.fromStr(fileContent)417 let jsonContent = JsonValue.fromStr(fileContent)