Compare commits
9 Commits
samth/mast
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
36c1047c48 | ||
![]() |
56120371b4 | ||
![]() |
7a01fad928 | ||
![]() |
864d8b110e | ||
![]() |
28547d4d79 | ||
![]() |
7364ed6b29 | ||
![]() |
7f222c8c50 | ||
![]() |
963de56ea8 | ||
![]() |
d254963487 |
26
.travis.yml
26
.travis.yml
|
@ -8,24 +8,32 @@ env:
|
|||
- PATH="$RACKET_DIR/bin:$PATH"
|
||||
matrix:
|
||||
# RACKET_VERSION is an argument to install-racket.sh
|
||||
- RACKET_VERSION=6.6
|
||||
- RACKET_VERSION=6.7
|
||||
- RACKET_VERSION=6.8
|
||||
- RACKET_VERSION=RELEASE
|
||||
- RACKET_VERSION=HEAD
|
||||
- RACKET_VERSION=7.0 COVER=true
|
||||
- RACKET_VERSION=7.1 COVER=true
|
||||
- RACKET_VERSION=7.2 COVER=true
|
||||
- RACKET_VERSION=7.3 COVER=true
|
||||
- RACKET_VERSION=7.4 COVER=true
|
||||
- RACKET_VERSION=7.5 COVER=true
|
||||
- RACKET_VERSION=7.6 COVER=true
|
||||
- RACKET_VERSION=7.7 COVER=true
|
||||
- RACKET_VERSION=7.8 COVER=true
|
||||
- RACKET_VERSION=7.9 COVER=true
|
||||
- RACKET_VERSION=8.0 COVER=true
|
||||
- RACKET_VERSION=8.0 COVER=true RACKET_CS=1
|
||||
- RACKET_VERSION=HEAD COVER=true
|
||||
|
||||
before_install:
|
||||
- curl -L https://raw.githubusercontent.com/greghendershott/travis-racket/master/install-racket.sh | bash
|
||||
- raco pkg install --deps search-auto doc-coverage cover cover-codecov # or cover-coveralls
|
||||
- if $COVER; then raco pkg install --deps search-auto doc-coverage cover cover-codecov; fi # or cover-coveralls
|
||||
|
||||
install:
|
||||
- raco pkg install --deps search-auto -j 2 phc-adt/ phc-adt-doc/ phc-adt-lib/ phc-adt-test/
|
||||
- raco pkg install --deps search-auto -j 1 phc-adt/ phc-adt-doc/ phc-adt-lib/ phc-adt-test/
|
||||
|
||||
script:
|
||||
- raco test -r -p phc-adt phc-adt-doc phc-adt-lib phc-adt-test
|
||||
- raco setup --check-pkg-deps --no-zo --no-launcher --no-install --no-post-install --no-docs --pkgs phc-adt phc-adt-doc phc-adt-lib phc-adt-test
|
||||
- raco doc-coverage phc-adt
|
||||
- raco cover -s main -s test -s doc -f codecov -f html -d ~/coverage . || true
|
||||
- if $COVER; then raco doc-coverage phc-adt; fi
|
||||
- if $COVER; then raco cover -s main -s test -s doc -f codecov -f html -d ~/coverage . || true; fi
|
||||
# TODO: add an option to cover to run the "outer" module too, not just the submodules.
|
||||
# TODO: deploy the coverage info.
|
||||
#
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[](https://travis-ci.org/jsmaniac/phc-adt)
|
||||
[](https://codecov.io/gh/jsmaniac/phc-adt)
|
||||
[](https://travis-ci.org/jsmaniac/phc-adt)
|
||||
[](https://codecov.io/gh/jsmaniac/phc-adt)
|
||||
[](http://jsmaniac.github.io/travis-stats/#jsmaniac/phc-adt)
|
||||
[](http://docs.racket-lang.org/phc-adt/)
|
||||
[](https://github.com/jsmaniac/phc-adt/issues)
|
||||
|
|
|
@ -22,4 +22,4 @@
|
|||
"datatype"))
|
||||
(define pkg-desc "Algebraic Datatypes tailored for writing compilers (documentation only)")
|
||||
(define version "1.1")
|
||||
(define pkg-authors '("Georges Dupéron"))
|
||||
(define pkg-authors '(|Suzanne Soy|))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scribble/manual
|
||||
|
||||
@title{Algebraic Data Types for compilers: Implementation}
|
||||
@author[@author+email["Georges Dupéron" "georges.duperon@gmail.com"]]
|
||||
@author[@author+email["Suzanne Soy" "racket@suzanne.soy"]]
|
||||
|
||||
This library is implemented using literate programming. The implementation
|
||||
details are presented in the following sections. The user documentation is in
|
||||
|
|
|
@ -22,4 +22,4 @@
|
|||
"scribble-math"))
|
||||
(define pkg-desc "Algebraic Datatypes tailored for writing compilers (tests are in phc-adt-test)")
|
||||
(define version "1.1")
|
||||
(define pkg-authors '("Georges Dupéron"))
|
||||
(define pkg-authors '(|Suzanne Soy|))
|
||||
|
|
|
@ -104,11 +104,11 @@ same if the @tc[database] and @tc[index] is the same for both nodes.
|
|||
(eq? (raw-node-database a) (raw-node-database b))
|
||||
(equal? (raw-node-index a) (raw-node-index b))))
|
||||
(λ (a r)
|
||||
(fxxor (eq-hash-code (raw-node-database a))
|
||||
(r (raw-node-index a))))
|
||||
(bitwise-xor (eq-hash-code (raw-node-database a))
|
||||
(r (raw-node-index a))))
|
||||
(λ (a r)
|
||||
(fxxor (eq-hash-code (raw-node-database a))
|
||||
(r (raw-node-index a)))))]
|
||||
(bitwise-xor (eq-hash-code (raw-node-database a))
|
||||
(r (raw-node-index a)))))]
|
||||
|
||||
The following function can then be used to test if two nodes are the same, based
|
||||
on the contents of their @tc[raw] field:
|
||||
|
@ -221,7 +221,7 @@ them with a special marker.
|
|||
|
||||
@chunk[<node-hash>
|
||||
(: node-hash (∀ (fieldᵢ/τ …)
|
||||
(→ (node-id fieldᵢ/τ … Any Any) (→ Any Fixnum) Fixnum)))
|
||||
(→ (node-id fieldᵢ/τ … Any Any) (→ Any Integer) Integer)))
|
||||
(define (node-hash nd racket-recur-hash)
|
||||
(if (eq? (raw-node-database ((struct-accessor node-id raw) nd))
|
||||
'unique-copy)
|
||||
|
@ -275,9 +275,9 @@ To combine hash codes, we simply compute their @elem[#:style 'tt]{xor}. Later
|
|||
versions of this library may use more sophisticated mechanisms.
|
||||
|
||||
@chunk[<combine-hash-codes>
|
||||
(: combine-hash-codes (→ Fixnum * Fixnum))
|
||||
(define (combine-hash-codes . fixnums)
|
||||
(apply fxxor fixnums))]
|
||||
(: combine-hash-codes (→ Integer * Integer))
|
||||
(define (combine-hash-codes . hashes)
|
||||
(apply bitwise-xor hashes))]
|
||||
|
||||
@subsection{Caching node equality}
|
||||
|
||||
|
|
|
@ -235,13 +235,13 @@ nodes have the same shape, but cannot by themselves create logical cycles.
|
|||
…
|
||||
#t))
|
||||
(λ (a rec-hash)
|
||||
(fxxor (rec-hash 'id)
|
||||
(rec-hash (force ((struct-accessor pid fieldᵢ) a)))
|
||||
…))
|
||||
(bitwise-xor (rec-hash 'id)
|
||||
(rec-hash (force ((struct-accessor pid fieldᵢ) a)))
|
||||
…))
|
||||
(λ (a rec-hash)
|
||||
(fxxor (rec-hash 'id)
|
||||
(rec-hash (force ((struct-accessor pid fieldᵢ) a)))
|
||||
…))))]
|
||||
(bitwise-xor (rec-hash 'id)
|
||||
(rec-hash (force ((struct-accessor pid fieldᵢ) a)))
|
||||
…))))]
|
||||
|
||||
@section{Pre-declaring structs}
|
||||
|
||||
|
|
|
@ -11,4 +11,4 @@
|
|||
(define build-deps '())
|
||||
(define pkg-desc "Tests for the phc-adt library")
|
||||
(define version "1.1")
|
||||
(define pkg-authors '("Georges Dupéron"))
|
||||
(define pkg-authors '(|Suzanne Soy|))
|
||||
|
|
|
@ -9,4 +9,4 @@
|
|||
(define build-deps '())
|
||||
(define pkg-desc "Algebraic Datatypes tailored for writing compilers")
|
||||
(define version "1.1")
|
||||
(define pkg-authors '("Georges Dupéron"))
|
||||
(define pkg-authors '(|Suzanne Soy|))
|
||||
|
|
Loading…
Reference in New Issue
Block a user