0
我已经使用画布在CoffeScript中开始了一个小游戏。 我的问题是这样的错误:CoffeeScript中意外的输入结束
coffee -c -o lib/ src/
/src/interface.coffee:8:48: error: unexpected end of input
@ctx.clearRect 0, 0, @size[0], @size[1]
^
我已经重写了很多次,但还是不希望编译。 下面是代码:
class Interface:
constructor : (id) ->
@canvas = document.getElementById "#{id}"
@ctx = @canvas.getContext "2d"
@size = [@canvas.width, @canvas.height]
clear :() ->
@ctx.clearRect 0, 0, @size[0], @size[1]
哦,有人可以告诉我,正是这种错误意味着什么?
预先感谢您。
你能发布整个文件吗?这可能是一个未终止的报价。 'Interface'后冒号为 – justMiles
。 –
@justMiles这是整个文件 –