@@ -14,20 +14,20 @@ if tty.isatty(process.stdout.fd)
14
14
VERBOSE = true
15
15
16
16
if process .argv .length < 4
17
- console .error JSON .stringify {errors : [{id : " NOARGS" }]}
17
+ console .error JSON .stringify {errors : [{raw : " NOARGS" }]}
18
18
process .exit 1
19
19
20
20
try
21
21
filename = process .argv [2 ]
22
22
script = fs .readFileSync filename, ' utf8'
23
23
catch e
24
- console .error JSON .stringify {errors : [{id : " NOTFOUND" }]}
24
+ console .error JSON .stringify {errors : [{raw : " NOTFOUND" }]}
25
25
process .exit 1
26
26
27
27
try
28
28
overrideDetails = JSON .parse process .argv [3 ]
29
29
catch e
30
- console .error JSON .stringify {errors : [{id : " INVALIDJSON" }]}
30
+ console .error JSON .stringify {errors : [{raw : " INVALIDJSON" }]}
31
31
process .exit 1
32
32
33
33
if process .argv .length > 4
@@ -47,7 +47,7 @@ script = script.replace re, (header) ->
47
47
details = JSON .parse matches[1 ]
48
48
return " "
49
49
unless details?
50
- console .error JSON .stringify {errors : [{id : " NOHEADER" }]}
50
+ console .error JSON .stringify {errors : [{raw : " NOHEADER" }]}
51
51
process .exit 1
52
52
lines2 = script .split (" \n " ).length
53
53
lineDiff = lines2 - lines
@@ -57,7 +57,7 @@ for k,v of overrideDetails
57
57
58
58
id = parseInt details .id
59
59
if isNaN (id) or ! isFinite (id)
60
- console .error JSON .stringify {errors : [{id : " IDNAN" }]}
60
+ console .error JSON .stringify {errors : [{raw : " IDNAN" }]}
61
61
process .exit 1
62
62
63
63
# Alias dependencies.
@@ -275,7 +275,7 @@ walk = (ast) ->
275
275
try
276
276
ast = parser .parse script
277
277
catch e
278
- console .error JSON .stringify {errors : [{id : " PARSEFAIL" ,message : e .message ,line : e .line - lineDiff,col : e .col }]}
278
+ console .error JSON .stringify {errors : [{raw : " PARSEFAIL" ,reason : e .message ,line : e .line - lineDiff,col : e .col }]}
279
279
if VERBOSE
280
280
console .log util .inspect e, false , null , true
281
281
process .exit 1
@@ -327,7 +327,11 @@ unless ok
327
327
line : error .line
328
328
character : error .character
329
329
evidence : error .evidence
330
- if entry .reason is " Confusing use of '!'."
330
+ okayReasons = [
331
+ " Confusing use of '!'."
332
+ " Expected 'String' and instead saw ''''."
333
+ ]
334
+ if okayReasons .indexOf (entry .reason ) isnt - 1
331
335
out .warnings .push entry
332
336
else
333
337
out .errors .push entry
0 commit comments