【发布时间】:2020-04-24 02:33:30
【问题描述】:
手写笔代码:
Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
width {$width}px
height {$height}px
background-position -{$positiveXCoordinate}px -{$positiveYCoordinate}px
错误:
157| Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
158| width {$width}px
159| height {$height}px
160| background-position -{$positiveXCoordinate}px -{$positiveYCoordinate}px
161|
--------^
expected "indent", got "outdent"
- 如果从文件中删除上述代码,错误将消失。
- IDE 自动在文件末尾添加行(但由于前面的子句,这似乎不是原因)
- Stylus online 也不编译。
我试图找到文件中的所有空格:
更新:实验
作品:
Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
width 2px
expected "indent", got "outdent" 失败:
Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
width {$width}px
看起来插值无效,我没有找到示例,在这种情况下如何插值。
【问题讨论】:
-
如果您在缩进中混合使用制表符和空格,可能会导致错误消息。
-
@AliAli,感谢您的评论。也许你是对的,但我还没有确认。我将实验结果添加到问题字段中。