116 lines
2.3 KiB
Racket
116 lines
2.3 KiB
Racket
#lang racket/base
|
|
|
|
(require "../main.rkt")
|
|
|
|
(require racket/match)
|
|
(require racket/set)
|
|
(require racket/pretty)
|
|
|
|
(require rackunit)
|
|
|
|
(define P #<<ENDDOC
|
|
{
|
|
key: value
|
|
# example of a comment at the end of a dictionary
|
|
}
|
|
# example of a comment at the end of the input file
|
|
ENDDOC
|
|
)
|
|
|
|
(define Q #<<ENDDOC
|
|
{
|
|
setUp();
|
|
# Now enter the loop
|
|
loop: {
|
|
greet("World");
|
|
}
|
|
tearDown();
|
|
}
|
|
ENDDOC
|
|
)
|
|
|
|
(define R #<<ENDDOC
|
|
define ?ds (newDataspace);
|
|
|
|
define ?space (subspace (?ds: $ds) {
|
|
$ds ::= 999;
|
|
|
|
print {
|
|
1: 2,
|
|
3: 4,
|
|
};
|
|
|
|
print <record 1 2 3 +>;
|
|
|
|
$ds during ?a {
|
|
onStop print <retracted $a>;
|
|
print <asserted $a>;
|
|
}
|
|
|
|
spawn {
|
|
define ?root (currentFacet);
|
|
$ds during =ready1 {
|
|
$ds .= 123;
|
|
$ds during =ready2 {
|
|
$ds .= 123.5;
|
|
stop $root;
|
|
}
|
|
$ds ::= 234;
|
|
}
|
|
|
|
spawn {
|
|
print "hi there";
|
|
}
|
|
}
|
|
});
|
|
|
|
spawn {
|
|
define ?root (currentFacet);
|
|
$ds on message ?x {
|
|
print <message $x>;
|
|
snapshot $space (
|
|
?outcome:
|
|
# TODO: save outcome?
|
|
printFlat <post-snap $outcome>;
|
|
unpause $space;
|
|
turn $root (: $ds ::= =ready2);
|
|
)
|
|
$ds ::= =ready1;
|
|
}
|
|
}
|
|
ENDDOC
|
|
)
|
|
|
|
(define S #<<ENDDOC
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
# SPDX-FileCopyrightText: Copyright © 2016-2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
|
|
|
import { SyndicateRollup } from "../../rollup.js";
|
|
const r = new SyndicateRollup("syndicate", { globalName: "Syndicate" });
|
|
export default [
|
|
r.config("lib/index.js", r.umd, {
|
|
output: {
|
|
globals: {
|
|
"crypto": "crypto",
|
|
},
|
|
},
|
|
}),
|
|
r.config("lib/index.js", r.es6, {
|
|
resolve: {
|
|
moduleDirectories: ["stubs", "node_modules"],
|
|
},
|
|
}),
|
|
];
|
|
ENDDOC
|
|
)
|
|
|
|
(parameterize ((pretty-print-columns 80)) (write-pexprs (string->pexprs P #:read-syntax? #t)) (newline))
|
|
(parameterize ((pretty-print-columns 10)) (write-pexprs (string->pexprs P #:read-syntax? #t)) (newline))
|
|
|
|
(parameterize ((pretty-print-columns 80)) (write-pexprs (string->pexprs Q #:read-syntax? #t)) (newline))
|
|
(parameterize ((pretty-print-columns 10)) (write-pexprs (string->pexprs Q #:read-syntax? #t)) (newline))
|
|
|
|
(parameterize ((pretty-print-columns 40)) (write-pexprs (string->pexprs R #:read-syntax? #t)) (newline))
|
|
|
|
(parameterize ((pretty-print-columns 40)) (write-pexprs (string->pexprs S #:read-syntax? #t)) (newline))
|