I cannot write multiline codes interactively in Coffeescript (REPL)

When I was printing multiline coffeescript interactively, an error occurred.

For exapmle, I want to try the following code.

kids = brother: name: "Max" age: 11 sister: name: "Ida" age: 9 

This error has been displayed.

 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) 

I tried using '\' as a new line, but the same error was displayed.

 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) 

I cannot use multi-line, so I cannot use indentation.

What should I do?

My environment is next

+51
multiline interactive coffeescript read-eval-print-loop
May 08 '12 at 2:37
source share
2 answers

You can also switch to multi-line mode with Ctrl + V.

+116
Jan 26 '13 at 18:33
source share
— -

backslash works fine with my coffee 1.2.1 ... try updating :)

+1
May 08 '12 at 4:15
source share



All Articles