Skip to content

Commit

Permalink
Improve error messages in ulex parsing
Browse files Browse the repository at this point in the history
This partially addresses issue Attempto#2. Malformed file errors will display
the line number of the line that is causing the error.
  • Loading branch information
petekeller2 committed Sep 8, 2018
1 parent a110cc9 commit b7b530d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion prolog/lexicon/ulex.pl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
),
_CatchType,
(
with_output_to(atom(Message), format("The user lexicon file is not a valid Prolog file.", [])),
line_count(LexiconStream, MalformedLine),
atom_concat("The use lexicon file is not a valid Prolog file. Check line ", MalformedLine, RepairMessage),
with_output_to(atom(Message), format(RepairMessage, [])),
add_error_message_once(lexicon, '', 'Malformed file.', Message)
)
),
Expand Down

0 comments on commit b7b530d

Please sign in to comment.