エラーレポート
Stylusは、構文、解析、および評価エラーに対して、スタックトレース、行番号、ファイル名を含む包括的なエラーレポートを組み込みで提供します。
構文エラー
構文エラーの例
body
form input
== padding 5px
body
form input
== padding 5px
Yielding (意味が不明瞭なためそのまま残します。文脈に合わせて適切な訳語を選択してください)
ParseError: test.styl:3:16
1| body
2| form input
3| == padding 5px
---------------------^
4|
illegal unary "==", missing left-hand operand
ParseError: test.styl:3:16
1| body
2| form input
3| == padding 5px
---------------------^
4|
illegal unary "==", missing left-hand operand
評価エラー
この「ランタイム」または評価エラーは、期待される`Unit`(ヘルパー関数`ensure(n, 'unit')`を使用)ではなく、文字列を`border-radius()`に渡すことによって発生します。
ensure(val, type)
unless val is a type
error('expected a ' + type + ', but got ' + typeof(val))
border-radius(n)
ensure(n, 'unit')
-webkit-border-radius n
-moz-border-radius n
border-radius n
body
border-radius '5px'
ensure(val, type)
unless val is a type
error('expected a ' + type + ', but got ' + typeof(val))
border-radius(n)
ensure(n, 'unit')
-webkit-border-radius n
-moz-border-radius n
border-radius n
body
border-radius '5px'
Yielding (意味が不明瞭なためそのまま残します。文脈に合わせて適切な訳語を選択してください)
Error: test.styl:3:62
1| ensure(val, type)
2| unless val is a type
3| error('expected a ' + type + ', but got ' + typeof(val))
-------------------------------------------------------------------^
4|
5| border-radius(n)
6| ensure(n, 'unit')
expected a unit, but got string
at ensure() (test.styl:2:17)
at border-radius() (test.styl:6:16)
at "body" (test.styl:10:18)
Error: test.styl:3:62
1| ensure(val, type)
2| unless val is a type
3| error('expected a ' + type + ', but got ' + typeof(val))
-------------------------------------------------------------------^
4|
5| border-radius(n)
6| ensure(n, 'unit')
expected a unit, but got string
at ensure() (test.styl:2:17)
at border-radius() (test.styl:6:16)
at "body" (test.styl:10:18)