Mark Thom
7260eba26a
allow module export of nonterminals ( #281 )
2020-03-13 15:40:03 -06:00
Mark Thom
7e7a1b2caf
properly handle '\n' when quoted and not ( #283 , #280 )
2020-03-13 15:32:56 -06:00
Mark Thom
99181e3302
fix -names ( #275 )
2020-03-13 13:49:12 -06:00
Mark Thom
d57d2b96d6
Revert "fix $VAR-names ( #275 ) and properly print single control chars ( #280 )"
...
This reverts commit d3eb31e4c3 .
2020-03-13 13:47:58 -06:00
Markus Triska
24bed8c548
ADDED: library(format), describing strings with format_//2
...
This library provides the nonterminal format_//2 to describe
formatted strings. format/2 is provided for impure output.
Usage:
======
phrase(format_(FormatString, Arguments), Ls)
format_//2 describes a list of characters Ls that are formatted
according to FormatString. FormatString is a string (i.e.,
a list of characters) that specifies the layout of Ls.
The characters in FormatString are used literally, except
for the following tokens with special meaning:
~w use the next available argument from Arguments here,
which must be atomic (a current limitation)
~f use the next argument here, a floating point number
~Nf where N is an integer: format the float argument
using N digits after the decimal point
~s use the next argument here, which must be a string
~N| where N is an integer: place a tab stop at text column N
~N+ where N is an integer: place a tab stop N characters
after the previous tab stop (or start of line)
~t distribute spaces evenly between the two closest tabstops
~`Ct like ~t, use character C instead of spaces to fill the space
~n newline
~~ the literal ~
The predicate format/2 is like format_//2, except that it outputs
the text on the terminal instead of describing it declaratively.
If at all possible, format_//2 should be used, to stress pure parts
that enable easy testing etc. If necessary, you can emit the list Ls
with maplist(write, Ls).
The entire library only works if the Prolog flag double_quotes
is set to chars, the default value in Scryer Prolog. This should
also stay that way, to encourage a sensible environment.
Example:
?- phrase(format_("~s~n~`.t~w!~12|", ["hello",there]), Cs).
%@ Cs = [h,e,l,l,o,'\n','.','.','.','.','.','.',t,h,e,r,e,!] ;
%@ false.
2020-03-13 20:46:53 +01:00
Mark Thom
6c9e704aa8
sort variables in findall_with_existential before computing set difference ( #282 ), trawl back changes of ( #279 )
2020-03-13 13:18:47 -06:00
Mark Thom
d3eb31e4c3
fix $VAR-names ( #275 ) and properly print single control chars ( #280 )
2020-03-13 02:48:40 -06:00
Mark Thom
698b01f85a
give new answer variables readable names ( #279 )
2020-03-13 02:40:06 -06:00
Mark Thom
4c88e97330
add current_output, printing of stream terms
2020-03-11 00:38:01 -06:00
Mark Thom
25babff827
add streams.rs, consume them in place of the old PrologStream
2020-03-09 11:56:16 -06:00
Mark Thom
23e833c69e
update README.md
2020-03-08 18:02:06 -06:00
Mark Thom
22bb3fe876
replace termion with crossterm
2020-03-08 18:01:54 -06:00
Mark Thom
eee10d3ee7
fix broken conformity tests, quote left paren
2020-03-08 16:49:47 -06:00
Mark Thom
c7591045af
represent the current_dir as an absolute path, not a relative one. ( #262 )
2020-03-07 16:00:10 -07:00
Mark Thom
6ddfef6383
count single character atoms as characters when generating first argument indices
2020-03-06 21:19:53 -07:00
Mark Thom
9852e30b39
compare characters directly in term comparison tests
2020-03-05 12:50:11 -07:00
Mark Thom
2d3ce32314
switch to representation error for partial strings ( #267 )
2020-03-01 23:21:35 -07:00
Mark Thom
d8e0bea110
correct handling of strings and partial strings as lists, print bar operator with surrounding spaces ( #274 )
2020-03-01 00:00:40 -07:00
Mark Thom
b2cf6a6ea8
update README
2020-02-29 15:23:48 -07:00
Mark Thom
2ebcd673c8
add s pointers for strings and partial strings, put_unsafe_value calls store earlier to avoid unnecessary heap writes ( #273 )
2020-02-28 23:42:40 -07:00
Mark Thom
aa5f186a96
allow set_prolog_flag in declarations
2020-02-28 21:42:22 -07:00
Mark Thom
934f73f696
remove cyclic_term/1
2020-02-27 16:19:48 -07:00
Mark Thom
993c6f0e7b
actually do lco, and mark unsafe variables before the goals where they last occur, not just in the last goal
2020-02-27 16:17:20 -07:00
Mark Thom
1d79e22468
mention rustup.rs in README ( #261 )
2020-02-23 13:22:56 -07:00
Mark Thom
8ba92d8b99
update prolog_parser version, allow ('|') operator in DCGs ( #274 )
2020-02-23 13:16:14 -07:00
Mark Thom
af23258152
remove setof/3, bagof/3 non-determinism ( #270 )
2020-02-22 15:13:01 -07:00
Mark Thom
b2e50b42a3
rename non_iso.pl to iso_ext.pl ( #265 )
2020-02-22 00:58:37 -07:00
Mark Thom
003b4d0218
add comparisons between partial strings and string constants ( #263 )
2020-02-22 00:51:27 -07:00
Mark Thom
545472f9c4
correct misreported error in toplevel loop ( #272 )
2020-02-21 21:09:59 -07:00
Mark Thom
8f781c27f9
remove same_length/2 from clpb.pl
2020-02-21 17:21:15 -07:00
Mark Thom
589dc34b99
make partial strings accept characters ( #268 )
2020-02-21 13:08:03 -07:00
Mark Thom
564622e38b
partial_string/3 should accept empty lists ( #264 )
2020-02-21 12:55:33 -07:00
Mark Thom
d3744d6f66
identify ground partial strings under (==) ( #269 )
2020-02-21 12:51:23 -07:00
Mark Thom
2613ef0633
adopt compatibility predicates from clpb and clpz into lists and pairs libraries
2020-02-21 12:48:15 -07:00
Mark Thom
be3cdcd71a
fix #255 (I think?)
2020-02-21 01:02:52 -07:00
Mark Thom
d48ac09e25
correct PStrLocation offset bug in copier.rs
2020-02-20 10:59:42 -07:00
Mark Thom
e5a0ba7bf3
revert to older between.pl
2020-02-20 10:07:45 -07:00
Mark Thom
eb1980d286
Merge branch 'master' of https://github.com/mthom/rusty-wam
v0.8.118
2020-02-19 21:44:18 -07:00
Mark Thom
424af312e5
update Cargo.lock and toml version
2020-02-19 21:42:39 -07:00
Mark Thom
a2a4c78c9a
update README
2020-02-19 21:38:19 -07:00
Mark Thom
0457b38e41
add redone partial strings ( #24 , #95 )
2020-02-19 21:34:09 -07:00
Mark Thom
617f803355
update between/3 to allow inf as upper bound
2020-02-19 15:55:56 -07:00
Mark Thom
d3da2683cb
stop applying (=..)/2 to variables in tabling/trie.pl
2020-02-19 14:43:06 -07:00
Mark Thom
d97c670fcd
Merge pull request #258 from aarroyoc/master
...
add n as an option to get the next solution
2020-02-19 12:10:48 -04:00
Mark Thom
8902bcb5ab
use raw_block.rs for the heap backend
2020-02-16 16:30:36 -07:00
Mark Thom
5f51e264f2
change raw_vec to raw_block to avoid clashes with liballoc package
2020-02-13 20:05:46 -07:00
Mark Thom
1c4e2c0ed6
allow the frontier of the RawVec to be offset by a trait function
2020-02-12 23:52:30 -07:00
Mark Thom
5a6333129b
move bump allocation logic to its own module
2020-02-12 23:34:05 -07:00
Mark Thom
969bd8f82c
remove partial strings, but represent strings as lists when warranted by double_quotes
2020-02-12 22:12:42 -07:00
Adrián Arroyo Calle
a732bc9dc4
add n as an option to get the next solution
2020-02-10 17:51:26 +01:00