Removing pprint dependency
This commit is contained in:
parent
01bed35ca1
commit
353ef05902
|
@ -1,6 +1,6 @@
|
|||
#lang racket
|
||||
(require racket/list
|
||||
(except-in (planet dherman/pprint:4) empty)
|
||||
"private/pprint.rkt"
|
||||
"ast.rkt"
|
||||
"pretty.rkt"
|
||||
"runtime.rkt")
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
(require (for-syntax racket/base
|
||||
"../private/compiler.rkt")
|
||||
"../pretty.rkt"
|
||||
(only-in (planet dherman/pprint:4)
|
||||
pretty-print))
|
||||
"../private/pprint.rkt")
|
||||
|
||||
(define (print-result value)
|
||||
(if (void? value)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#lang racket
|
||||
(require (planet dherman/pprint:4)
|
||||
(require "private/pprint.rkt"
|
||||
"ast.rkt")
|
||||
|
||||
(define (format-datum s)
|
||||
|
|
23
collects/datalog/private/pprint.rkt
Normal file
23
collects/datalog/private/pprint.rkt
Normal file
|
@ -0,0 +1,23 @@
|
|||
#lang racket
|
||||
(provide (all-defined-out))
|
||||
|
||||
(define (pretty-print s) (display s) (newline))
|
||||
(define (pretty-format s) s)
|
||||
|
||||
(define (text s) s)
|
||||
(define (h-append . ss) (apply string-append ss))
|
||||
(define (v-concat/s ss)
|
||||
(apply string-append (add-between ss "\n")))
|
||||
(define (v-concat ss)
|
||||
(v-concat/s ss))
|
||||
(define (apply-infix d ds)
|
||||
(add-between ds d))
|
||||
(define line "\n")
|
||||
(define comma ",")
|
||||
(define space " ")
|
||||
(define lparen "(")
|
||||
(define rparen ")")
|
||||
(define dot ".")
|
||||
(define (nest n d) d)
|
||||
(define char string)
|
||||
(define doc? string?)
|
|
@ -3,8 +3,7 @@
|
|||
scribble/eval
|
||||
scribble/basic
|
||||
scribble/bnf
|
||||
(for-label (planet dherman/pprint:4)
|
||||
racket/base
|
||||
(for-label racket/base
|
||||
racket/contract
|
||||
"../main.rkt")
|
||||
"utils.rkt")
|
||||
|
@ -26,7 +25,7 @@ on tabling intermediate results ensures that all queries terminate.
|
|||
|
||||
The easiest way to get started using Datalog for PLT Scheme is with the main module:
|
||||
|
||||
@defmodule/this-package[]
|
||||
@defmodule[datalog]
|
||||
|
||||
This module provides everything in the entire package. Subsequent sections of this
|
||||
manual describe the functionality of the individual libraries included, which can also be
|
||||
|
@ -47,7 +46,6 @@ parent(ebbon, bob).
|
|||
ancestor(A, B)?
|
||||
END
|
||||
)
|
||||
(require (planet dherman/pprint))
|
||||
(pretty-print
|
||||
(format-program
|
||||
(parse-program
|
||||
|
@ -68,7 +66,7 @@ the REPL.
|
|||
|
||||
Datalog is also available as a module language. This can be used by beginning a Datalog source file with the line:
|
||||
|
||||
@(racket #,(hash-lang) planet #,(this-package-version-symbol))
|
||||
@defmodulelang[datalog]
|
||||
|
||||
You can omit the PLaneT version numbers if you prefer. Programs without the version number
|
||||
do not need to be updated when this PLaneT package is upgraded. However, it is then the
|
||||
|
@ -176,7 +174,7 @@ Unlike Prolog, the order in which clauses are asserted is irrelevant. All querie
|
|||
|
||||
This library provides the structures that represent Datalog syntax. It can be required via:
|
||||
|
||||
@defmodule/this-package[ast]
|
||||
@defmodule[datalog/ast]
|
||||
|
||||
@defthing[srcloc/c contract?]{
|
||||
Contract for the third argument to @racket[datum->syntax].
|
||||
|
@ -327,7 +325,7 @@ This library provides the structures that represent Datalog syntax. It can be re
|
|||
|
||||
This library provides facilities for parsing Datalog source. It can be required via:
|
||||
|
||||
@defmodule/this-package[parse]
|
||||
@defmodule[datalog/parse]
|
||||
|
||||
@subsection{Datalog Syntax}
|
||||
|
||||
|
@ -488,7 +486,7 @@ The following BNF describes the syntax of Datalog.
|
|||
|
||||
This package recognizes an alternative, Scheme-like front-end syntax for Datalog. It can be required via:
|
||||
|
||||
@defmodule/this-package[sexp]
|
||||
@defmodule[datalog/sexp]
|
||||
|
||||
@subsection{Parenthetical Datalog Syntax}
|
||||
|
||||
|
@ -544,13 +542,7 @@ This package recognizes an alternative, Scheme-like front-end syntax for Datalog
|
|||
|
||||
This library provides facilities for pretty-printing Datalog source. It can be required via:
|
||||
|
||||
@defmodule/this-package[pretty]
|
||||
|
||||
This library depends on the @tt{pprint} PLaneT package, which can be required via:
|
||||
|
||||
@racketblock[(require (planet dherman/pprint:4))]
|
||||
|
||||
See the documentation for @tt{pprint} for information on how to use it.
|
||||
@defmodule[datalog/pretty]
|
||||
|
||||
@defproc[(format-datum [d datum/c])
|
||||
doc?]{
|
||||
|
@ -734,7 +726,7 @@ See the documentation for @tt{pprint} for information on how to use it.
|
|||
|
||||
This library implements the Datalog runtime system. It can be required via:
|
||||
|
||||
@defmodule/this-package[runtime]
|
||||
@defmodule[datalog/runtime]
|
||||
|
||||
@defthing[theory/c contract?]{
|
||||
A contract for @deftech{theories}.
|
||||
|
@ -837,7 +829,7 @@ This library implements the Datalog runtime system. It can be required via:
|
|||
|
||||
This library provides facilities for evaluating Datalog. It can be required via:
|
||||
|
||||
@defmodule/this-package[eval]
|
||||
@defmodule[datalog/eval]
|
||||
|
||||
@defthing[current-theory (parameter/c mutable-theory/c)]{
|
||||
The @tech{theory} used by @racket[eval-program] and @racket[eval-stmt].
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#lang racket
|
||||
(require rackunit
|
||||
(planet dherman/pprint:4)
|
||||
"../private/pprint.rkt"
|
||||
"../parse.rkt"
|
||||
"../pretty.rkt")
|
||||
(provide pretty-tests)
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
"../pretty.rkt"
|
||||
"../eval.rkt"
|
||||
"../runtime.rkt"
|
||||
(only-in (planet dherman/pprint:4)
|
||||
pretty-print)
|
||||
"../private/pprint.rkt"
|
||||
(for-template "../lang/lang.rkt"))
|
||||
(provide tool@)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user