本文介绍了IEx-如何取消多行命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用IEx并像其他方括号或这样的拼写错误时,大多数情况下我会遇到语法错误.但是有些情况是这样的:

When I use IEx and make a typo like additional bracket or ", then most of the time I get a syntax error. But there are cases like this one:

iex(3)> Enum.each '12345', &(IO.puts(&1"))    
...(3)> end   
...(3)> )   
...(3)> '    
...(3)> end    
...(3)> ""    
...(3)> ... ? How to produce syntax error ?    
...(3)>     
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded    
      (v)ersion (k)ill (D)b-tables (d)istribution   

我无法犯语法错误,无法重新开始,必须重新启动整个IEx.是否有任何键盘快捷键或命令可跳过执行当前的iex(3)并转到下一个iex(4)?

I cannot make a syntax error and continue from scratch and I have to relaunch entire IEx.Is there any keyboard shortcut or command to skip performing current iex(3) and go to next iex(4)?

推荐答案

#iex:break

iex(1)> Enum.each '12345', &(IO.puts(&1"))    
...(1)> ...
...(1)> #iex:break

** (TokenMissingError) iex:1: incomplete expression

这篇关于IEx-如何取消多行命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 17:44