skip/2 was using user_input

This commit is contained in:
Vítor Santos Costa 2015-11-11 08:45:03 +00:00
parent edd5c007c8
commit 2466db7ff5
9 changed files with 31096 additions and 15 deletions

0
OPTYap/ Normal file
View File

15552
docs/my.yap Normal file

File diff suppressed because it is too large Load Diff

15509
docs/yapdocs.yap Normal file

File diff suppressed because it is too large Load Diff

4
misc/gengroups Normal file
View File

@ -0,0 +1,4 @@
grep -nHR -e group ../pl ../C ../H ../packages ../library | \
grep '(@|\\)'| \
grep -v \#| \
grep -v ^grep

View File

@ -1,7 +1,6 @@
x#!/usr/local/bin/yap -L -- *
#!/usr/local/bin/yap -L -- $*
#.
:- style_check(all).
:- yap_flag( write_strings, on).
@ -20,7 +19,9 @@ x#!/usr/local/bin/yap -L -- *
:- yap_flag( double_quotes, string ).
%:- yap_flag( dollar_as_lower_case, on ).
:- dynamic edge/1,
:- dynamic
node/4,
edge/1,
public/2,
private/2,
module_on/3,
@ -50,7 +51,7 @@ inline( []/0 ).
%
main :-
init,
init,
fail.
main :-
unix(argv([D])),
@ -74,7 +75,6 @@ main :-
c_links,
mkdocs.
init :-
retractall(dir(_)),
retractall(edge(_)),
@ -211,7 +211,7 @@ clinks(S) :-
format( S, 'mod( ~q , ~q ).~n', [NM, F] ),
fail.
clinks(S) :-
system_predicate(C),
system_predicate(C),
functor(C, N, A),
format( S, 'sys ~q/~d.~n', [N, A] ),
fail.
@ -223,7 +223,7 @@ clinks(S) :-
% S1 =.. [F1| Args],
% numbervars(Args, 0, _),
format( S, '% ~q <- ~q.~n~q:~q imports ~q:~q. ~n', [Fi0, Fi1, M,F/A, M1,F1/A] ),
fail.
fail.
clinks(S) :-
close(S).
@ -620,11 +620,11 @@ decl(I0, I) -->
skip_early_comment(C) -->
[C], !,
skip_early_comment(C).
skip_early_comment(C) -->
skip_early_comment(C) -->
( " " ; "\t" ; "\n" ), !,
skip_early_comment(C).
skip_early_comment(C) -->
"@" ( "{" ; "}" ), !,
"@", ( "{" ; "}" ), !,
skip_early_comment(C).
skip_early_comment(_) --> [].

1
misc/tmp/foreigns.yap Normal file
View File

@ -0,0 +1 @@
sys working_directory/2.

View File

@ -18,7 +18,11 @@
static char SccsId[] = "%W% %G%";
#endif
/** Aliases
/**
* @group
*
*
* Aliases:
* This file defines the main operations on aliases, a second name for a file. Aliases are always
* textual constants (atoms).
*
@ -115,6 +119,16 @@ static char SccsId[] = "%W% %G%";
static Atom FetchAlias (int sno);
static bool ExistsAliasForStream (int sno, Atom al);
/**
* Specify an alias to the stream. The alias <tt>Name</tt> must be an atom. The
* alias can be used instead of the stream descriptor for every operation
* concerning the stream.
*
* @param + _tname_ Name of Alias
* @param + _tstream_ stream identifier
*
* @return
*/
static Int add_alias_to_stream (USES_REGS1)
{
Term tname = Deref(ARG1);

View File

@ -579,7 +579,7 @@ static Int put_byte_1(USES_REGS1) { /* '$put_byte'(Stream,N) */
return (TRUE);
}
static Int skip_1(USES_REGS1) { /* '$skip'(Stream,N) */
static Int skip_1(USES_REGS1) { /* 'skip'(N) */
Int n;
Term t2;
int sno;
@ -607,9 +607,11 @@ static Int skip_1(USES_REGS1) { /* '$skip'(Stream,N) */
static Int skip(USES_REGS1) { /* '$skip'(Stream,N) */
Int n;
Term t2;
int sno;
int sno = Yap_CheckTextStream(ARG1, Input_Stream_f, "skip/2");
int ch;
if (sno < 0)
return (FALSE);
if (IsVarTerm(t2 = Deref(ARG2))) {
Yap_Error(INSTANTIATION_ERROR, t2, "skip/2");
return FALSE;
@ -620,7 +622,6 @@ static Int skip(USES_REGS1) { /* '$skip'(Stream,N) */
Yap_Error(DOMAIN_ERROR_OUT_OF_RANGE, t2, "skip/2");
return FALSE;
}
sno = LOCAL_c_input_stream;
LOCK(GLOBAL_Stream[sno].streamlock);
while ((ch = GLOBAL_Stream[sno].stream_wgetc(sno)) != n && ch != -1)
;

View File

@ -671,8 +671,8 @@ system_predicate(A,T1) :-
Defines the relation: _P_ is a currently defined system predicate.
*/
system_predicate(P) :-
strip_module(M, P),
system_predicate(P0) :-
strip_module(P0, M, P),
system_predicate(_, M:P).