Coffeescript不匹配的outdent错误 [英] Coffeescript unmatched outdent error

查看:554
本文介绍了Coffeescript不匹配的outdent错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试编译以下coffeescript代码时,我得到第9行上的错误 SyntaxError:Unmatched OUTDENT 。我不知道我做错了什么。缩进看起来是正确的,我有我想要的一切。

I'm getting the error SyntaxError: Unmatched OUTDENT on line 9 when I try to compile the following coffeescript code. I'm not sure what I'm doing wrong. the indentation seems to be right, and I have everything where I want it.

row_possibilities = (grid) ->
  for rows in [0..8] by 1
    for columns in [0..8] by 1
      if(Array.isArray(grid[rows][columns])
        for possible_val in grid[rows][columns] by 1
          grid = unique_row_possibility(grid, rows, columns, possible_val)
          if(Array.isArray(grid[rows][columns]) == false)
            break
  return grid

代码应该做的是

在所有的for循环运行后,我想返回变量grid。 double check the spacing,and I try it out on repl.it,but I do not make it out。

After all the for loops run. I want to return the variable grid. I've double checked the spacing, and I tried it out on repl.it, but I can't figure it out.

推荐答案

比较难看,但似乎你缺少一个右括号在第4行:

A bit tough to see but it appears that you are missing a closing parenthesis on line 4:

if(Array.isArray(grid[rows][columns])

一般来说,对于这个特定错误,问题几乎总是缩进或不平衡的括号或括号/大括号。

In general, for this particular error, the problem will almost always lie with indention or unbalanced parenthesis or brackets/braces.

这篇关于Coffeescript不匹配的outdent错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆