You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在main函数中存在argsn,在进行dara format的时候会报错。
代码: static async function main(args: [ string ])throws : void { var a = args[0]; }
报错信息: exec error : Error: unimpelemented at Formatter.visitExpr (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:511:13) at Formatter.visitDeclare (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:597:10) at Formatter.visitStmt (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:242:12) at Formatter.visitStmts (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:609:12) at Formatter.visitFunction (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:117:12) at Formatter.visit (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:66:14) at FormatCommand.exec (/opt/homebrew/lib/node_modules/@darabonba/cli/commands/format.js:42:15) at CommandsApplication.exec (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/app.js:154:13) at CommandsApplication.run (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/app.js:34:12) at Object.<anonymous> (/opt/homebrew/lib/node_modules/@darabonba/cli/bin/dara.js:45:5)
若代码中存在for列表循环,dara format会将‘:’替换为'in',导致报错。
原代码 for (var a : response.body.list) { Console.log(a.b); }
格式化之后代码 for (var a in response.body.list) { Console.log(a.b); }
导致报错 SyntaxError: Unexpected token: Word:in. Expect :, but Word: inat Parser.error (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/node_modules/@jacksontian/skyline/lib/parser.js:56:11) at Parser.match (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/node_modules/@jacksontian/skyline/lib/parser.js:21:12) at Parser.forStmt (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1604:10) at Parser.stmt (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1653:19) at Parser.stmts (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1465:23) at Parser.blockStmts (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1477:22) at Parser.functionBody (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1791:24) at Parser.fun (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1770:27) at Parser.moduleBody (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:138:21) at Parser.module (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:105:24)
The text was updated successfully, but these errors were encountered:
在main函数中存在argsn,在进行dara format的时候会报错。
代码:
static async function main(args: [ string ])throws : void { var a = args[0]; }
报错信息:
exec error : Error: unimpelemented at Formatter.visitExpr (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:511:13) at Formatter.visitDeclare (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:597:10) at Formatter.visitStmt (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:242:12) at Formatter.visitStmts (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:609:12) at Formatter.visitFunction (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:117:12) at Formatter.visit (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/formatter.js:66:14) at FormatCommand.exec (/opt/homebrew/lib/node_modules/@darabonba/cli/commands/format.js:42:15) at CommandsApplication.exec (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/app.js:154:13) at CommandsApplication.run (/opt/homebrew/lib/node_modules/@darabonba/cli/lib/app.js:34:12) at Object.<anonymous> (/opt/homebrew/lib/node_modules/@darabonba/cli/bin/dara.js:45:5)
若代码中存在for列表循环,dara format会将‘:’替换为'in',导致报错。
原代码
for (var a : response.body.list) { Console.log(a.b); }
格式化之后代码
for (var a in response.body.list) { Console.log(a.b); }
导致报错
SyntaxError: Unexpected token: Word:
in. Expect :, but Word:
inat Parser.error (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/node_modules/@jacksontian/skyline/lib/parser.js:56:11) at Parser.match (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/node_modules/@jacksontian/skyline/lib/parser.js:21:12) at Parser.forStmt (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1604:10) at Parser.stmt (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1653:19) at Parser.stmts (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1465:23) at Parser.blockStmts (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1477:22) at Parser.functionBody (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1791:24) at Parser.fun (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:1770:27) at Parser.moduleBody (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:138:21) at Parser.module (/opt/homebrew/lib/node_modules/@darabonba/cli/node_modules/@darabonba/parser/lib/parser.js:105:24)
The text was updated successfully, but these errors were encountered: