ford: print source line on syntax error

This commit is contained in:
lukechampine 2020-04-08 21:11:15 -04:00
parent c570def06a
commit cb4cae01c8

View File

@ -3165,10 +3165,12 @@
?~ q.parsed ?~ q.parsed
=/ =path (rail-to-path source-rail) =/ =path (rail-to-path source-rail)
%- return-error %- return-error
:- :- %leaf =/ lyn p.p.parsed
%+ weld "ford: %hood: syntax error at " =/ col q.p.parsed
"[{<p.p.parsed>} {<q.p.parsed>}] in {<path>}" :~ leaf+(runt [(dec col) '-'] "^")
~ leaf+(trip (snag (dec lyn) (to-wain:format q.q.as-cage)))
leaf+"ford: %hood: syntax error at [{<lyn>} {<col>}] in {<path>}"
==
:: ::
(return-result %success %hood p.u.q.parsed) (return-result %success %hood p.u.q.parsed)
:: ::