#lang racket/base (require "../main.rkt") (require racket/match) (require racket/set) (require racket/pretty) (require rackunit) (define P #<; $ds during ?a { onStop print ; print ; } 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 ; snapshot $space ( ?outcome: # TODO: save outcome? printFlat ; unpause $space; turn $root (: $ds ::= =ready2); ) $ds ::= =ready1; } } ENDDOC ) (define S #< 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 ) (define T #< string, "rules": { @ string: Rule, ... }, optional "extras": [Rule ...], optional "externals": [Rule ...], optional "inline": [@ string ...], optional "conflicts": [@ string ...], optional "word": @ string, optional "supertypes": [string ...], }; Rule = / @alias { "type": "ALIAS", "named": bool, "value": string, "content": Rule } / @blank { "type": "BLANK" } / @string { "type": "STRING", "value": string } / @pattern { "type": "PATTERN", "value": string } / @symbol { "type": "SYMBOL", "name": string } / @seq { "type": "SEQ", "members": [Rule ...] } / @choice { "type": "CHOICE", "members": [Rule ...] } / @repeat1 { "type": "REPEAT1", "content": Rule } / @repeat { "type": "REPEAT", "content": Rule } / @token { "type": TokenType, "content": Rule } / @field { "type": "FIELD", "name": string, "content": Rule } / @prec { "type": PrecType, "value": int, "content": Rule } ; TokenType = "TOKEN" / "IMMEDIATE_TOKEN"; PrecType = "PREC" / "PREC_LEFT" / "PREC_RIGHT" / "PREC_DYNAMIC"; 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)) (parameterize ((pretty-print-columns 40)) (write-pexprs (string->pexprs T #:read-syntax? #t)) (newline))