首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >我无法在Coffeescript交互模式(REPL)下编写多行代码

我无法在Coffeescript交互模式(REPL)下编写多行代码
EN

Stack Overflow用户
提问于 2012-05-08 10:37:25
回答 1查看 8.5K关注 0票数 52

当我在coffeescript交互模式下输入multiline时,出现了一个错误。

例如,我想尝试以下代码:

代码语言:javascript
复制
kids =
  brother:
    name: "Max"
    age:  11
  sister:
    name: "Ida"
    age:  9

显示此错误:

代码语言:javascript
复制
coffee> kids = 
Error: In repl, Parse error on line 1: Unexpected 'TERMINATOR'
  at Object.parseError (/usr/lib/coffeescript/parser.js:463:11)
  at Object.parse (/usr/lib/coffeescript/parser.js:533:22)
  at /usr/lib/coffeescript/coffee-script.js:26:22
  at Object.eval (/usr/lib/coffeescript/coffee-script.js:64:17)
  at Interface.<anonymous> (/usr/lib/coffeescript/repl.js:18:26)
  at Interface.emit (events:27:15)
  at Interface._ttyWrite (readline:309:12)
  at Interface.write (readline:147:30)
  at Stream.<anonymous> (/usr/lib/coffeescript/repl.js:35:17)
  at Stream.emit (events:27:15)

我尝试使用'\‘作为换行符,但显示了相同的错误。

代码语言:javascript
复制
coffee> kids = \
Error: In repl, Parse error on line 1: Unexpected '\'
  at Object.parseError (/usr/lib/coffeescript/parser.js:463:11)
  at Object.parse (/usr/lib/coffeescript/parser.js:533:22)
  at /usr/lib/coffeescript/coffee-script.js:26:22
  at Object.eval (/usr/lib/coffeescript/coffee-script.js:64:17)
  at Interface.<anonymous> (/usr/lib/coffeescript/repl.js:18:26)
  at Interface.emit (events:27:15)
  at Interface._ttyWrite (readline:309:12)
  at Interface.write (readline:147:30)
  at Stream.<anonymous> (/usr/lib/coffeescript/repl.js:35:17)
  at Stream.emit (events:27:15)

我不能使用多行,所以我不能使用缩进。

我该怎么办?

我的环境如下:

  • OS: Ubuntu 10.04 lucid
  • coffeescript version 1.0.0我安装了带有PPA和apt-命令的
    • 脚本。

查看此url:https://launchpad.net/~gezakovacs/+archive/coffeescript

EN

回答 1

Stack Overflow用户

发布于 2012-05-08 12:15:50

反斜杠在我的咖啡1.2.1...尝试升级:)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10491849

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档