ford-fusion: report syntax errors

This commit is contained in:
Ted Blackman 2020-04-16 09:55:48 -04:00
parent 241a7165d4
commit ea23be3973

View File

@ -2959,17 +2959,30 @@
++ parse-pile ++ parse-pile
|= [=path tex=tape] |= [=path tex=tape]
^- pile ^- pile
~| parse-fail+path :: TODO: better error reporting =/ [=mont =nail] (parse-mont path tex)
=/ [=mont =nail] (parse-mont tex)
=/ [=hair res=(unit [src=(list hoon) ^nail])] =/ [=hair res=(unit [src=(list hoon) ^nail])]
((most gap tall:(vang & path)) nail) ((most gap tall:(vang & path)) nail)
[mont tssg+src:(need res)] ?^ res [mont tssg+src:(need res)]
%- mean
=/ lyn p.hair
=/ col q.hair
:~ leaf+"syntax error at [{<lyn>} {<col>}] in {<path>}"
leaf+(trip (snag (dec lyn) (to-wain:format (crip tex))))
leaf+(runt [(dec col) '-'] "^")
==
:: ::
++ parse-mont ++ parse-mont
|= tex=tape |= [=path tex=tape]
^- [mont nail] ^- [mont nail]
=/ [=hair res=(unit [=mont =nail])] (mont-rule [1 1] tex) =/ [=hair res=(unit [=mont =nail])] (mont-rule [1 1] tex)
(need res) :: TODO: better error reporting ?^ res u.res
%- mean
=/ lyn p.hair
=/ col q.hair
:~ leaf+"syntax error in imports at [{<lyn>} {<col>}] in {<path>}"
leaf+(trip (snag (dec lyn) (to-wain:format (crip tex))))
leaf+(runt [(dec col) '-'] "^")
==
:: ::
++ mont-rule ++ mont-rule
%+ ifix [gay gay] %+ ifix [gay gay]