Small patch for library pio

This commit is contained in:
notoria
2020-04-26 14:54:20 +02:00
parent ae2402f4a7
commit 9b1272da51
2 changed files with 52 additions and 32 deletions

View File

@@ -3,5 +3,9 @@
:- use_module(library(dcgs)).
phrase_from_file(NT, File) :-
'$file_to_chars'(File, Chars),
phrase(NT, Chars).
( var(File) -> throw(error(instantiation_error, phrase_from_file/2))
; (\+ atom(File) ; File = []) ->
throw(error(domain_error(source_sink, File), phrase_from_file/2))
; '$file_to_chars'(File, Chars),
phrase(NT, Chars)
).