Compare commits
No commits in common. "main" and "typescript1" have entirely different histories.
main
...
typescript
|
@ -0,0 +1,6 @@
|
|||
((typescript-mode
|
||||
. ((eval . (setq tide-tsserver-executable
|
||||
(concat
|
||||
(let ((d (dir-locals-find-file ".")))
|
||||
(if (stringp d) d (car d)))
|
||||
"node_modules/typescript/lib/tsserver.js"))))))
|
674
LICENCE
674
LICENCE
|
@ -1,674 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
13
Makefile
13
Makefile
|
@ -1,5 +1,3 @@
|
|||
__ignored__ := $(shell ./setup.sh)
|
||||
|
||||
LERNA=./node_modules/.bin/lerna
|
||||
|
||||
bootstrap: node_modules/lerna
|
||||
|
@ -23,14 +21,3 @@ all:
|
|||
|
||||
watch:
|
||||
inotifytest make -j$$(nproc) all
|
||||
|
||||
PROTOCOLS_BRANCH=main
|
||||
pull-protocols:
|
||||
git subtree pull -P packages/core/protocols \
|
||||
-m 'Merge latest changes from the syndicate-protocols repository' \
|
||||
git@git.syndicate-lang.org:syndicate-lang/syndicate-protocols \
|
||||
$(PROTOCOLS_BRANCH)
|
||||
|
||||
fixcopyright:
|
||||
-fixcopyright.rkt --preset-typescript --file-pattern 'packages/**.ts' GPL-3.0-or-later
|
||||
-fixcopyright.rkt --preset-javascript --file-pattern 'packages/**.js' GPL-3.0-or-later
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
all:
|
||||
yarn install
|
||||
|
||||
clean:
|
||||
rm -rf lib dist .nyc_output coverage tsconfig.tsbuildinfo
|
||||
|
||||
veryclean: clean
|
||||
rm -rf node_modules package-lock.json
|
33
README.md
33
README.md
|
@ -1,15 +1,15 @@
|
|||
# Syndicate/js
|
||||
|
||||
A fourth-generation implementation of Dataspaces and Syndicate for
|
||||
A third-generation implementation of Dataspaces and Syndicate for
|
||||
TypeScript and JavaScript, in both node.js and the browser. The
|
||||
implementation techniques herein are the subject of a forthcoming
|
||||
paper.
|
||||
|
||||
## Branches
|
||||
**IMPORTANT: Use branch `typescript1` when cloning this project from git.**
|
||||
|
||||
The `main` branch is where active development happens:
|
||||
git clone -b typescript1 https://git.syndicate-lang.org/syndicate-lang/syndicate-js
|
||||
|
||||
git clone -b main https://git.syndicate-lang.org/syndicate-lang/syndicate-js
|
||||
The `main` branch is under active development, and is quite a different system.
|
||||
|
||||
## Building
|
||||
|
||||
|
@ -40,7 +40,7 @@ packages.
|
|||
|
||||
## Licence
|
||||
|
||||
@syndicate-lang, an implementation of Syndicate for TypeScript and JavaScript.
|
||||
@syndicate-lang, an implementation of Syndicate for JS.
|
||||
Copyright (C) 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -124,19 +124,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
<!-- then a file `src/index.js`: -->
|
||||
|
||||
<!-- ```javascript -->
|
||||
<!-- const { LaterThan } = activate require("@syndicate-lang/driver-timer"); -->
|
||||
<!-- const { TimeLaterThan } = activate require("@syndicate-lang/driver-timer"); -->
|
||||
|
||||
<!-- spawn named 'ticker' { -->
|
||||
<!-- field this.counter = 0; -->
|
||||
<!-- field this.deadline = +(new Date()) / 1000.0; -->
|
||||
<!-- field this.deadline = +(new Date()); -->
|
||||
|
||||
<!-- on start { console.log('ticker starting'); } -->
|
||||
<!-- on stop { console.log('ticker stopping'); } -->
|
||||
|
||||
<!-- on asserted LaterThan(this.deadline) { -->
|
||||
<!-- on asserted TimeLaterThan(this.deadline) { -->
|
||||
<!-- this.counter++; -->
|
||||
<!-- console.log('tick', new Date(), this.counter); -->
|
||||
<!-- this.deadline += 1; -->
|
||||
<!-- this.deadline += 1000; -->
|
||||
<!-- } -->
|
||||
|
||||
<!-- stop on (this.counter == 5); -->
|
||||
|
@ -161,18 +161,3 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
<!-- tick 2018-11-05T14:23:31.707Z 5 -->
|
||||
<!-- ticker stopping -->
|
||||
|
||||
## Older versions
|
||||
|
||||
An earlier TypeScript+JavaScript implementation from early 2021 (the
|
||||
primary difference to `main` being a lack of object-capability
|
||||
support) can be found on the `typescript1` branch:
|
||||
|
||||
git clone -b typescript1 https://git.syndicate-lang.org/syndicate-lang/syndicate-js
|
||||
|
||||
Finally, the `babel-based` branch is from 2018, and is an
|
||||
implementation for JavaScript only. It extends babel with new syntax
|
||||
and new plugins (rather than implementing its own error-tolerant
|
||||
parser, like `typescript1` and `main`):
|
||||
|
||||
git clone -b babel-based https://git.syndicate-lang.org/syndicate-lang/syndicate-js
|
||||
|
||||
|
|
24
TODO.md
24
TODO.md
|
@ -1,28 +1,6 @@
|
|||
|
||||
// // v Ideally, this would be of type "Sturdy.SturdyRef | null", but (1) the
|
||||
// // current Dataflow implementation isn't bright enough to mark valuesas being
|
||||
// // convertible to preserves values on demand, and (2) null isn't preservesable
|
||||
// // in any case. If preserves were improved to be able to convert schema-parsed
|
||||
// // values to preserves on demand, and to know it could do that at the type
|
||||
// // level, then I could change Dataflow to support any value that could be
|
||||
// // converted to preserves on demand, and I could special-case null and
|
||||
// // undefined for the ergonomics.
|
||||
// field servercap: AnyValue = false;
|
||||
// on asserted InputValue('#servercap', $v: string) => {
|
||||
// servercap.value = false;
|
||||
// try {
|
||||
// const a = new Reader<Ref>(v).next();
|
||||
// if (Sturdy.toSturdyRef(a) !== void 0) servercap.value = a;
|
||||
// } catch (e) {
|
||||
// console.error(e);
|
||||
// }
|
||||
// }
|
||||
// assert UIAttribute('#servercap', 'class', 'invalid') when (!servercap.value);
|
||||
|
||||
|
||||
- [DONE] `during/spawn`
|
||||
- [DONE] `during`
|
||||
- [DONE] `let { LaterThan } = activate require("@syndicate-lang/driver-timer");`
|
||||
- [DONE] `let { TimeLaterThan } = activate require("@syndicate-lang/driver-timer");`
|
||||
- [DONE] `react`
|
||||
- [DONE] `spawn*` or similar - looks like `spawn on start { ... }` will do the trick
|
||||
- [DONE] activation
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
index.js
|
||||
index.js.map
|
||||
src/gen/
|
|
@ -1,49 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Syndicate: Chat</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="style.css" rel="stylesheet">
|
||||
<script src="node_modules/@preserves/core/dist/preserves.js"></script>
|
||||
<script src="node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
||||
<script src="node_modules/@syndicate-lang/html/dist/syndicate-html.js"></script>
|
||||
<script src="node_modules/@syndicate-lang/ws-relay/dist/syndicate-ws-relay.js"></script>
|
||||
<script src="index.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<form id="nym_form" name="nym_form">
|
||||
<fieldset>
|
||||
<label class="control-label" for="route">Dataspace address:</label>
|
||||
<input type="text" id="route" name="route" value="">
|
||||
|
||||
<label class="control-label" for="nym">Nym:</label>
|
||||
<input type="text" id="nym" name="nym" value="">
|
||||
</fieldset>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section id="messages">
|
||||
<h1>Messages</h1>
|
||||
<div id="chat_output"></div>
|
||||
</section>
|
||||
<section id="active_users">
|
||||
<h1>Active Users</h1>
|
||||
<ul id="nymlist"></ul>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<form id="chat_form" name="chat_form">
|
||||
<fieldset>
|
||||
<input type="text" id="chat_input" name="chat_input" value="" autocomplete="off">
|
||||
<button id="send_chat">Send</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<script>Main.main();</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,32 +0,0 @@
|
|||
{
|
||||
"name": "@syndicate-lang/example-simple-chat",
|
||||
"private": true,
|
||||
"description": "Simple chat in the browser",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepare": "yarn regenerate && yarn compile && yarn rollup",
|
||||
"regenerate": "rm -rf ./src/gen && preserves-schema-ts --output ./src/gen ./protocols/schemas",
|
||||
"regenerate:watch": "yarn regenerate --watch",
|
||||
"compile": "syndicate-tsc",
|
||||
"compile:watch": "syndicate-tsc -w --verbose --intermediate-directory src.ts",
|
||||
"rollup": "rollup -c",
|
||||
"rollup:watch": "rollup -c -w",
|
||||
"clean": "rm -rf lib/ index.js index.js.map"
|
||||
},
|
||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||
"license": "GPL-3.0+",
|
||||
"dependencies": {
|
||||
"@preserves/core": "^0.995.200",
|
||||
"@syndicate-lang/core": "*",
|
||||
"@syndicate-lang/html": "*",
|
||||
"@syndicate-lang/ws-relay": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@preserves/schema-cli": ">=0.995.201",
|
||||
"@syndicate-lang/ts-plugin": "*",
|
||||
"@syndicate-lang/tsc": "*",
|
||||
"rollup": "^2.60",
|
||||
"rollup-plugin-sourcemaps": "^0.6",
|
||||
"typescript": "^4.9"
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
version 1 .
|
||||
|
||||
Present = <Present @username string>.
|
||||
Says = <Says @who string @what string>.
|
|
@ -1,21 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import sourcemaps from 'rollup-plugin-sourcemaps';
|
||||
|
||||
export default {
|
||||
input: 'lib/index.js',
|
||||
plugins: [sourcemaps()],
|
||||
output: {
|
||||
file: 'index.js',
|
||||
format: 'umd',
|
||||
name: 'Main',
|
||||
sourcemap: true,
|
||||
globals: {
|
||||
'@preserves/core': 'Preserves',
|
||||
'@syndicate-lang/core': 'Syndicate',
|
||||
'@syndicate-lang/html': 'SyndicateHtml',
|
||||
'@syndicate-lang/ws-relay': 'SyndicateWsRelay',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -1 +0,0 @@
|
|||
<require-service <relay-listener <tcp "0.0.0.0" 9001> $gatekeeper>>
|
|
@ -1,9 +0,0 @@
|
|||
let ?ds = dataspace
|
||||
|
||||
# Connect using <route [<ws "...">] <ref {oid: "syndicate" sig: #[acowDB2/oI+6aSEC3YIxGg]}>
|
||||
<bind <ref {oid: "syndicate" key: #x""}> $ds #f>
|
||||
|
||||
# Connect using <route [<ws "...">] <noise { service: "syndicate", key: #x"21f6cd4e11e7e37711d6b3084ff18cded8fc8abf293aa47d43e8bb86dda65516" }>>
|
||||
let ?sk = #x"7626eb6c0ee79cb928a0c3f6e29621e9119da6735859f1425956a49fd937e586"
|
||||
let ?pk = #x"21f6cd4e11e7e37711d6b3084ff18cded8fc8abf293aa47d43e8bb86dda65516"
|
||||
<bind <noise { service: "syndicate", key: $pk, secretKey: $sk }> $ds #f>
|
|
@ -1,155 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { fromJS, Bytes, Dataspace, Ref, Sturdy, AnyValue, Reader, Schemas, stringify } from "@syndicate-lang/core";
|
||||
import { boot as bootHtml, Anchor, template as html, HtmlFragments, GlobalEvent, UIAttribute, UIChangeableProperty } from "@syndicate-lang/html";
|
||||
import { boot as bootWakeDetector, WakeEvent } from "./wake-detector";
|
||||
import { boot as bootWsRelay } from "@syndicate-lang/ws-relay";
|
||||
import { Present, Says } from './gen/simpleChatProtocol';
|
||||
import G = Schemas.gatekeeper;
|
||||
import N = Schemas.noise;
|
||||
|
||||
export function main() {
|
||||
document.getElementById('chat_form')!.onsubmit = e => { e.preventDefault(); return false; };
|
||||
document.getElementById('nym_form')!.onsubmit = e => { e.preventDefault(); return false; };
|
||||
setDataspaceAddress();
|
||||
setUsernameIfUnset();
|
||||
document.getElementById('chat_input')!.focus();
|
||||
|
||||
Dataspace.boot(ds => {
|
||||
bootHtml(ds);
|
||||
bootWakeDetector(ds);
|
||||
bootWsRelay(ds, true);
|
||||
bootChat(ds);
|
||||
});
|
||||
}
|
||||
|
||||
function bootChat(ds: Ref) {
|
||||
spawn named 'chat' {
|
||||
at ds {
|
||||
field nym: string = '';
|
||||
on asserted UIChangeableProperty('#nym', 'value', $v: string) => nym.value = v;
|
||||
|
||||
during UIChangeableProperty('#route', 'value', $routeText: string) => {
|
||||
let route: G.Route<Ref> | null = null;
|
||||
try {
|
||||
route = G.asRoute(new Reader<Ref>(routeText).next());
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
assert UIAttribute('#route', 'class', 'invalid') when (!route);
|
||||
if (route) contactRemote(route);
|
||||
}
|
||||
|
||||
function contactRemote(route: G.Route<Ref>) {
|
||||
console.log('contactRemote', route);
|
||||
during G.ResolvePath({
|
||||
"route": route,
|
||||
"addr": $addr,
|
||||
"control": $control: Ref,
|
||||
"resolved": G.Resolved.accepted($remoteDs: Ref),
|
||||
}) => {
|
||||
on message WakeEvent() => at control {
|
||||
send message G.ForceDisconnect();
|
||||
}
|
||||
|
||||
outputState('connected', 'connected to ' + stringify(addr));
|
||||
on stop outputState('disconnected', 'disconnected from ' + stringify(addr));
|
||||
|
||||
on message GlobalEvent('#send_chat', 'click', _) => {
|
||||
const inp = document.getElementById("chat_input") as HTMLInputElement;
|
||||
var utterance = inp.value;
|
||||
inp.value = '';
|
||||
if (utterance) {
|
||||
at remoteDs {
|
||||
send message Says({ who: nym.value, what: utterance });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
at remoteDs {
|
||||
assert Present(nym.value);
|
||||
|
||||
const ui = new Anchor();
|
||||
during Present($who: string) => at ds {
|
||||
assert ui.context(who).html('#nymlist', html`<li>${who}</li>`);
|
||||
}
|
||||
|
||||
on message Says({ "who": $who: string, "what": $what: string }) => {
|
||||
outputUtterance(who, what);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setDataspaceAddress() {
|
||||
const route = document.getElementById('route')! as HTMLInputElement;
|
||||
if (route.value === '') {
|
||||
const isSecure = (document.location.protocol ?? '').toLowerCase().endsWith('s:');
|
||||
const localWs = isSecure ? 'wss' : 'ws';
|
||||
const wsurls = [
|
||||
`wss://generic-dataspace.demo.leastfixedpoint.com/`,
|
||||
`${localWs}://${document.location.hostname}:9001/`,
|
||||
];
|
||||
const transports: AnyValue[] =
|
||||
wsurls.map(u => fromJS(Schemas.transportAddress.WebSocket(u)));
|
||||
|
||||
route.value = stringify(G.Route<Ref>({
|
||||
"transports": transports,
|
||||
"pathSteps": [G.PathStep({
|
||||
"stepType": N.$noise,
|
||||
"detail": fromJS(N.NoiseSpec({
|
||||
"service": "syndicate",
|
||||
"key": Bytes.fromHex("21f6cd4e11e7e37711d6b3084ff18cded8fc8abf293aa47d43e8bb86dda65516"),
|
||||
"protocol": N.NoiseProtocol.absent(),
|
||||
"preSharedKeys": N.NoisePreSharedKeys.absent(),
|
||||
})),
|
||||
})],
|
||||
}));
|
||||
|
||||
// To use a sturdyref instead:
|
||||
//
|
||||
// route.value = stringify(G.Route<Ref>({
|
||||
// "transports": transports,
|
||||
// "pathSteps": [G.PathStep({
|
||||
// "stepType": Sturdy.$ref,
|
||||
// "detail": fromJS(Sturdy.Parameters({
|
||||
// "oid": "syndicate",
|
||||
// "sig": Bytes.fromHex('69ca300c1dbfa08fba692102dd82311a'),
|
||||
// "caveats": Sturdy.CaveatsField.absent(),
|
||||
// })),
|
||||
// })],
|
||||
// }));
|
||||
//
|
||||
// ... and of course you can chain these things, depending on server setup.
|
||||
}
|
||||
}
|
||||
|
||||
function setUsernameIfUnset() {
|
||||
const nym = document.getElementById('nym')! as HTMLInputElement;
|
||||
if (nym.value === '') {
|
||||
nym.value = "nym" + Math.floor(Math.random() * 65536);
|
||||
}
|
||||
}
|
||||
|
||||
function outputItem(cls: string, item0: HtmlFragments): ChildNode {
|
||||
const stamp = html`<span class="timestamp">${(new Date()).toUTCString()}</span>`;
|
||||
const item = html`<div class="${cls}">${stamp}${item0}</div>`;
|
||||
const n = item.node();
|
||||
const o = document.getElementById('chat_output')!;
|
||||
o.appendChild(n);
|
||||
o.scrollTop = o.scrollHeight;
|
||||
return n;
|
||||
}
|
||||
|
||||
function outputState(cls: string, state: string) {
|
||||
outputItem(`state_${cls}`, html`<span class="state ${cls}">${state}</span>`)
|
||||
}
|
||||
|
||||
function outputUtterance(who: string, what: string) {
|
||||
outputItem('utterance',
|
||||
html`<span class="nym">${who}</span><span class="utterance">${what}</span>`);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
// Wake detector - notices when something (such as
|
||||
// suspension/sleeping!) has caused periodic activities to be
|
||||
// interrupted, and warns others about it. Inspired by
|
||||
// http://blog.alexmaccaw.com/javascript-wake-event
|
||||
|
||||
import { Ref, Turn, Observe } from "@syndicate-lang/core";
|
||||
|
||||
export message type WakeEvent();
|
||||
|
||||
export function boot(ds: Ref, period0?: number) {
|
||||
const period = period0 ?? 10000;
|
||||
at ds {
|
||||
during Observe({ "pattern": :pattern WakeEvent() }) => spawn named 'WakeDetector' {
|
||||
const facet = Turn.activeFacet;
|
||||
let mostRecentTrigger = +(new Date());
|
||||
const timerId = setInterval(() => facet.turn(() => {
|
||||
const now = +(new Date());
|
||||
if (now - mostRecentTrigger > period * 1.5) {
|
||||
send message WakeEvent();
|
||||
}
|
||||
mostRecentTrigger = now;
|
||||
}), period);
|
||||
on stop clearInterval(timerId);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
background: lightgrey;
|
||||
}
|
||||
|
||||
body > section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
body > section > section {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
section#messages {
|
||||
flex-grow: 3;
|
||||
}
|
||||
|
||||
section#active_users {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
form#chat_form {
|
||||
flex: 1 100%;
|
||||
}
|
||||
|
||||
span.timestamp {
|
||||
color: #d0d0d0;
|
||||
}
|
||||
|
||||
span.timestamp:after {
|
||||
content: " ";
|
||||
}
|
||||
|
||||
.utterance span.nym:after {
|
||||
content: ": ";
|
||||
}
|
||||
|
||||
span.arrived:after {
|
||||
content: " arrived";
|
||||
}
|
||||
|
||||
span.departed:after {
|
||||
content: " departed";
|
||||
}
|
||||
|
||||
div.notification {
|
||||
background-color: #eeeeff;
|
||||
}
|
||||
|
||||
span.state.connected, span.arrived {
|
||||
color: #00c000;
|
||||
}
|
||||
|
||||
span.state.disconnected, span.departed {
|
||||
color: #c00000;
|
||||
}
|
||||
|
||||
span.state.crashed {
|
||||
color: white;
|
||||
background: red;
|
||||
}
|
||||
|
||||
span.state.crashed:after {
|
||||
content: "; please reload the page";
|
||||
}
|
||||
|
||||
div.state_disconnected {
|
||||
background-color: #ffeeee;
|
||||
}
|
||||
|
||||
div.state_connected {
|
||||
background-color: #eeffee;
|
||||
}
|
||||
|
||||
#chat_output {
|
||||
height: 15em;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
#chat_input {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.nym {
|
||||
color: #00c000;
|
||||
}
|
||||
|
||||
.nym_status:before {
|
||||
content: " (";
|
||||
}
|
||||
|
||||
.nym_status:after {
|
||||
content: ")";
|
||||
}
|
||||
|
||||
.nym_status {
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
#route.invalid {
|
||||
background: red;
|
||||
}
|
||||
|
||||
#route {
|
||||
min-width: 30em;
|
||||
}
|
|
@ -1,440 +0,0 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@preserves/core@0.995.200", "@preserves/core@^0.995.200":
|
||||
version "0.995.200"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/core/-/core-0.995.200.tgz#65575cf8f9320e73b5d37fa9ac9d6881a33fd3a6"
|
||||
integrity sha512-htZ2x+hltUpKoPsviWSuelzZW96po9zVSsN0RZEih60FahNX0R2LCqFJ6v5lyATuQ9oHALVi0w8w4rtf8oiAJw==
|
||||
|
||||
"@preserves/schema-cli@0.995.201":
|
||||
version "0.995.201"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/schema-cli/-/schema-cli-0.995.201.tgz#e87cb7ba51b225ff6ea96f177c5388907adf6717"
|
||||
integrity sha512-n/lpVgWBY1UTRySPXIwWG4Yu87OrQ9b7Xo8zPPQzD/DJDTEDT3y3SUujY7UTF1pQn09xRGnfPnDu1RoRCv2J3w==
|
||||
dependencies:
|
||||
"@preserves/core" "^0.995.200"
|
||||
"@preserves/schema" "^0.995.201"
|
||||
chalk "^4.1"
|
||||
chokidar "^3.5"
|
||||
commander "^7.2"
|
||||
glob "^7.1"
|
||||
minimatch "^3.0"
|
||||
|
||||
"@preserves/schema@^0.995.201":
|
||||
version "0.995.201"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/schema/-/schema-0.995.201.tgz#827ad539afb0fdf68ba885ee3ff43db0fd473aa5"
|
||||
integrity sha512-0SuhwOEAfxtrAeOTZ8V1yNEcHHHEbfUmoFawrF+vzTQFNZRz/X3LF1FM6wOiJlHtb7tBr4B+rHXX8jfNrqrdkA==
|
||||
dependencies:
|
||||
"@preserves/core" "^0.995.200"
|
||||
|
||||
"@rollup/pluginutils@^3.0.9":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
|
||||
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
|
||||
dependencies:
|
||||
"@types/estree" "0.0.39"
|
||||
estree-walker "^1.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@syndicate-lang/compiler@^0.21.1":
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/compiler/-/compiler-0.21.1.tgz#b6316bac14d053c313b3442be68f532a60c47cb3"
|
||||
integrity sha512-daaYh1i0XmoHt6eTtO4gWblfVKMjp9trwxqR62wUSONY3gtJ5Bn4hG3dMgfoMz2NvOWbJHaGz/95J0jRubITxA==
|
||||
|
||||
"@syndicate-lang/core@*", "@syndicate-lang/core@^0.32.0":
|
||||
version "0.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/core/-/core-0.32.0.tgz#0efbbff176cac2969c2b6ba70a19965add3a2c61"
|
||||
integrity sha512-ERVXk0W1xLaKvUa79Ek74YvqfBU543cUTb2GJvp76TP5k1jA97q9GzhddicS/s8lqu8SUC1+IXmKiJk0NX2TWQ==
|
||||
dependencies:
|
||||
salty-crypto "0.3.1"
|
||||
|
||||
"@syndicate-lang/html@*":
|
||||
version "0.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/html/-/html-0.33.0.tgz#c53e6bf8a52b17c3747f4270713a8c9234f984af"
|
||||
integrity sha512-xhN6NZOgLxlAQOyWG0JAgtyF1e1yQvrpNh5RBAPnucFYC024yo1ggZ08+KiaulhsoIKvRbBE6FU6p9dDm4/tpQ==
|
||||
dependencies:
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
|
||||
"@syndicate-lang/ts-plugin@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/ts-plugin/-/ts-plugin-0.34.0.tgz#df92f9044eeba528c80c41c5c9df49ee28902411"
|
||||
integrity sha512-OCO6Hm0euz2hZk6tYTrJQNEM8iDBeQ/dgpW2a/UP52XSP6fYj0OvUVfn+35ZkIL64S+zDsJjL/6XFN05UZyRGA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
|
||||
"@syndicate-lang/tsc@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/tsc/-/tsc-0.34.0.tgz#1056fba7f639bbf436d0c2ecd2717edc4c1e612a"
|
||||
integrity sha512-Ufj3xsdXMbMCavWsEkX/pFyXRpNIWRW+LFew1icD14DoSLqyBcoUEvskolOSgkSzC53tDjbd4/LXDVofIjIyUA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
glob "^7.1.6"
|
||||
yargs "^16.2.0"
|
||||
|
||||
"@syndicate-lang/ws-relay@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/ws-relay/-/ws-relay-0.34.0.tgz#8b450ef18b22ca8e0c159c7925a1068796ad2c71"
|
||||
integrity sha512-PT24Pp+ol/wWMSp/6H8i5zu7CgXm5nh0UsfpxJ3ZpvWFs/rIsoMflL/g+C1Q4DW9oFTn6/WFs07VdSLmE2/Uog==
|
||||
dependencies:
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
salty-crypto "0.3"
|
||||
|
||||
"@types/estree@0.0.39":
|
||||
version "0.0.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
|
||||
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
anymatch@~3.1.2:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
|
||||
integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==
|
||||
dependencies:
|
||||
normalize-path "^3.0.0"
|
||||
picomatch "^2.0.4"
|
||||
|
||||
atob@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
|
||||
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
binary-extensions@^2.0.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522"
|
||||
integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
braces@~3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
|
||||
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
|
||||
dependencies:
|
||||
fill-range "^7.0.1"
|
||||
|
||||
chalk@^4.1:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
||||
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
|
||||
dependencies:
|
||||
ansi-styles "^4.1.0"
|
||||
supports-color "^7.1.0"
|
||||
|
||||
chokidar@^3.5:
|
||||
version "3.6.0"
|
||||
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b"
|
||||
integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==
|
||||
dependencies:
|
||||
anymatch "~3.1.2"
|
||||
braces "~3.0.2"
|
||||
glob-parent "~5.1.2"
|
||||
is-binary-path "~2.1.0"
|
||||
is-glob "~4.0.1"
|
||||
normalize-path "~3.0.0"
|
||||
readdirp "~3.6.0"
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
cliui@^7.0.2:
|
||||
version "7.0.4"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
||||
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
|
||||
dependencies:
|
||||
string-width "^4.2.0"
|
||||
strip-ansi "^6.0.0"
|
||||
wrap-ansi "^7.0.0"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
commander@^7.2:
|
||||
version "7.2.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"
|
||||
integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
emoji-regex@^8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||
|
||||
escalade@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
|
||||
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
|
||||
|
||||
estree-walker@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
|
||||
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
|
||||
|
||||
fill-range@^7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
|
||||
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
|
||||
dependencies:
|
||||
to-regex-range "^5.0.1"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
||||
get-caller-file@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
glob-parent@~5.1.2:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
||||
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
|
||||
dependencies:
|
||||
is-glob "^4.0.1"
|
||||
|
||||
glob@^7.1, glob@^7.1.6:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.1.1"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
has-flag@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
|
||||
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-binary-path@~2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
|
||||
integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
|
||||
dependencies:
|
||||
binary-extensions "^2.0.0"
|
||||
|
||||
is-extglob@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
||||
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||
|
||||
is-glob@^4.0.1, is-glob@~4.0.1:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
|
||||
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
|
||||
dependencies:
|
||||
is-extglob "^2.1.1"
|
||||
|
||||
is-number@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
|
||||
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
|
||||
|
||||
minimatch@^3.0, minimatch@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
|
||||
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
||||
|
||||
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||
|
||||
readdirp@~3.6.0:
|
||||
version "3.6.0"
|
||||
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
|
||||
integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
|
||||
dependencies:
|
||||
picomatch "^2.2.1"
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
||||
|
||||
rollup-plugin-sourcemaps@^0.6:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed"
|
||||
integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^3.0.9"
|
||||
source-map-resolve "^0.6.0"
|
||||
|
||||
rollup@^2.60:
|
||||
version "2.79.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"
|
||||
integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
salty-crypto@0.3, salty-crypto@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/salty-crypto/-/salty-crypto-0.3.1.tgz#1242cd948d8152aff104d0945980996b1602ba0e"
|
||||
integrity sha512-dCbF8/UzMV8oXPmMCHWzSp7u8G6NA+pHbaFBVqVgLVBiyxuwVn9iPbyt9WXT0EoXfL9sKt7U1mV+bgsGw5cV7A==
|
||||
|
||||
source-map-resolve@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
|
||||
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
|
||||
dependencies:
|
||||
atob "^2.1.2"
|
||||
decode-uri-component "^0.2.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
supports-color@^7.1.0:
|
||||
version "7.2.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
|
||||
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
|
||||
dependencies:
|
||||
has-flag "^4.0.0"
|
||||
|
||||
to-regex-range@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
|
||||
integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
|
||||
dependencies:
|
||||
is-number "^7.0.0"
|
||||
|
||||
typescript@^4.9:
|
||||
version "4.9.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
wrap-ansi@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
||||
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
|
||||
|
||||
yargs-parser@^20.2.2:
|
||||
version "20.2.9"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
||||
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
|
||||
|
||||
yargs@^16.2.0:
|
||||
version "16.2.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
|
||||
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
|
||||
dependencies:
|
||||
cliui "^7.0.2"
|
||||
escalade "^3.1.1"
|
||||
get-caller-file "^2.0.5"
|
||||
require-directory "^2.1.1"
|
||||
string-width "^4.2.0"
|
||||
y18n "^5.0.5"
|
||||
yargs-parser "^20.2.2"
|
|
@ -1,13 +0,0 @@
|
|||
# How to use @syndicate-lang/loader
|
||||
|
||||
Running a module:
|
||||
|
||||
```shell
|
||||
node -r @syndicate-lang/loader index.js
|
||||
```
|
||||
|
||||
Running a standalone script:
|
||||
|
||||
```shell
|
||||
./standalone.js
|
||||
```
|
|
@ -1,19 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
const { BoxState, SetBox, N } = require('./protocol.js');
|
||||
|
||||
function boot() {
|
||||
spawn named 'box' {
|
||||
field boxValue = 0;
|
||||
|
||||
assert BoxState(boxValue.value);
|
||||
on message SetBox($v) => boxValue.value = v;
|
||||
|
||||
stop on (boxValue.value === N) {
|
||||
console.log('terminated box root facet');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.boot = boot;
|
|
@ -1,16 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
const { BoxState, SetBox } = require('./protocol.js');
|
||||
|
||||
function boot(doneCallback) {
|
||||
spawn named 'client' {
|
||||
on asserted BoxState($v) => send message SetBox(v + 1);
|
||||
on retracted BoxState(_) => {
|
||||
console.log('box gone');
|
||||
doneCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.boot = boot;
|
|
@ -1,10 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
const { N } = require('./protocol.js');
|
||||
const Box = require('./box.js');
|
||||
const Client = require('./client.js');
|
||||
|
||||
console.time('box-and-client-' + N.toString());
|
||||
Box.boot();
|
||||
Client.boot(() => console.timeEnd('box-and-client-' + N.toString()));
|
|
@ -1,11 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
assertion type BoxState(value);
|
||||
message type SetBox(newValue);
|
||||
|
||||
const N = 100000;
|
||||
|
||||
exports.BoxState = BoxState;
|
||||
exports.SetBox = SetBox;
|
||||
exports.N = N;
|
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
exec node -r @syndicate-lang/loader index.js
|
|
@ -1,28 +0,0 @@
|
|||
#!/usr/bin/env -S node -r @syndicate-lang/loader
|
||||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
assertion type BoxState(value);
|
||||
message type SetBox(newValue);
|
||||
|
||||
const N = 100000;
|
||||
|
||||
spawn named 'box' {
|
||||
field boxValue = 0;
|
||||
|
||||
assert BoxState(boxValue.value);
|
||||
on message SetBox($v) => boxValue.value = v;
|
||||
|
||||
stop on (boxValue.value === N) {
|
||||
console.log('terminated box root facet');
|
||||
}
|
||||
}
|
||||
|
||||
console.time('box-and-client-' + N.toString());
|
||||
spawn named 'client' {
|
||||
on asserted BoxState($v) => send message SetBox(v + 1);
|
||||
on retracted BoxState(_) => {
|
||||
console.log('box gone');
|
||||
console.timeEnd('box-and-client-' + N.toString())
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { BoxState, SetBox, N } from './protocol.js';
|
||||
import { Ref } from '@syndicate-lang/core';
|
||||
|
||||
export function boot(ds: Ref) {
|
||||
spawn named 'box' {
|
||||
field boxValue: number = 0;
|
||||
at ds {
|
||||
assert BoxState(boxValue.value);
|
||||
on message SetBox($v: number) => boxValue.value = v;
|
||||
}
|
||||
stop on (boxValue.value === N) {
|
||||
console.log('terminated box root facet');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { BoxState, SetBox } from './protocol.js';
|
||||
import { Ref } from '@syndicate-lang/core';
|
||||
|
||||
export function boot(ds: Ref, doneCallback: () => void) {
|
||||
spawn named 'client' {
|
||||
at ds {
|
||||
on asserted BoxState($v: number) => send message SetBox(v + 1);
|
||||
on retracted BoxState(_) => {
|
||||
console.log('box gone');
|
||||
doneCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { N } from './protocol.js';
|
||||
import * as Box from './box.js';
|
||||
import * as Client from './client.js';
|
||||
import { Dataspace } from '@syndicate-lang/core';
|
||||
|
||||
console.time('box-and-client-' + N.toString());
|
||||
Dataspace.boot(ds => {
|
||||
Box.boot(ds);
|
||||
Client.boot(ds, () => console.timeEnd('box-and-client-' + N.toString()));
|
||||
});
|
|
@ -1,7 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export assertion type BoxState(value: number);
|
||||
export message type SetBox(newValue: number);
|
||||
|
||||
export const N = 100000;
|
|
@ -1,305 +0,0 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@preserves/core@0.995.200", "@preserves/core@^0.995.200":
|
||||
version "0.995.200"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/core/-/core-0.995.200.tgz#65575cf8f9320e73b5d37fa9ac9d6881a33fd3a6"
|
||||
integrity sha512-htZ2x+hltUpKoPsviWSuelzZW96po9zVSsN0RZEih60FahNX0R2LCqFJ6v5lyATuQ9oHALVi0w8w4rtf8oiAJw==
|
||||
|
||||
"@preserves/schema@0.995.201":
|
||||
version "0.995.201"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/schema/-/schema-0.995.201.tgz#827ad539afb0fdf68ba885ee3ff43db0fd473aa5"
|
||||
integrity sha512-0SuhwOEAfxtrAeOTZ8V1yNEcHHHEbfUmoFawrF+vzTQFNZRz/X3LF1FM6wOiJlHtb7tBr4B+rHXX8jfNrqrdkA==
|
||||
dependencies:
|
||||
"@preserves/core" "^0.995.200"
|
||||
|
||||
"@rollup/pluginutils@^3.0.9":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
|
||||
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
|
||||
dependencies:
|
||||
"@types/estree" "0.0.39"
|
||||
estree-walker "^1.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@syndicate-lang/compiler@^0.21.1":
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/compiler/-/compiler-0.21.1.tgz#b6316bac14d053c313b3442be68f532a60c47cb3"
|
||||
integrity sha512-daaYh1i0XmoHt6eTtO4gWblfVKMjp9trwxqR62wUSONY3gtJ5Bn4hG3dMgfoMz2NvOWbJHaGz/95J0jRubITxA==
|
||||
|
||||
"@syndicate-lang/core@*", "@syndicate-lang/core@^0.32.0":
|
||||
version "0.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/core/-/core-0.32.0.tgz#0efbbff176cac2969c2b6ba70a19965add3a2c61"
|
||||
integrity sha512-ERVXk0W1xLaKvUa79Ek74YvqfBU543cUTb2GJvp76TP5k1jA97q9GzhddicS/s8lqu8SUC1+IXmKiJk0NX2TWQ==
|
||||
dependencies:
|
||||
salty-crypto "0.3.1"
|
||||
|
||||
"@syndicate-lang/syndicatec@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/syndicatec/-/syndicatec-0.34.0.tgz#f3b88507b633552fe1f41f24def5121c0cafeaeb"
|
||||
integrity sha512-h3MPifJdXZTS3JVcvRG8GXMJMPBH4RYmJ3B7c2sjM826Pf6O8zT47Vuv1y2WyD9PS8BiSCI01uOR0W5AVJJT5w==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
glob "^7.1.6"
|
||||
yargs "^16.2.0"
|
||||
|
||||
"@syndicate-lang/ts-plugin@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/ts-plugin/-/ts-plugin-0.34.0.tgz#df92f9044eeba528c80c41c5c9df49ee28902411"
|
||||
integrity sha512-OCO6Hm0euz2hZk6tYTrJQNEM8iDBeQ/dgpW2a/UP52XSP6fYj0OvUVfn+35ZkIL64S+zDsJjL/6XFN05UZyRGA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
|
||||
"@syndicate-lang/tsc@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/tsc/-/tsc-0.34.0.tgz#1056fba7f639bbf436d0c2ecd2717edc4c1e612a"
|
||||
integrity sha512-Ufj3xsdXMbMCavWsEkX/pFyXRpNIWRW+LFew1icD14DoSLqyBcoUEvskolOSgkSzC53tDjbd4/LXDVofIjIyUA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
glob "^7.1.6"
|
||||
yargs "^16.2.0"
|
||||
|
||||
"@types/estree@0.0.39":
|
||||
version "0.0.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
|
||||
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^4.0.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
atob@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
|
||||
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
cliui@^7.0.2:
|
||||
version "7.0.4"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
||||
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
|
||||
dependencies:
|
||||
string-width "^4.2.0"
|
||||
strip-ansi "^6.0.0"
|
||||
wrap-ansi "^7.0.0"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
emoji-regex@^8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||
|
||||
escalade@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
|
||||
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
|
||||
|
||||
estree-walker@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
|
||||
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
||||
get-caller-file@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
glob@^7.1.6:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.1.1"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||
|
||||
minimatch@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
||||
|
||||
picomatch@^2.2.2:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
||||
|
||||
rollup-plugin-sourcemaps@^0.6:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed"
|
||||
integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^3.0.9"
|
||||
source-map-resolve "^0.6.0"
|
||||
|
||||
rollup@^2.60:
|
||||
version "2.79.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"
|
||||
integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
salty-crypto@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/salty-crypto/-/salty-crypto-0.3.1.tgz#1242cd948d8152aff104d0945980996b1602ba0e"
|
||||
integrity sha512-dCbF8/UzMV8oXPmMCHWzSp7u8G6NA+pHbaFBVqVgLVBiyxuwVn9iPbyt9WXT0EoXfL9sKt7U1mV+bgsGw5cV7A==
|
||||
|
||||
source-map-resolve@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
|
||||
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
|
||||
dependencies:
|
||||
atob "^2.1.2"
|
||||
decode-uri-component "^0.2.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
typescript@^4.9:
|
||||
version "4.9.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
wrap-ansi@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
||||
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
|
||||
|
||||
yargs-parser@^20.2.2:
|
||||
version "20.2.9"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
||||
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
|
||||
|
||||
yargs@^16.2.0:
|
||||
version "16.2.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
|
||||
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
|
||||
dependencies:
|
||||
cliui "^7.0.2"
|
||||
escalade "^3.1.1"
|
||||
get-caller-file "^2.0.5"
|
||||
require-directory "^2.1.1"
|
||||
string-width "^4.2.0"
|
||||
y18n "^5.0.5"
|
||||
yargs-parser "^20.2.2"
|
|
@ -1,18 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { BoxState, SetBox, N } from './protocol.js';
|
||||
import { Ref } from '@syndicate-lang/core';
|
||||
|
||||
export function boot(ds: Ref) {
|
||||
spawn named 'box' {
|
||||
field boxValue: number = 0;
|
||||
at ds {
|
||||
assert BoxState(boxValue.value);
|
||||
on message SetBox($v: number) => boxValue.value = v;
|
||||
}
|
||||
stop on (boxValue.value === N) {
|
||||
console.log('terminated box root facet');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { BoxState, SetBox } from './protocol.js';
|
||||
import { Ref } from '@syndicate-lang/core';
|
||||
|
||||
export function boot(ds: Ref, doneCallback: () => void) {
|
||||
spawn named 'client' {
|
||||
at ds {
|
||||
on asserted BoxState($v: number) => send message SetBox(v + 1);
|
||||
on retracted BoxState(_) => {
|
||||
console.log('box gone');
|
||||
doneCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { N } from './protocol.js';
|
||||
import * as Box from './box.js';
|
||||
import * as Client from './client.js';
|
||||
import { Dataspace } from '@syndicate-lang/core';
|
||||
|
||||
console.time('box-and-client-' + N.toString());
|
||||
Dataspace.boot(ds => {
|
||||
Box.boot(ds);
|
||||
Client.boot(ds, () => console.timeEnd('box-and-client-' + N.toString()));
|
||||
});
|
|
@ -1,7 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export assertion type BoxState(value: number);
|
||||
export message type SetBox(newValue: number);
|
||||
|
||||
export const N = 100000;
|
|
@ -1,287 +0,0 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@preserves/core@0.995.200", "@preserves/core@^0.995.200":
|
||||
version "0.995.200"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/core/-/core-0.995.200.tgz#65575cf8f9320e73b5d37fa9ac9d6881a33fd3a6"
|
||||
integrity sha512-htZ2x+hltUpKoPsviWSuelzZW96po9zVSsN0RZEih60FahNX0R2LCqFJ6v5lyATuQ9oHALVi0w8w4rtf8oiAJw==
|
||||
|
||||
"@preserves/schema@0.995.201":
|
||||
version "0.995.201"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/schema/-/schema-0.995.201.tgz#827ad539afb0fdf68ba885ee3ff43db0fd473aa5"
|
||||
integrity sha512-0SuhwOEAfxtrAeOTZ8V1yNEcHHHEbfUmoFawrF+vzTQFNZRz/X3LF1FM6wOiJlHtb7tBr4B+rHXX8jfNrqrdkA==
|
||||
dependencies:
|
||||
"@preserves/core" "^0.995.200"
|
||||
|
||||
"@rollup/pluginutils@^3.0.9":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
|
||||
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
|
||||
dependencies:
|
||||
"@types/estree" "0.0.39"
|
||||
estree-walker "^1.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@syndicate-lang/compiler@^0.21.1":
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/compiler/-/compiler-0.21.1.tgz#b6316bac14d053c313b3442be68f532a60c47cb3"
|
||||
integrity sha512-daaYh1i0XmoHt6eTtO4gWblfVKMjp9trwxqR62wUSONY3gtJ5Bn4hG3dMgfoMz2NvOWbJHaGz/95J0jRubITxA==
|
||||
|
||||
"@syndicate-lang/core@*", "@syndicate-lang/core@^0.32.0":
|
||||
version "0.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/core/-/core-0.32.0.tgz#0efbbff176cac2969c2b6ba70a19965add3a2c61"
|
||||
integrity sha512-ERVXk0W1xLaKvUa79Ek74YvqfBU543cUTb2GJvp76TP5k1jA97q9GzhddicS/s8lqu8SUC1+IXmKiJk0NX2TWQ==
|
||||
dependencies:
|
||||
salty-crypto "0.3.1"
|
||||
|
||||
"@syndicate-lang/tsc@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/tsc/-/tsc-0.34.0.tgz#1056fba7f639bbf436d0c2ecd2717edc4c1e612a"
|
||||
integrity sha512-Ufj3xsdXMbMCavWsEkX/pFyXRpNIWRW+LFew1icD14DoSLqyBcoUEvskolOSgkSzC53tDjbd4/LXDVofIjIyUA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
glob "^7.1.6"
|
||||
yargs "^16.2.0"
|
||||
|
||||
"@types/estree@0.0.39":
|
||||
version "0.0.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
|
||||
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^4.0.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
atob@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
|
||||
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
cliui@^7.0.2:
|
||||
version "7.0.4"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
||||
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
|
||||
dependencies:
|
||||
string-width "^4.2.0"
|
||||
strip-ansi "^6.0.0"
|
||||
wrap-ansi "^7.0.0"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
emoji-regex@^8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||
|
||||
escalade@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
|
||||
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
|
||||
|
||||
estree-walker@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
|
||||
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
||||
get-caller-file@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
glob@^7.1.6:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.1.1"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||
|
||||
minimatch@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
||||
|
||||
picomatch@^2.2.2:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
||||
|
||||
rollup-plugin-sourcemaps@^0.6:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed"
|
||||
integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^3.0.9"
|
||||
source-map-resolve "^0.6.0"
|
||||
|
||||
rollup@^2.60:
|
||||
version "2.79.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"
|
||||
integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
salty-crypto@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/salty-crypto/-/salty-crypto-0.3.1.tgz#1242cd948d8152aff104d0945980996b1602ba0e"
|
||||
integrity sha512-dCbF8/UzMV8oXPmMCHWzSp7u8G6NA+pHbaFBVqVgLVBiyxuwVn9iPbyt9WXT0EoXfL9sKt7U1mV+bgsGw5cV7A==
|
||||
|
||||
source-map-resolve@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
|
||||
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
|
||||
dependencies:
|
||||
atob "^2.1.2"
|
||||
decode-uri-component "^0.2.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
typescript@^4.9:
|
||||
version "4.9.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
wrap-ansi@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
||||
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
|
||||
|
||||
yargs-parser@^20.2.2:
|
||||
version "20.2.9"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
||||
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
|
||||
|
||||
yargs@^16.2.0:
|
||||
version "16.2.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
|
||||
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
|
||||
dependencies:
|
||||
cliui "^7.0.2"
|
||||
escalade "^3.1.1"
|
||||
get-caller-file "^2.0.5"
|
||||
require-directory "^2.1.1"
|
||||
string-width "^4.2.0"
|
||||
y18n "^5.0.5"
|
||||
yargs-parser "^20.2.2"
|
|
@ -1,17 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { BoxState, SetBox, N } from './protocol.js';
|
||||
|
||||
export function boot(ds) {
|
||||
spawn named 'box' {
|
||||
field boxValue = 0;
|
||||
at ds {
|
||||
assert BoxState(boxValue.value);
|
||||
on message SetBox($v) => boxValue.value = v;
|
||||
}
|
||||
stop on (boxValue.value === N) {
|
||||
console.log('terminated box root facet');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { BoxState, SetBox } from './protocol.js';
|
||||
|
||||
export function boot(ds, doneCallback) {
|
||||
spawn named 'client' {
|
||||
at ds {
|
||||
on asserted BoxState($v) => send message SetBox(v + 1);
|
||||
on retracted BoxState(_) => {
|
||||
console.log('box gone');
|
||||
doneCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { N } from './protocol.js';
|
||||
import * as Box from './box.js';
|
||||
import * as Client from './client.js';
|
||||
import { Dataspace } from '@syndicate-lang/core';
|
||||
|
||||
console.time('box-and-client-' + N.toString());
|
||||
Dataspace.boot(ds => {
|
||||
Box.boot(ds);
|
||||
Client.boot(ds, () => console.timeEnd('box-and-client-' + N.toString()));
|
||||
});
|
|
@ -1,7 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export assertion type BoxState(value);
|
||||
export message type SetBox(newValue);
|
||||
|
||||
export const N = 100000;
|
|
@ -1,275 +0,0 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@preserves/core@0.995.200":
|
||||
version "0.995.200"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/core/-/core-0.995.200.tgz#65575cf8f9320e73b5d37fa9ac9d6881a33fd3a6"
|
||||
integrity sha512-htZ2x+hltUpKoPsviWSuelzZW96po9zVSsN0RZEih60FahNX0R2LCqFJ6v5lyATuQ9oHALVi0w8w4rtf8oiAJw==
|
||||
|
||||
"@rollup/pluginutils@^3.0.9":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
|
||||
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
|
||||
dependencies:
|
||||
"@types/estree" "0.0.39"
|
||||
estree-walker "^1.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@syndicate-lang/compiler@^0.21.1":
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/compiler/-/compiler-0.21.1.tgz#b6316bac14d053c313b3442be68f532a60c47cb3"
|
||||
integrity sha512-daaYh1i0XmoHt6eTtO4gWblfVKMjp9trwxqR62wUSONY3gtJ5Bn4hG3dMgfoMz2NvOWbJHaGz/95J0jRubITxA==
|
||||
|
||||
"@syndicate-lang/core@*", "@syndicate-lang/core@^0.32.0":
|
||||
version "0.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/core/-/core-0.32.0.tgz#0efbbff176cac2969c2b6ba70a19965add3a2c61"
|
||||
integrity sha512-ERVXk0W1xLaKvUa79Ek74YvqfBU543cUTb2GJvp76TP5k1jA97q9GzhddicS/s8lqu8SUC1+IXmKiJk0NX2TWQ==
|
||||
dependencies:
|
||||
salty-crypto "0.3.1"
|
||||
|
||||
"@syndicate-lang/syndicatec@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/syndicatec/-/syndicatec-0.34.0.tgz#f3b88507b633552fe1f41f24def5121c0cafeaeb"
|
||||
integrity sha512-h3MPifJdXZTS3JVcvRG8GXMJMPBH4RYmJ3B7c2sjM826Pf6O8zT47Vuv1y2WyD9PS8BiSCI01uOR0W5AVJJT5w==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
glob "^7.1.6"
|
||||
yargs "^16.2.0"
|
||||
|
||||
"@types/estree@0.0.39":
|
||||
version "0.0.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
|
||||
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^4.0.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
atob@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
|
||||
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
cliui@^7.0.2:
|
||||
version "7.0.4"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
||||
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
|
||||
dependencies:
|
||||
string-width "^4.2.0"
|
||||
strip-ansi "^6.0.0"
|
||||
wrap-ansi "^7.0.0"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
emoji-regex@^8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||
|
||||
escalade@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
|
||||
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
|
||||
|
||||
estree-walker@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
|
||||
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
||||
get-caller-file@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
glob@^7.1.6:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.1.1"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||
|
||||
minimatch@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
||||
|
||||
picomatch@^2.2.2:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
||||
|
||||
rollup-plugin-sourcemaps@^0.6:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed"
|
||||
integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^3.0.9"
|
||||
source-map-resolve "^0.6.0"
|
||||
|
||||
rollup@^2.60:
|
||||
version "2.79.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"
|
||||
integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
salty-crypto@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/salty-crypto/-/salty-crypto-0.3.1.tgz#1242cd948d8152aff104d0945980996b1602ba0e"
|
||||
integrity sha512-dCbF8/UzMV8oXPmMCHWzSp7u8G6NA+pHbaFBVqVgLVBiyxuwVn9iPbyt9WXT0EoXfL9sKt7U1mV+bgsGw5cV7A==
|
||||
|
||||
source-map-resolve@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
|
||||
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
|
||||
dependencies:
|
||||
atob "^2.1.2"
|
||||
decode-uri-component "^0.2.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
wrap-ansi@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
||||
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
|
||||
|
||||
yargs-parser@^20.2.2:
|
||||
version "20.2.9"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
||||
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
|
||||
|
||||
yargs@^16.2.0:
|
||||
version "16.2.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
|
||||
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
|
||||
dependencies:
|
||||
cliui "^7.0.2"
|
||||
escalade "^3.1.1"
|
||||
get-caller-file "^2.0.5"
|
||||
require-directory "^2.1.1"
|
||||
string-width "^4.2.0"
|
||||
y18n "^5.0.5"
|
||||
yargs-parser "^20.2.2"
|
|
@ -1,18 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { BoxState, SetBox, N } from './protocol.js';
|
||||
import { Ref } from '@syndicate-lang/core';
|
||||
|
||||
export function boot(ds: Ref) {
|
||||
spawn named 'box' {
|
||||
field boxValue: number = 0;
|
||||
at ds {
|
||||
assert BoxState(boxValue.value);
|
||||
on message SetBox($v: number) => boxValue.value = v;
|
||||
}
|
||||
stop on (boxValue.value === N) {
|
||||
console.log('terminated box root facet');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { BoxState, SetBox } from './protocol.js';
|
||||
import { Ref } from '@syndicate-lang/core';
|
||||
|
||||
export function boot(ds: Ref, doneCallback: () => void) {
|
||||
spawn named 'client' {
|
||||
at ds {
|
||||
on asserted BoxState($v: number) => send message SetBox(v + 1);
|
||||
on retracted BoxState(_) => {
|
||||
console.log('box gone');
|
||||
doneCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { N } from './protocol.js';
|
||||
import * as Box from './box.js';
|
||||
import * as Client from './client.js';
|
||||
import { Dataspace } from '@syndicate-lang/core';
|
||||
|
||||
console.time('box-and-client-' + N.toString());
|
||||
Dataspace.boot(ds => {
|
||||
Box.boot(ds);
|
||||
Client.boot(ds, () => console.timeEnd('box-and-client-' + N.toString()));
|
||||
});
|
|
@ -1,7 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export assertion type BoxState(value: number);
|
||||
export message type SetBox(newValue: number);
|
||||
|
||||
export const N = 100000;
|
|
@ -1,287 +0,0 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@preserves/core@0.995.200", "@preserves/core@^0.995.200":
|
||||
version "0.995.200"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/core/-/core-0.995.200.tgz#65575cf8f9320e73b5d37fa9ac9d6881a33fd3a6"
|
||||
integrity sha512-htZ2x+hltUpKoPsviWSuelzZW96po9zVSsN0RZEih60FahNX0R2LCqFJ6v5lyATuQ9oHALVi0w8w4rtf8oiAJw==
|
||||
|
||||
"@preserves/schema@0.995.201":
|
||||
version "0.995.201"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/schema/-/schema-0.995.201.tgz#827ad539afb0fdf68ba885ee3ff43db0fd473aa5"
|
||||
integrity sha512-0SuhwOEAfxtrAeOTZ8V1yNEcHHHEbfUmoFawrF+vzTQFNZRz/X3LF1FM6wOiJlHtb7tBr4B+rHXX8jfNrqrdkA==
|
||||
dependencies:
|
||||
"@preserves/core" "^0.995.200"
|
||||
|
||||
"@rollup/pluginutils@^3.0.9":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
|
||||
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
|
||||
dependencies:
|
||||
"@types/estree" "0.0.39"
|
||||
estree-walker "^1.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@syndicate-lang/compiler@^0.21.1":
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/compiler/-/compiler-0.21.1.tgz#b6316bac14d053c313b3442be68f532a60c47cb3"
|
||||
integrity sha512-daaYh1i0XmoHt6eTtO4gWblfVKMjp9trwxqR62wUSONY3gtJ5Bn4hG3dMgfoMz2NvOWbJHaGz/95J0jRubITxA==
|
||||
|
||||
"@syndicate-lang/core@*", "@syndicate-lang/core@^0.32.0":
|
||||
version "0.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/core/-/core-0.32.0.tgz#0efbbff176cac2969c2b6ba70a19965add3a2c61"
|
||||
integrity sha512-ERVXk0W1xLaKvUa79Ek74YvqfBU543cUTb2GJvp76TP5k1jA97q9GzhddicS/s8lqu8SUC1+IXmKiJk0NX2TWQ==
|
||||
dependencies:
|
||||
salty-crypto "0.3.1"
|
||||
|
||||
"@syndicate-lang/syndicatec@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/syndicatec/-/syndicatec-0.34.0.tgz#f3b88507b633552fe1f41f24def5121c0cafeaeb"
|
||||
integrity sha512-h3MPifJdXZTS3JVcvRG8GXMJMPBH4RYmJ3B7c2sjM826Pf6O8zT47Vuv1y2WyD9PS8BiSCI01uOR0W5AVJJT5w==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
glob "^7.1.6"
|
||||
yargs "^16.2.0"
|
||||
|
||||
"@types/estree@0.0.39":
|
||||
version "0.0.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
|
||||
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^4.0.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
atob@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
|
||||
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
cliui@^7.0.2:
|
||||
version "7.0.4"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
||||
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
|
||||
dependencies:
|
||||
string-width "^4.2.0"
|
||||
strip-ansi "^6.0.0"
|
||||
wrap-ansi "^7.0.0"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
emoji-regex@^8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||
|
||||
escalade@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
|
||||
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
|
||||
|
||||
estree-walker@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
|
||||
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
||||
get-caller-file@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
glob@^7.1.6:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.1.1"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||
|
||||
minimatch@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
||||
|
||||
picomatch@^2.2.2:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
||||
|
||||
rollup-plugin-sourcemaps@^0.6:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed"
|
||||
integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^3.0.9"
|
||||
source-map-resolve "^0.6.0"
|
||||
|
||||
rollup@^2.60:
|
||||
version "2.79.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"
|
||||
integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
salty-crypto@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/salty-crypto/-/salty-crypto-0.3.1.tgz#1242cd948d8152aff104d0945980996b1602ba0e"
|
||||
integrity sha512-dCbF8/UzMV8oXPmMCHWzSp7u8G6NA+pHbaFBVqVgLVBiyxuwVn9iPbyt9WXT0EoXfL9sKt7U1mV+bgsGw5cV7A==
|
||||
|
||||
source-map-resolve@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
|
||||
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
|
||||
dependencies:
|
||||
atob "^2.1.2"
|
||||
decode-uri-component "^0.2.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
typescript@^4.9:
|
||||
version "4.9.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
wrap-ansi@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
||||
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
|
||||
|
||||
yargs-parser@^20.2.2:
|
||||
version "20.2.9"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
||||
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
|
||||
|
||||
yargs@^16.2.0:
|
||||
version "16.2.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
|
||||
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
|
||||
dependencies:
|
||||
cliui "^7.0.2"
|
||||
escalade "^3.1.1"
|
||||
get-caller-file "^2.0.5"
|
||||
require-directory "^2.1.1"
|
||||
string-width "^4.2.0"
|
||||
y18n "^5.0.5"
|
||||
yargs-parser "^20.2.2"
|
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/env -S node -r @syndicate-lang/loader
|
||||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
const { stringify } = require('@syndicate-lang/core');
|
||||
const { service } = require('@syndicate-lang/service');
|
||||
|
||||
service(args => {
|
||||
console.log('+', stringify(args));
|
||||
on stop { console.log('-', stringify(args)); }
|
||||
});
|
|
@ -1,9 +0,0 @@
|
|||
<require-service <daemon example>>
|
||||
<daemon example {
|
||||
argv: "./example.js"
|
||||
protocol: application/syndicate
|
||||
}>
|
||||
? <service-object <daemon example> ?cap> [
|
||||
$cap += =here-is-your-configuration!
|
||||
$cap += =here-is-another-configuration!
|
||||
]
|
|
@ -1,195 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { Turn, Dataspace, Double, floatValue, Ref, Facet } from '@syndicate-lang/core';
|
||||
import { boot as bootHtml, WindowEvent, template, Anchor } from '@syndicate-lang/html';
|
||||
import { boot as bootTimer, PeriodicTick } from '@syndicate-lang/timer';
|
||||
|
||||
assertion type Position(x, y);
|
||||
assertion type GameOver();
|
||||
assertion type Score(count);
|
||||
message type IncreaseScore();
|
||||
message type Reset();
|
||||
|
||||
const BOARD_HEIGHT = 567;
|
||||
const FLAPPY_WIDTH = 57;
|
||||
const FLAPPY_HEIGHT = 41;
|
||||
const FLAPPY_XPOS = 212;
|
||||
const PILLAR_WIDTH = 86;
|
||||
const PILLAR_GAP = 158;
|
||||
const FIELD_HEIGHT = 561;
|
||||
const PILLAR_HEAD_HEIGHT = 40;
|
||||
|
||||
export function main() {
|
||||
Dataspace.boot(mainDs => {
|
||||
bootHtml(mainDs);
|
||||
bootTimer(mainDs);
|
||||
spawn named 'game-factory' {
|
||||
spawnGame(mainDs);
|
||||
at mainDs {
|
||||
during GameOver() => {
|
||||
on stop spawnGame(mainDs);
|
||||
on message WindowEvent('+keypress', $_e) => send message Reset();
|
||||
on message WindowEvent('+click', $_e) => send message Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function spawnGame(mainDs: Ref) {
|
||||
spawn named 'GameInstance' {
|
||||
const gameDs = create new Dataspace();
|
||||
|
||||
at gameDs {
|
||||
during GameOver() => at mainDs {
|
||||
assert GameOver();
|
||||
}
|
||||
}
|
||||
at mainDs {
|
||||
stop on message Reset();
|
||||
}
|
||||
|
||||
spawn linked named 'score' {
|
||||
let ui = new Anchor();
|
||||
field score: number = 0;
|
||||
|
||||
at gameDs {
|
||||
assert Score(score.value);
|
||||
on message IncreaseScore() => score.value++;
|
||||
}
|
||||
|
||||
react {
|
||||
at mainDs {
|
||||
assert ui.html('#board-area', template`<h1 class="score">${score.value}</h1>`);
|
||||
}
|
||||
at gameDs {
|
||||
stop on asserted GameOver() => react {
|
||||
at mainDs {
|
||||
assert ui.html(
|
||||
'#board-area',
|
||||
template`<h1 class="score">${score.value}<br/>GAME OVER</h1>`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spawn linked named 'flappy' {
|
||||
let ui = new Anchor();
|
||||
field xpos: number = 0;
|
||||
field ypos: number = 312;
|
||||
field yvel: number = 0;
|
||||
|
||||
at gameDs {
|
||||
assert Position(Double(xpos.value), Double(ypos.value));
|
||||
|
||||
on (ypos.value > BOARD_HEIGHT - FLAPPY_HEIGHT) {
|
||||
ypos.value = BOARD_HEIGHT - FLAPPY_HEIGHT;
|
||||
assert GameOver();
|
||||
}
|
||||
}
|
||||
|
||||
at mainDs {
|
||||
assert ui.html(
|
||||
'#board-area',
|
||||
template`<div class="flappy"
|
||||
style="${`transform: rotate(${2 * yvel.value}deg);
|
||||
top: ${ypos.value}px`}"></div>`);
|
||||
}
|
||||
|
||||
react {
|
||||
at gameDs {
|
||||
stop on asserted GameOver();
|
||||
}
|
||||
|
||||
at mainDs {
|
||||
on message WindowEvent('+keypress', $_e) => yvel.value = -10;
|
||||
on message WindowEvent('+click', $_e) => yvel.value = -10;
|
||||
|
||||
const seconds_per_tick = 1 / 60;
|
||||
const seconds_per_tick_d = Double(seconds_per_tick);
|
||||
on message PeriodicTick(seconds_per_tick_d) => {
|
||||
xpos.value += 150 * seconds_per_tick;
|
||||
ypos.value = (ypos.value + yvel.value);
|
||||
yvel.value += seconds_per_tick * 50;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spawn linked named 'border-scroll' {
|
||||
let ui = new Anchor();
|
||||
field pos: number = 0;
|
||||
at gameDs {
|
||||
on asserted Position($xpos, _) => pos.value = floatValue(xpos) % 23;
|
||||
}
|
||||
at mainDs {
|
||||
assert ui.html(
|
||||
'#board-area',
|
||||
template`<div class="scrolling-border" style="${`background-position-x: ${-pos.value}px`}"></div>`,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
spawn linked named 'pipe-factory' {
|
||||
field nextPipe: number = 0;
|
||||
at gameDs {
|
||||
on asserted Score(nextPipe.value) => {
|
||||
react {
|
||||
const pipeNumber = nextPipe.value++;
|
||||
spawn linked named ['pipe', pipeNumber] {
|
||||
runPipe(pipeNumber, Turn.activeFacet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function runPipe(i: number, mainPipeFacet: Facet) {
|
||||
const xlocation = (i + 1) * 324;
|
||||
|
||||
let ui = new Anchor();
|
||||
field xpos: number = xlocation;
|
||||
|
||||
const upperHeight =
|
||||
Math.random() * (FIELD_HEIGHT - PILLAR_GAP - PILLAR_HEAD_HEIGHT * 6)
|
||||
+ PILLAR_HEAD_HEIGHT * 3;
|
||||
const lowerHeight = FIELD_HEIGHT - upperHeight - PILLAR_GAP;
|
||||
|
||||
stop mainPipeFacet on (xpos.value < -(PILLAR_WIDTH + FLAPPY_XPOS));
|
||||
|
||||
at gameDs {
|
||||
once (xpos.value <= 0) send message IncreaseScore();
|
||||
|
||||
on asserted Position($flappyXpos, _) =>
|
||||
xpos.value = xlocation - floatValue(flappyXpos);
|
||||
|
||||
on asserted Position($xpos, $ypos) => {
|
||||
if (touchingPillar(floatValue(xpos), floatValue(ypos))) {
|
||||
assert GameOver();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
at mainDs {
|
||||
assert ui.html(
|
||||
'#board-area',
|
||||
template`<div class="pillars">
|
||||
<div class="pillar pillar-upper"
|
||||
style="${`left: ${xpos.value + FLAPPY_XPOS}px; height: ${upperHeight}px;`}"></div>
|
||||
<div class="pillar pillar-lower"
|
||||
style="${`left: ${xpos.value + FLAPPY_XPOS}px; height: ${lowerHeight}px;`}"></div>
|
||||
</div>`);
|
||||
}
|
||||
|
||||
function touchingPillar(xpos: number, ypos: number): boolean {
|
||||
const inHorizontalRange =
|
||||
(xpos + FLAPPY_WIDTH >= xlocation) && (xpos <= xlocation + PILLAR_WIDTH);
|
||||
const aboveGapTop = (ypos <= upperHeight);
|
||||
const belowGapBottom = (ypos + FLAPPY_HEIGHT >= upperHeight + PILLAR_GAP);
|
||||
return inHorizontalRange && (aboveGapTop || belowGapBottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,309 +0,0 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@preserves/core@0.995.200", "@preserves/core@^0.995.200":
|
||||
version "0.995.200"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/core/-/core-0.995.200.tgz#65575cf8f9320e73b5d37fa9ac9d6881a33fd3a6"
|
||||
integrity sha512-htZ2x+hltUpKoPsviWSuelzZW96po9zVSsN0RZEih60FahNX0R2LCqFJ6v5lyATuQ9oHALVi0w8w4rtf8oiAJw==
|
||||
|
||||
"@preserves/schema@0.995.201":
|
||||
version "0.995.201"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/schema/-/schema-0.995.201.tgz#827ad539afb0fdf68ba885ee3ff43db0fd473aa5"
|
||||
integrity sha512-0SuhwOEAfxtrAeOTZ8V1yNEcHHHEbfUmoFawrF+vzTQFNZRz/X3LF1FM6wOiJlHtb7tBr4B+rHXX8jfNrqrdkA==
|
||||
dependencies:
|
||||
"@preserves/core" "^0.995.200"
|
||||
|
||||
"@rollup/pluginutils@^3.0.9":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
|
||||
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
|
||||
dependencies:
|
||||
"@types/estree" "0.0.39"
|
||||
estree-walker "^1.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@syndicate-lang/compiler@^0.21.1":
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/compiler/-/compiler-0.21.1.tgz#b6316bac14d053c313b3442be68f532a60c47cb3"
|
||||
integrity sha512-daaYh1i0XmoHt6eTtO4gWblfVKMjp9trwxqR62wUSONY3gtJ5Bn4hG3dMgfoMz2NvOWbJHaGz/95J0jRubITxA==
|
||||
|
||||
"@syndicate-lang/core@*", "@syndicate-lang/core@^0.32.0":
|
||||
version "0.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/core/-/core-0.32.0.tgz#0efbbff176cac2969c2b6ba70a19965add3a2c61"
|
||||
integrity sha512-ERVXk0W1xLaKvUa79Ek74YvqfBU543cUTb2GJvp76TP5k1jA97q9GzhddicS/s8lqu8SUC1+IXmKiJk0NX2TWQ==
|
||||
dependencies:
|
||||
salty-crypto "0.3.1"
|
||||
|
||||
"@syndicate-lang/html@*":
|
||||
version "0.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/html/-/html-0.33.0.tgz#c53e6bf8a52b17c3747f4270713a8c9234f984af"
|
||||
integrity sha512-xhN6NZOgLxlAQOyWG0JAgtyF1e1yQvrpNh5RBAPnucFYC024yo1ggZ08+KiaulhsoIKvRbBE6FU6p9dDm4/tpQ==
|
||||
dependencies:
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
|
||||
"@syndicate-lang/timer@*":
|
||||
version "0.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/timer/-/timer-0.33.0.tgz#cdb38ebe777332ec58a5b0b9483db809275a61de"
|
||||
integrity sha512-cBon+nk8zvNeU4zC6tg7nhgJnmrRoXHYE140UK3gscNFcg1LZ1d7q9WxfVTzFtRocRBslv6pworSwCDn3Go7TQ==
|
||||
dependencies:
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
|
||||
"@syndicate-lang/ts-plugin@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/ts-plugin/-/ts-plugin-0.34.0.tgz#df92f9044eeba528c80c41c5c9df49ee28902411"
|
||||
integrity sha512-OCO6Hm0euz2hZk6tYTrJQNEM8iDBeQ/dgpW2a/UP52XSP6fYj0OvUVfn+35ZkIL64S+zDsJjL/6XFN05UZyRGA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
|
||||
"@syndicate-lang/tsc@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/tsc/-/tsc-0.34.0.tgz#1056fba7f639bbf436d0c2ecd2717edc4c1e612a"
|
||||
integrity sha512-Ufj3xsdXMbMCavWsEkX/pFyXRpNIWRW+LFew1icD14DoSLqyBcoUEvskolOSgkSzC53tDjbd4/LXDVofIjIyUA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
glob "^7.1.6"
|
||||
yargs "^16.2.0"
|
||||
|
||||
"@types/estree@0.0.39":
|
||||
version "0.0.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
|
||||
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^4.0.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
atob@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
|
||||
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
cliui@^7.0.2:
|
||||
version "7.0.4"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
||||
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
|
||||
dependencies:
|
||||
string-width "^4.2.0"
|
||||
strip-ansi "^6.0.0"
|
||||
wrap-ansi "^7.0.0"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
emoji-regex@^8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||
|
||||
escalade@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
|
||||
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
|
||||
|
||||
estree-walker@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
|
||||
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
||||
get-caller-file@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
glob@^7.1.6:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.1.1"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||
|
||||
minimatch@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
||||
|
||||
picomatch@^2.2.2:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
||||
|
||||
rollup-plugin-sourcemaps@^0.6:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed"
|
||||
integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^3.0.9"
|
||||
source-map-resolve "^0.6.0"
|
||||
|
||||
rollup@^2.60:
|
||||
version "2.79.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"
|
||||
integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
salty-crypto@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/salty-crypto/-/salty-crypto-0.3.1.tgz#1242cd948d8152aff104d0945980996b1602ba0e"
|
||||
integrity sha512-dCbF8/UzMV8oXPmMCHWzSp7u8G6NA+pHbaFBVqVgLVBiyxuwVn9iPbyt9WXT0EoXfL9sKt7U1mV+bgsGw5cV7A==
|
||||
|
||||
source-map-resolve@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
|
||||
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
|
||||
dependencies:
|
||||
atob "^2.1.2"
|
||||
decode-uri-component "^0.2.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
typescript@^4.9:
|
||||
version "4.9.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
wrap-ansi@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
||||
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
|
||||
|
||||
yargs-parser@^20.2.2:
|
||||
version "20.2.9"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
||||
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
|
||||
|
||||
yargs@^16.2.0:
|
||||
version "16.2.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
|
||||
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
|
||||
dependencies:
|
||||
cliui "^7.0.2"
|
||||
escalade "^3.1.1"
|
||||
get-caller-file "^2.0.5"
|
||||
require-directory "^2.1.1"
|
||||
string-width "^4.2.0"
|
||||
y18n "^5.0.5"
|
||||
yargs-parser "^20.2.2"
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"name": "@syndicate-lang/syndicate-html-example-table",
|
||||
"private": true,
|
||||
"description": "Simple HTML UI Syndicate example",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepare": "yarn compile && yarn rollup",
|
||||
"compile": "syndicate-tsc",
|
||||
"compile:watch": "syndicate-tsc -w --verbose --intermediate-directory src.ts",
|
||||
"rollup": "rollup -c",
|
||||
"rollup:watch": "rollup -c -w",
|
||||
"clean": "rm -rf lib/ index.js index.js.map"
|
||||
},
|
||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||
"license": "GPL-3.0+",
|
||||
"dependencies": {
|
||||
"@preserves/core": "^0.995.200",
|
||||
"@preserves/schema": "^0.995.201",
|
||||
"@syndicate-lang/core": "*",
|
||||
"@syndicate-lang/html": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@syndicate-lang/ts-plugin": "*",
|
||||
"@syndicate-lang/tsc": "*",
|
||||
"rollup": "^2.60",
|
||||
"rollup-plugin-sourcemaps": "^0.6",
|
||||
"typescript": "^4.9"
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { Dataspace, Value, Ref } from '@syndicate-lang/core';
|
||||
import { boot as bootHtml, UIEvent, GlobalEvent, HtmlFragments, template, Anchor } from '@syndicate-lang/html';
|
||||
|
||||
assertion type Person(id, firstName, lastName, address, age);
|
||||
message type SetSortColumn(number);
|
||||
|
||||
Dataspace.boot(ds => {
|
||||
bootHtml(ds);
|
||||
at ds {
|
||||
function newRow(id: number, firstName: string, lastName: string, address: string, age: number) {
|
||||
spawn named ('model' + id) {
|
||||
assert Person(id, firstName, lastName, address, age);
|
||||
}
|
||||
}
|
||||
|
||||
newRow(1, 'Keith', 'Example', '94 Main St.', 44);
|
||||
newRow(2, 'Karen', 'Fakeperson', '5504 Long Dr.', 34);
|
||||
newRow(3, 'Angus', 'McFictional', '2B Pioneer Heights', 39);
|
||||
newRow(4, 'Sue', 'Donnem', '1 Infinite Loop', 104);
|
||||
newRow(5, 'Boaty', 'McBoatface', 'Arctic Ocean', 1);
|
||||
|
||||
spawn named 'view' {
|
||||
let ui = new Anchor();
|
||||
field orderColumn: number = 2;
|
||||
|
||||
function cell(text: Value): HtmlFragments {
|
||||
return template`<td>${text.toString()}</td>`;
|
||||
}
|
||||
|
||||
on message SetSortColumn($c: number) => orderColumn.value = c;
|
||||
|
||||
during Person($id: number, $firstName: string, $lastName: string, $address: string, $age: number) => {
|
||||
assert ui.context(id).html(
|
||||
'table#the-table tbody',
|
||||
template`<tr>${[id, firstName, lastName, address, age].map(cell)}</tr>`,
|
||||
[id, firstName, lastName, address, age][orderColumn.value]);
|
||||
}
|
||||
}
|
||||
|
||||
spawn named 'controller' {
|
||||
on message GlobalEvent('table#the-table th', 'click', $e) => {
|
||||
const event = (e as Ref).target.data as Event;
|
||||
send message SetSortColumn(JSON.parse((event.target as HTMLElement).dataset.column!));
|
||||
}
|
||||
}
|
||||
|
||||
spawn named 'alerter' {
|
||||
let ui = new Anchor();
|
||||
assert ui.html('#extra', template`<button>Click me</button>`);
|
||||
|
||||
on message UIEvent(ui.fragmentId, '.', 'click', $_e) => {
|
||||
alert("Hello!");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": ["ES2017", "DOM"],
|
||||
"declaration": true,
|
||||
"baseUrl": "./src",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"declarationDir": "./lib",
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node",
|
||||
"module": "es6",
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"plugins": [
|
||||
{ "name": "@syndicate-lang/ts-plugin" }
|
||||
]
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
|
@ -1,302 +0,0 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@preserves/core@0.995.200", "@preserves/core@^0.995.200":
|
||||
version "0.995.200"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/core/-/core-0.995.200.tgz#65575cf8f9320e73b5d37fa9ac9d6881a33fd3a6"
|
||||
integrity sha512-htZ2x+hltUpKoPsviWSuelzZW96po9zVSsN0RZEih60FahNX0R2LCqFJ6v5lyATuQ9oHALVi0w8w4rtf8oiAJw==
|
||||
|
||||
"@preserves/schema@0.995.201":
|
||||
version "0.995.201"
|
||||
resolved "https://registry.yarnpkg.com/@preserves/schema/-/schema-0.995.201.tgz#827ad539afb0fdf68ba885ee3ff43db0fd473aa5"
|
||||
integrity sha512-0SuhwOEAfxtrAeOTZ8V1yNEcHHHEbfUmoFawrF+vzTQFNZRz/X3LF1FM6wOiJlHtb7tBr4B+rHXX8jfNrqrdkA==
|
||||
dependencies:
|
||||
"@preserves/core" "^0.995.200"
|
||||
|
||||
"@rollup/pluginutils@^3.0.9":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
|
||||
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
|
||||
dependencies:
|
||||
"@types/estree" "0.0.39"
|
||||
estree-walker "^1.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@syndicate-lang/compiler@^0.21.1":
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/compiler/-/compiler-0.21.1.tgz#b6316bac14d053c313b3442be68f532a60c47cb3"
|
||||
integrity sha512-daaYh1i0XmoHt6eTtO4gWblfVKMjp9trwxqR62wUSONY3gtJ5Bn4hG3dMgfoMz2NvOWbJHaGz/95J0jRubITxA==
|
||||
|
||||
"@syndicate-lang/core@*", "@syndicate-lang/core@^0.32.0":
|
||||
version "0.32.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/core/-/core-0.32.0.tgz#0efbbff176cac2969c2b6ba70a19965add3a2c61"
|
||||
integrity sha512-ERVXk0W1xLaKvUa79Ek74YvqfBU543cUTb2GJvp76TP5k1jA97q9GzhddicS/s8lqu8SUC1+IXmKiJk0NX2TWQ==
|
||||
dependencies:
|
||||
salty-crypto "0.3.1"
|
||||
|
||||
"@syndicate-lang/html@*":
|
||||
version "0.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/html/-/html-0.33.0.tgz#c53e6bf8a52b17c3747f4270713a8c9234f984af"
|
||||
integrity sha512-xhN6NZOgLxlAQOyWG0JAgtyF1e1yQvrpNh5RBAPnucFYC024yo1ggZ08+KiaulhsoIKvRbBE6FU6p9dDm4/tpQ==
|
||||
dependencies:
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
|
||||
"@syndicate-lang/ts-plugin@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/ts-plugin/-/ts-plugin-0.34.0.tgz#df92f9044eeba528c80c41c5c9df49ee28902411"
|
||||
integrity sha512-OCO6Hm0euz2hZk6tYTrJQNEM8iDBeQ/dgpW2a/UP52XSP6fYj0OvUVfn+35ZkIL64S+zDsJjL/6XFN05UZyRGA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
|
||||
"@syndicate-lang/tsc@*":
|
||||
version "0.34.0"
|
||||
resolved "https://registry.yarnpkg.com/@syndicate-lang/tsc/-/tsc-0.34.0.tgz#1056fba7f639bbf436d0c2ecd2717edc4c1e612a"
|
||||
integrity sha512-Ufj3xsdXMbMCavWsEkX/pFyXRpNIWRW+LFew1icD14DoSLqyBcoUEvskolOSgkSzC53tDjbd4/LXDVofIjIyUA==
|
||||
dependencies:
|
||||
"@syndicate-lang/compiler" "^0.21.1"
|
||||
"@syndicate-lang/core" "^0.32.0"
|
||||
glob "^7.1.6"
|
||||
yargs "^16.2.0"
|
||||
|
||||
"@types/estree@0.0.39":
|
||||
version "0.0.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
|
||||
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^4.0.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
atob@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
|
||||
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
cliui@^7.0.2:
|
||||
version "7.0.4"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
||||
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
|
||||
dependencies:
|
||||
string-width "^4.2.0"
|
||||
strip-ansi "^6.0.0"
|
||||
wrap-ansi "^7.0.0"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
emoji-regex@^8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||
|
||||
escalade@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
|
||||
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
|
||||
|
||||
estree-walker@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
|
||||
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
||||
get-caller-file@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
glob@^7.1.6:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.1.1"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||
|
||||
minimatch@^3.1.1:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
||||
|
||||
picomatch@^2.2.2:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
||||
|
||||
rollup-plugin-sourcemaps@^0.6:
|
||||
version "0.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed"
|
||||
integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==
|
||||
dependencies:
|
||||
"@rollup/pluginutils" "^3.0.9"
|
||||
source-map-resolve "^0.6.0"
|
||||
|
||||
rollup@^2.60:
|
||||
version "2.79.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"
|
||||
integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
salty-crypto@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/salty-crypto/-/salty-crypto-0.3.1.tgz#1242cd948d8152aff104d0945980996b1602ba0e"
|
||||
integrity sha512-dCbF8/UzMV8oXPmMCHWzSp7u8G6NA+pHbaFBVqVgLVBiyxuwVn9iPbyt9WXT0EoXfL9sKt7U1mV+bgsGw5cV7A==
|
||||
|
||||
source-map-resolve@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
|
||||
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
|
||||
dependencies:
|
||||
atob "^2.1.2"
|
||||
decode-uri-component "^0.2.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
typescript@^4.9:
|
||||
version "4.9.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
wrap-ansi@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
y18n@^5.0.5:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
||||
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
|
||||
|
||||
yargs-parser@^20.2.2:
|
||||
version "20.2.9"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
||||
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
|
||||
|
||||
yargs@^16.2.0:
|
||||
version "16.2.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
|
||||
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
|
||||
dependencies:
|
||||
cliui "^7.0.2"
|
||||
escalade "^3.1.1"
|
||||
get-caller-file "^2.0.5"
|
||||
require-directory "^2.1.1"
|
||||
string-width "^4.2.0"
|
||||
y18n "^5.0.5"
|
||||
yargs-parser "^20.2.2"
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
exec 1>&2
|
||||
|
||||
fixcopyright.rkt -n --preset-typescript --file-pattern 'packages/**.ts' --ignore '**/node_modules/**' GPL-3.0-or-later
|
||||
fixcopyright.rkt -n --preset-javascript --file-pattern 'packages/**.js' --ignore '**/node_modules/**' GPL-3.0-or-later
|
33
package.json
33
package.json
|
@ -1,25 +1,20 @@
|
|||
{
|
||||
"name": "@syndicate-lang/root",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"packages/*",
|
||||
"packages/*/examples/*/"
|
||||
],
|
||||
"workspaces": ["packages/*", "packages/*/examples/*/"],
|
||||
"devDependencies": {
|
||||
"@preserves/core": "^0.995.201",
|
||||
"@rollup/plugin-node-resolve": "^13.0",
|
||||
"@types/jest": "^27.0",
|
||||
"@types/node": "^14",
|
||||
"esm": "^3.2",
|
||||
"jest": "^27.4",
|
||||
"lerna": "^4.0",
|
||||
"rollup": "^2.60",
|
||||
"rollup-plugin-sourcemaps": "^0.6",
|
||||
"rollup-plugin-terser": "^7.0",
|
||||
"ts-jest": "^27.0",
|
||||
"ts-node": "^10.4",
|
||||
"ts-node-dev": "^1.1",
|
||||
"typescript": "^4.9",
|
||||
"typescript-language-server": "^3.0"
|
||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||
"@types/jest": "^26.0.19",
|
||||
"@types/node": "^14.14.20",
|
||||
"esm": "^3.2.25",
|
||||
"jest": "^26.6.3",
|
||||
"lerna": "^3.22.1",
|
||||
"rollup": "^2.36.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"ts-jest": "^26.4.4",
|
||||
"ts-node": "^9.1.1",
|
||||
"ts-node-dev": "^1.1.1",
|
||||
"typescript": "^4.1.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
index.js
|
||||
index.min.js
|
||||
*.js.map
|
|
@ -1,21 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2023-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
const SyndicateBrowserStdenv = {
|
||||
autoboot: true,
|
||||
autoboot_options: {
|
||||
SyndicateWsRelay: {
|
||||
debug: false,
|
||||
},
|
||||
},
|
||||
boot() {
|
||||
SyndicateHtml2.boot();
|
||||
SyndicateWsRelay.boot(void 0, this.autoboot_options.SyndicateWsRelay.debug);
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
if (SyndicateBrowserStdenv.autoboot) {
|
||||
SyndicateBrowserStdenv.boot();
|
||||
}
|
||||
});
|
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
M=../../node_modules
|
||||
|
||||
cat \
|
||||
$M/@preserves/core/dist/preserves.js \
|
||||
$M/@preserves/schema/dist/preserves-schema.js \
|
||||
$M/@preserves/schema/dist/preserves-schema-browser.js \
|
||||
$M/@syndicate-lang/core/dist/syndicate.js \
|
||||
$M/@syndicate-lang/html2/dist/syndicate-html2.js \
|
||||
$M/@syndicate-lang/ws-relay/dist/syndicate-ws-relay.js \
|
||||
$M/@syndicate-lang/compiler/dist/syndicate-compiler.js \
|
||||
$M/@syndicate-lang/compiler/dist/syndicate-browser-compiler.js \
|
||||
boot.js \
|
||||
> index.js
|
||||
|
||||
cp \
|
||||
$M/@syndicate-lang/core/dist/syndicate.js.map \
|
||||
$M/@syndicate-lang/html2/dist/syndicate-html2.js.map \
|
||||
$M/@syndicate-lang/ws-relay/dist/syndicate-ws-relay.js.map \
|
||||
$M/@syndicate-lang/compiler/dist/syndicate-compiler.js.map \
|
||||
.
|
||||
|
||||
cat \
|
||||
$M/@preserves/core/dist/preserves.min.js \
|
||||
$M/@preserves/schema/dist/preserves-schema.min.js \
|
||||
$M/@preserves/schema/dist/preserves-schema-browser.js \
|
||||
$M/@syndicate-lang/core/dist/syndicate.min.js \
|
||||
$M/@syndicate-lang/html2/dist/syndicate-html2.min.js \
|
||||
$M/@syndicate-lang/ws-relay/dist/syndicate-ws-relay.min.js \
|
||||
$M/@syndicate-lang/compiler/dist/syndicate-compiler.min.js \
|
||||
$M/@syndicate-lang/compiler/dist/syndicate-browser-compiler.js \
|
||||
boot.js \
|
||||
> index.min.js
|
||||
|
||||
cp \
|
||||
$M/@syndicate-lang/core/dist/syndicate.min.js.map \
|
||||
$M/@syndicate-lang/html2/dist/syndicate-html2.min.js.map \
|
||||
$M/@syndicate-lang/ws-relay/dist/syndicate-ws-relay.min.js.map \
|
||||
$M/@syndicate-lang/compiler/dist/syndicate-compiler.min.js.map \
|
||||
.
|
||||
|
||||
echo $(date) $(pwd) 'build complete.'
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<script src="../index.js"></script>
|
||||
<script type="syndicate">
|
||||
spawn named 'clicker' {
|
||||
field counter = 0;
|
||||
const b = new SyndicateHtml2.Widget(t => t`<button>clicks: ${counter.value}</button>`)
|
||||
.setParent('body')
|
||||
.on('click', () => counter.value++);
|
||||
}
|
||||
</script>
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
"name": "@syndicate-lang/browser-stdenv",
|
||||
"version": "0.35.1",
|
||||
"description": "Aggregated Syndicate and Preserves scripts for in-browser use",
|
||||
"homepage": "https://github.com/syndicate-lang/syndicate-js/tree/main/packages/browser-stdenv",
|
||||
"license": "GPL-3.0+",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.syndicate-lang.org/syndicate-lang/syndicate-js"
|
||||
},
|
||||
"main": "index.min.js",
|
||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||
"scripts": {
|
||||
"prepare": "./build-aggregate.sh",
|
||||
"prepare:watch": "cd ..; exec inotifytest browser-stdenv/build-aggregate.sh",
|
||||
"clean": "rm -rf index.js index.min.js *.js.map",
|
||||
"veryclean": "yarn run clean && rm -rf node_modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"@preserves/core": "^0.995.200",
|
||||
"@preserves/schema": "^0.995.201",
|
||||
"@syndicate-lang/compiler": "^0.22.0",
|
||||
"@syndicate-lang/core": "^0.34.1",
|
||||
"@syndicate-lang/html2": "^0.35.1",
|
||||
"@syndicate-lang/ws-relay": "^0.36.1"
|
||||
}
|
||||
}
|
|
@ -1,674 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
@ -0,0 +1 @@
|
|||
gpl-3.0.txt
|
|
@ -0,0 +1 @@
|
|||
../../Makefile.generic-package
|
|
@ -1,7 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export default {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
};
|
|
@ -1,30 +1,19 @@
|
|||
{
|
||||
"name": "@syndicate-lang/compiler",
|
||||
"version": "0.22.0",
|
||||
"version": "0.2.0",
|
||||
"description": "Syndicate/JS compiler library",
|
||||
"homepage": "https://github.com/syndicate-lang/syndicate-js/tree/main/packages/compiler",
|
||||
"homepage": "https://github.com/syndicate-lang/syndicate-js/tree/master/packages/compiler",
|
||||
"license": "GPL-3.0+",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.syndicate-lang.org/syndicate-lang/syndicate-js"
|
||||
},
|
||||
"repository": "github:syndicate-lang/syndicate-js",
|
||||
"scripts": {
|
||||
"prepare": "yarn compile && yarn rollup && cp syndicate-browser-compiler.js dist/",
|
||||
"prepare": "yarn compile && yarn rollup",
|
||||
"compile": "../../node_modules/.bin/tsc",
|
||||
"compile:watch": "../../node_modules/.bin/tsc -w",
|
||||
"rollup": "../../node_modules/.bin/rollup -c",
|
||||
"rollup:watch": "../../node_modules/.bin/rollup -c -w",
|
||||
"clean": "rm -rf lib dist",
|
||||
"veryclean": "yarn run clean && rm -rf node_modules",
|
||||
"test": "../../node_modules/.bin/jest",
|
||||
"test:watch": "yarn test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-beautify": "1.14",
|
||||
"js-beautify": "1.15"
|
||||
"rollup:watch": "../../node_modules/.bin/rollup -c -w"
|
||||
},
|
||||
"main": "dist/syndicate-compiler.js",
|
||||
"module": "lib/index.js",
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { SyndicateRollup } from '../../rollup.js';
|
||||
const r = new SyndicateRollup('syndicate-compiler', { globalName: 'SyndicateCompiler' });
|
||||
export default [
|
||||
|
|
|
@ -1,24 +1,26 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import {
|
||||
isToken, isTokenType, replace, commaJoin, startPos, fixPos, joinItems,
|
||||
laxRead, itemText,
|
||||
laxRead, itemText, match,
|
||||
|
||||
Items, Pattern, Templates, Substitution, TokenType,
|
||||
SourceMap, CodeWriter, TemplateFunction, Token, SpanIndex, match, TokenBase, getRange, Pos,
|
||||
} from '../syntax/index';
|
||||
SourceMap, CodeWriter, TemplateFunction, Token, SpanIndex,
|
||||
} from '../syntax/index.js';
|
||||
import {
|
||||
SyndicateParser, SyndicateTypedParser,
|
||||
Identifier,
|
||||
TurnAction,
|
||||
FacetAction,
|
||||
Statement,
|
||||
ActivationImport,
|
||||
FacetFields,
|
||||
Binder,
|
||||
|
||||
compilePattern,
|
||||
SpawnStatement,
|
||||
FacetToStop,
|
||||
} from './grammar';
|
||||
patternText,
|
||||
instantiatePatternToPattern,
|
||||
} from './grammar.js';
|
||||
import {
|
||||
BootProc,
|
||||
} from './internals.js';
|
||||
|
||||
export function stripShebang(items: Items): Items {
|
||||
if ((items.length > 0) &&
|
||||
|
@ -29,17 +31,15 @@ export function stripShebang(items: Items): Items {
|
|||
return items;
|
||||
}
|
||||
|
||||
export type ModuleType ='es6' | 'require' | 'global' | 'none';
|
||||
|
||||
export type ErrorSink = (message: string, start: Pos | undefined, end: Pos | undefined) => void;
|
||||
export type ModuleType ='es6' | 'require' | 'global';
|
||||
|
||||
export interface CompileOptions {
|
||||
source: string,
|
||||
name?: string,
|
||||
runtime?: string,
|
||||
module?: ModuleType,
|
||||
global?: string,
|
||||
typescript?: boolean,
|
||||
emitError: ErrorSink,
|
||||
}
|
||||
|
||||
export interface CompilerOutput {
|
||||
|
@ -49,33 +49,58 @@ export interface CompilerOutput {
|
|||
sourceToTargetMap: SpanIndex<number>;
|
||||
}
|
||||
|
||||
function receiverFor(s: FacetAction): Substitution {
|
||||
return (s.implicitFacet) ? 'thisFacet.' : '.';
|
||||
}
|
||||
|
||||
export interface ActivationRecord {
|
||||
activation: ActivationImport;
|
||||
activationScriptId: Identifier;
|
||||
}
|
||||
|
||||
export class ExpansionContext {
|
||||
readonly parser: SyndicateParser;
|
||||
readonly moduleType: ModuleType;
|
||||
readonly activationRecords: Array<ActivationRecord> = [];
|
||||
hasBootProc: boolean = false;
|
||||
readonly typescript: boolean;
|
||||
readonly errorEmitter: ErrorSink;
|
||||
_collectedFields: FacetFields | null = null;
|
||||
nextIdNumber = 0;
|
||||
|
||||
constructor(moduleType: ModuleType,
|
||||
typescript: boolean,
|
||||
errorEmitter: ErrorSink)
|
||||
typescript: boolean)
|
||||
{
|
||||
this.parser = typescript ? new SyndicateTypedParser : new SyndicateParser();
|
||||
this.moduleType = moduleType;
|
||||
this.typescript = typescript;
|
||||
this.errorEmitter = errorEmitter;
|
||||
}
|
||||
|
||||
quasiRandomId(): string {
|
||||
return '__SYNDICATE__id_' + (this.nextIdNumber++);
|
||||
}
|
||||
|
||||
argDecl(t: TemplateFunction, name: Substitution, type: Substitution): Items {
|
||||
return (this.typescript) ? t`${name}: ${type}` : t`${name}`;
|
||||
get collectedFields(): FacetFields {
|
||||
// Allocates a transient array for collected fields in
|
||||
// contexts lacking a surrounding collector - that is, for errors.
|
||||
return this._collectedFields ?? [];
|
||||
}
|
||||
|
||||
emitError(m: string, loc: TokenBase) {
|
||||
this.errorEmitter(m, loc.start, loc.end);
|
||||
collectField(f: Binder) {
|
||||
this.collectedFields.push(f);
|
||||
}
|
||||
|
||||
withCollectedFields<T>(fs: FacetFields, f: () => T): T {
|
||||
const oldCollectedFields = this._collectedFields;
|
||||
try {
|
||||
this._collectedFields = fs;
|
||||
return f();
|
||||
} finally {
|
||||
this._collectedFields = oldCollectedFields;
|
||||
}
|
||||
}
|
||||
|
||||
argDecl(t: TemplateFunction, name: Substitution, type: Substitution): Substitution {
|
||||
return (this.typescript) ? t`${name}: ${type}` : name;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,6 +108,18 @@ function stringifyId(i: Identifier): Items {
|
|||
return [ { ... i, type: TokenType.STRING, text: JSON.stringify(i.text) } ];
|
||||
}
|
||||
|
||||
function facetFieldObjectType(
|
||||
t: TemplateFunction,
|
||||
fs: FacetFields,
|
||||
defaultType?: Substitution): Substitution
|
||||
{
|
||||
function formatBinder(binder: Binder) {
|
||||
const hasType = ((binder.type ?? defaultType) !== void 0);
|
||||
return t`${[binder.id]}${hasType ? ': ': ''}${binder.type ?? defaultType ?? ''}`;
|
||||
}
|
||||
return t`{${commaJoin(fs.map(formatBinder))}}`;
|
||||
}
|
||||
|
||||
function binderTypeGuard(t: TemplateFunction): (binder: Binder, index: number) => Items {
|
||||
return (binder, index) => {
|
||||
if (binder.id.text[0] === '_') {
|
||||
|
@ -103,12 +140,9 @@ function binderTypeGuard(t: TemplateFunction): (binder: Binder, index: number) =
|
|||
return t`if (typeof (${raw}) !== ${JSON.stringify(typeText)}) return;\n${bind}`;
|
||||
case 'any':
|
||||
return bind;
|
||||
default: {
|
||||
const intermediate = t`__v_${''+index}`;
|
||||
return t`const ${intermediate} = ${binder.type}.__from_preserve__(${raw});
|
||||
if (${intermediate} === void 0) return;
|
||||
const ${[binder.id]} = ${intermediate};`;
|
||||
}
|
||||
default:
|
||||
// TODO: something better than this!!
|
||||
throw new Error(`Unhandled binding type: ${JSON.stringify(typeText)}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -117,197 +151,143 @@ function binderTypeGuard(t: TemplateFunction): (binder: Binder, index: number) =
|
|||
export function expand(tree: Items, ctx: ExpansionContext): Items {
|
||||
const macro = new Templates(undefined, { extraDelimiters: ':' });
|
||||
|
||||
function terminalWrap(
|
||||
t: TemplateFunction,
|
||||
facetToStop: FacetToStop | 'none' | 'once-wrapper',
|
||||
body: Statement,
|
||||
): Statement {
|
||||
if (facetToStop === 'none') {
|
||||
return walk(body);
|
||||
function terminalWrap(t: TemplateFunction, isTerminal: boolean, body: Statement): Statement {
|
||||
if (isTerminal) {
|
||||
return t`thisFacet._stop(function (thisFacet) {${body}})`
|
||||
} else {
|
||||
const toStop =
|
||||
facetToStop === 'default' ? 'currentSyndicateFacet' :
|
||||
facetToStop === 'once-wrapper' ? '__once_facet' :
|
||||
walk(facetToStop);
|
||||
const resetCurrentSyndicateFacet =
|
||||
facetToStop === 'once-wrapper' ? [] :
|
||||
t`const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;`;
|
||||
return t`__SYNDICATE__.Turn.active._stop(${toStop}, () => {${resetCurrentSyndicateFacet}${walk(body)}})`;
|
||||
}
|
||||
}
|
||||
|
||||
function facetWrap(
|
||||
t: TemplateFunction,
|
||||
facetName: Identifier | 'default' | 'once-wrapper',
|
||||
items: Items,
|
||||
): Items {
|
||||
if (facetName === 'once-wrapper') {
|
||||
return t`__SYNDICATE__.Turn.active.facet(() => {const __once_facet = __SYNDICATE__.Turn.activeFacet; ${items}});`;
|
||||
} else {
|
||||
const defaultLabel = t`const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet; `;
|
||||
const customLabel = facetName === 'default'
|
||||
? []
|
||||
: t`const ${facetName.text} = currentSyndicateFacet; `;
|
||||
return t`__SYNDICATE__.Turn.active.facet(() => {${defaultLabel}${customLabel}${items}});`;
|
||||
return body;
|
||||
}
|
||||
}
|
||||
|
||||
function x<T>(p: Pattern<T>, f: (v: T, t: TemplateFunction) => Items) {
|
||||
tree = replace(tree, null, p, (v, start) => f(v, macro.template(fixPos(start))));
|
||||
tree = replace(tree, p, (v, start) => f(v, macro.template(fixPos(start))));
|
||||
}
|
||||
|
||||
function xf<T extends TurnAction>(p: Pattern<T>, f: (v: T, t: TemplateFunction) => Items) {
|
||||
x(p, (v, t) => t`__SYNDICATE__.Turn.active.${f(v, t)}`);
|
||||
function xf<T extends FacetAction>(p: Pattern<T>, f: (v: T, t: TemplateFunction) => Items) {
|
||||
x(p, (v, t) => t`${receiverFor(v)}${f(v, t)}`);
|
||||
}
|
||||
|
||||
const walk = (tree: Items): Items => expand(tree, ctx);
|
||||
const maybeWalk = (tree?: Items) : Items | undefined => (tree === void 0) ? tree : walk(tree);
|
||||
|
||||
// Unfortunately, because of the incredibly naive repeated
|
||||
// traversal of the syntax tree we're doing, the order of the
|
||||
// following transformations matters.
|
||||
|
||||
xf(ctx.parser.duringStatement, (s, t) => {
|
||||
let spawn = match(ctx.parser.spawn, s.body, null, null);
|
||||
if (spawn !== null) {
|
||||
if (spawn.linkedToken !== null) {
|
||||
ctx.emitError(`during ... spawn doesn't need "linked", it's always linked`,
|
||||
spawn.linkedToken);
|
||||
}
|
||||
spawn.linkedToken = getRange(s.body);
|
||||
}
|
||||
|
||||
let body = (spawn === null)
|
||||
? walk(s.body)
|
||||
: expandSpawn(spawn, t, t` __SYNDICATE__.Turn.activeFacet.preventInertCheck();`);
|
||||
|
||||
const sa = compilePattern(s.pattern);
|
||||
const assertion = t`__SYNDICATE__.Observe({
|
||||
pattern: __SYNDICATE__.QuasiValue.finish(${sa.skeleton}),
|
||||
observer: __SYNDICATE__.Turn.ref(__SYNDICATE__.assertionFacetObserver(
|
||||
(${ctx.argDecl(t, '__vs', '__SYNDICATE__.AnyValue')}) => {
|
||||
if (Array.isArray(__vs)) {
|
||||
${joinItems(sa.captureBinders.map(binderTypeGuard(t)), '\n')}
|
||||
${body}
|
||||
}
|
||||
}
|
||||
))
|
||||
})`;
|
||||
if (s.test === void 0) {
|
||||
return t`assertDataflow(() => ({ target: currentSyndicateTarget, assertion: ${assertion} }));`;
|
||||
let spawn0 = match(ctx.parser.spawn, s.body, null);
|
||||
if (spawn0 !== null) {
|
||||
const spawn = spawn0;
|
||||
const id = ctx.quasiRandomId();
|
||||
const instantiated = patternText(instantiatePatternToPattern(s.pattern));
|
||||
return t`on asserted ${patternText(s.pattern)} => {
|
||||
const ${id} = __SYNDICATE__.genUuid();
|
||||
const ${id}_inst = __SYNDICATE__.Instance(${id});
|
||||
react {
|
||||
stop on asserted ${id}_inst => react {
|
||||
stop on retracted ${id}_inst;
|
||||
stop on retracted :snapshot ${instantiated};
|
||||
}
|
||||
stop on retracted :snapshot ${instantiated} => react {
|
||||
stop on asserted ${id}_inst;
|
||||
}
|
||||
}
|
||||
spawn
|
||||
${spawn.isDataspace ? 'dataspace' : []}
|
||||
${spawn.name === void 0 ? [] : t`named ${spawn.name}`}
|
||||
:asserting ${id}_inst
|
||||
${joinItems(spawn.initialAssertions.map(e => t`:asserting ${e}`), ' ')}
|
||||
${joinItems(spawn.parentBinders.map((b, i) => {
|
||||
const init = spawn.parentInits[i];
|
||||
return t`:let ${[b.id]}${b.type === void 0 ? [] : t`: ${b.type}`} = ${init}`;
|
||||
}), ' ')}
|
||||
{
|
||||
assert ${id}_inst;
|
||||
stop on retracted __SYNDICATE__.Observe(${id}_inst);
|
||||
${spawn.body}
|
||||
}
|
||||
}`;
|
||||
} else {
|
||||
return t`assertDataflow(() => (${walk(s.test)})
|
||||
? ({ target: currentSyndicateTarget, assertion: ${assertion} })
|
||||
: ({ target: void 0, assertion: void 0 }));`;
|
||||
// TODO: untyped template
|
||||
const sa = compilePattern(s.pattern);
|
||||
return t`withSelfDo(function (thisFacet) {
|
||||
const _Facets = new __SYNDICATE__.Dictionary<any, __SYNDICATE__.Facet<any>>();
|
||||
on asserted ${patternText(s.pattern)} => react {
|
||||
_Facets.set([${commaJoin(sa.captureBinders.map(t=>[t.id]))}], thisFacet);
|
||||
dataflow { } // TODO: horrible hack to keep the facet alive if no other endpoints
|
||||
${s.body}
|
||||
}
|
||||
on retracted ${patternText(s.pattern)} => {
|
||||
const ${ctx.argDecl(t, '_Key', '__SYNDICATE__.Value<any>[]')} =
|
||||
[${commaJoin(sa.captureBinders.map(t=>[t.id]))}];
|
||||
_Facets.get(_Key)?._stop();
|
||||
_Facets.delete(_Key);
|
||||
}
|
||||
});`;
|
||||
}
|
||||
});
|
||||
|
||||
function expandSpawn(spawn: SpawnStatement, t: TemplateFunction, inject: Items = []): Items {
|
||||
xf(ctx.parser.spawn, (s, t) => {
|
||||
// TODO: parentBinders, parentInits
|
||||
/*
|
||||
let body = ctx.withCollectedFields(s.facetFields, () => walk(s.body));
|
||||
let proc = t`function (thisFacet) {${body}}`;
|
||||
if (s.isDataspace) proc = t`__SYNDICATE__.inNestedDataspace(${proc})`;
|
||||
let assertions = (s.initialAssertions.length > 0)
|
||||
? t`, new __SYNDICATE__.Set([${commaJoin(s.initialAssertions.map(walk))}])`
|
||||
: ``;
|
||||
*/
|
||||
const f = t` const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;`;
|
||||
const n = spawn.name === void 0 ? '' : t` currentSyndicateFacet.actor.name = ${walk(spawn.name)};`;
|
||||
return t`__SYNDICATE__.Dataspace._spawn${spawn.linkedToken ? 'Link': ''}(() => {${f}${n}${inject}${walk(spawn.body)}});`;
|
||||
}
|
||||
|
||||
x(ctx.parser.spawn, expandSpawn);
|
||||
|
||||
x(ctx.parser.fieldDeclarationStatement, (s, t) => {
|
||||
const ft = ctx.typescript ? t`<${s.field.type ?? '__SYNDICATE__.AnyValue'}>` : '';
|
||||
return t`const ${[s.field.id]} = __SYNDICATE__.Turn.active.field${ft}(${maybeWalk(s.init) ?? 'void 0'}, ${stringifyId(s.field.id)});`;
|
||||
let fieldTypeParam = ctx.typescript ? t`<${facetFieldObjectType(t, s.facetFields)}>` : '';
|
||||
return t`_spawn${fieldTypeParam}(${maybeWalk(s.name) ?? 'null'}, ${proc}${assertions});`;
|
||||
});
|
||||
|
||||
x(ctx.parser.atStatement, (s, t) => {
|
||||
return t`(((${ctx.argDecl(t, 'currentSyndicateTarget', '__SYNDICATE__.Ref')}) => {${walk(s.body)}})(${walk(s.target)}));`;
|
||||
});
|
||||
|
||||
x(ctx.parser.createExpression, (s, t) => {
|
||||
return t`__SYNDICATE__.Turn.ref(${walk(s.entity)})`;
|
||||
xf(ctx.parser.fieldDeclarationStatement, (s, t) => {
|
||||
ctx.collectField(s.property);
|
||||
return t`declareField(this, ${stringifyId(s.property.id)}, ${maybeWalk(s.init) ?? 'void 0'});`;
|
||||
});
|
||||
|
||||
xf(ctx.parser.assertionEndpointStatement, (s, t) => {
|
||||
if (s.isDynamic) {
|
||||
if (s.test === void 0) {
|
||||
return t`assertDataflow(() => ({ target: currentSyndicateTarget, assertion: ${walk(s.template)} }));`;
|
||||
} else {
|
||||
return t`assertDataflow(() => (${walk(s.test)})
|
||||
? ({ target: currentSyndicateTarget, assertion: ${walk(s.template)} })
|
||||
: ({ target: void 0, assertion: void 0 }));`;
|
||||
}
|
||||
if (s.test == void 0) {
|
||||
return t`addEndpoint(thisFacet => ({ assertion: ${walk(s.template)}, analysis: null }));`;
|
||||
} else {
|
||||
if (s.test === void 0) {
|
||||
return t`assert(currentSyndicateTarget, ${walk(s.template)});`;
|
||||
} else {
|
||||
return t`replace(currentSyndicateTarget, void 0, (${walk(s.test)}) ? (${walk(s.template)}) : void 0);`;
|
||||
}
|
||||
return t`addEndpoint(thisFacet => (${walk(s.test)})
|
||||
? ({ assertion: ${walk(s.template)}, analysis: null })
|
||||
: ({ assertion: void 0, analysis: null }), ${''+s.isDynamic});`;
|
||||
}
|
||||
});
|
||||
|
||||
xf(ctx.parser.dataflowStatement, (s, t) =>
|
||||
t`_dataflow(() => {${walk(s.body)}});`);
|
||||
t`addDataflow(function (thisFacet) {${walk(s.body)}});`);
|
||||
|
||||
x(ctx.parser.eventHandlerEndpointStatement, (s, t) => {
|
||||
const wrap = s.once ? (i: Items) => facetWrap(t, 'once-wrapper', i) : (i: Items) => i;
|
||||
|
||||
if (s.triggerType === 'dataflow') {
|
||||
return wrap(t`__SYNDICATE__.Turn.active._dataflow(() => { if (${walk(s.predicate)}) { ${terminalWrap(t, s.facetToStop, s.body)} } });`);
|
||||
}
|
||||
|
||||
if (s.triggerType === 'stop') {
|
||||
return t`__SYNDICATE__.Turn.activeFacet.onStop(() => {${walk(s.body)}});`;
|
||||
}
|
||||
|
||||
const sa = compilePattern(s.pattern);
|
||||
const guardBody = (body: Statement) => t`if (Array.isArray(__vs)) {
|
||||
${joinItems(sa.captureBinders.map(binderTypeGuard(t)), '\n')}
|
||||
${body}
|
||||
}`;
|
||||
|
||||
let entity: Items;
|
||||
xf(ctx.parser.eventHandlerEndpointStatement, (s, t) => {
|
||||
switch (s.triggerType) {
|
||||
case 'asserted':
|
||||
entity = t`{
|
||||
assert: (${ctx.argDecl(t, '__vs', '__SYNDICATE__.AnyValue')}, ${ctx.argDecl(t, '__handle', '__SYNDICATE__.Handle')}) => {
|
||||
${guardBody(terminalWrap(t, s.facetToStop, s.body))}
|
||||
}
|
||||
}`;
|
||||
break;
|
||||
case 'retracted':
|
||||
entity = t`__SYNDICATE__.assertionObserver((${ctx.argDecl(t, '__vs', '__SYNDICATE__.AnyValue')}) => {
|
||||
${guardBody(t`return () => { ${terminalWrap(t, s.facetToStop, s.body)} };`)}
|
||||
})`;
|
||||
break;
|
||||
case 'message':
|
||||
entity = t`{
|
||||
message: (${ctx.argDecl(t, '__vs', '__SYNDICATE__.AnyValue')}) => {
|
||||
${guardBody(terminalWrap(t, s.facetToStop, s.body))}
|
||||
}
|
||||
}`;
|
||||
break;
|
||||
}
|
||||
case 'dataflow':
|
||||
return t`withSelfDo(function (thisFacet) { dataflow { if (${walk(s.predicate)}) { ${terminalWrap(t, s.terminal, walk(s.body))} } } });`;
|
||||
|
||||
const assertion = t`__SYNDICATE__.Observe({
|
||||
pattern: __SYNDICATE__.QuasiValue.finish(${sa.skeleton}),
|
||||
observer: __SYNDICATE__.Turn.ref(${entity}),
|
||||
})`;
|
||||
|
||||
if (s.isDynamic) {
|
||||
if (s.test === void 0) {
|
||||
return wrap(t`__SYNDICATE__.Turn.active.assertDataflow(() => ({ target: currentSyndicateTarget, assertion: ${assertion} }));`);
|
||||
} else {
|
||||
return wrap(t`__SYNDICATE__.Turn.active.assertDataflow(() => (${walk(s.test)})
|
||||
? ({ target: currentSyndicateTarget, assertion: ${assertion} })
|
||||
: ({ target: void 0, assertion: void 0 }));`);
|
||||
case 'start':
|
||||
case 'stop': {
|
||||
const m = s.triggerType === 'start' ? 'addStartScript' : 'addStopScript';
|
||||
return t`${m}(function (thisFacet) {${walk(s.body)}});`;
|
||||
}
|
||||
} else {
|
||||
if (s.test === void 0) {
|
||||
return wrap(t`__SYNDICATE__.Turn.active.replace(currentSyndicateTarget, void 0, ${assertion});`);
|
||||
} else {
|
||||
return wrap(t`__SYNDICATE__.Turn.active.replace(currentSyndicateTarget, void 0, (${walk(s.test)}) ? ${assertion} : void 0);`);
|
||||
|
||||
case 'asserted':
|
||||
case 'retracted':
|
||||
case 'message': {
|
||||
const sa = compilePattern(s.pattern);
|
||||
const expectedEvt = ({
|
||||
'asserted': 'ADDED',
|
||||
'retracted': 'REMOVED',
|
||||
'message': 'MESSAGE',
|
||||
})[s.triggerType];
|
||||
return t`addEndpoint(thisFacet => ({
|
||||
assertion: __SYNDICATE__.Observe(${walk(sa.assertion)}),
|
||||
analysis: {
|
||||
skeleton: ${walk(sa.skeleton)},
|
||||
constPaths: ${JSON.stringify(sa.constPaths)},
|
||||
constVals: [${commaJoin(sa.constVals.map(walk))}],
|
||||
capturePaths: ${JSON.stringify(sa.capturePaths)},
|
||||
callback: thisFacet.wrap((thisFacet, __Evt, ${ctx.argDecl(t, '__vs', 'Array<__SYNDICATE__.Value<any>>')}) => {
|
||||
if (__Evt === __SYNDICATE__.Skeleton.EventType.${expectedEvt}) {
|
||||
${joinItems(sa.captureBinders.map(binderTypeGuard(t)), '\n')}
|
||||
thisFacet.scheduleScript(() => {${terminalWrap(t, s.terminal, walk(s.body))}});
|
||||
}
|
||||
})
|
||||
}
|
||||
}), ${'' + s.isDynamic});`;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -315,18 +295,51 @@ ${joinItems(sa.captureBinders.map(binderTypeGuard(t)), '\n')}
|
|||
x(ctx.parser.typeDefinitionStatement, (s, t) => {
|
||||
const l = `Symbol.for(${JSON.stringify(s.label.text)})`;
|
||||
const fns = JSON.stringify(s.fields.map(f => f.id.text));
|
||||
const formatBinder = (b: Binder) => t`${[b.id]}: ${b.type ?? '__SYNDICATE__.AnyValue'}`;
|
||||
const fs = ctx.typescript
|
||||
? t`<{${commaJoin(s.fields.map(formatBinder))}}, __SYNDICATE__.Ref>`
|
||||
? t`<${facetFieldObjectType(t, s.fields, t`__SYNDICATE__.Value<any>`)}, any>`
|
||||
: '';
|
||||
return t`const ${[s.label]} = __SYNDICATE__.Record.makeConstructor${fs}()(${maybeWalk(s.wireName) ?? l}, ${fns});`;
|
||||
});
|
||||
|
||||
xf(ctx.parser.messageSendStatement, (s, t) => t`message(currentSyndicateTarget, ${walk(s.expr)});`);
|
||||
xf(ctx.parser.messageSendStatement, (s, t) => t`_send(${walk(s.expr)});`);
|
||||
|
||||
x(ctx.parser.reactStatement, (s, t) => facetWrap(t, s.label ?? 'default', s.body));
|
||||
xf(ctx.parser.reactStatement, (s, t) => {
|
||||
const body = ctx.withCollectedFields(s.facetFields, () => walk(s.body));
|
||||
const fieldTypeParam = ctx.typescript
|
||||
? t`<${facetFieldObjectType(t, s.facetFields)}>`
|
||||
: '';
|
||||
return t`addChildFacet${fieldTypeParam}(function (thisFacet) {${body}});`;
|
||||
});
|
||||
|
||||
x(ctx.parser.stopStatement, (s, t) => t`${terminalWrap(t, s.facetToStop, s.body)};`);
|
||||
x(ctx.parser.activationImport, (s) => {
|
||||
const activationScriptId: Token = {
|
||||
start: s.activationKeyword.start,
|
||||
end: s.activationKeyword.end,
|
||||
text: `__SYNDICATE__activationScript${'' + ctx.activationRecords.length}`,
|
||||
type: TokenType.ATOM
|
||||
};
|
||||
ctx.activationRecords.push({ activation: s, activationScriptId });
|
||||
return [];
|
||||
}),
|
||||
|
||||
x(ctx.parser.bootStatement, (s, t) => {
|
||||
ctx.hasBootProc = true;
|
||||
const activationStatements = ctx.activationRecords.map(({ activationScriptId: id }) =>
|
||||
t`thisFacet.activate(${[id]}); `);
|
||||
const body = t`${joinItems(activationStatements)}${walk(s)}`;
|
||||
const facetDecl = ctx.typescript ? 'thisFacet: __SYNDICATE__.Facet<{}>' : 'thisFacet';
|
||||
switch (ctx.moduleType) {
|
||||
case 'es6':
|
||||
return t`export function ${BootProc}(${facetDecl}) {${body}}`;
|
||||
case 'require':
|
||||
return t`module.exports.${BootProc} = function (${facetDecl}) {${body}};`;
|
||||
case 'global':
|
||||
return t`function ${BootProc}(${facetDecl}) {${body}}`;
|
||||
}
|
||||
});
|
||||
|
||||
xf(ctx.parser.stopStatement, (s, t) =>
|
||||
t`_stop(function (thisFacet) {${walk(s.body)}});`)
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
@ -342,16 +355,42 @@ export function compile(options: CompileOptions): CompilerOutput {
|
|||
|
||||
const start = startPos(inputFilename);
|
||||
let tree = stripShebang(laxRead(source, { start, extraDelimiters: ':' }));
|
||||
// const end = tree.length > 0 ? tree[tree.length - 1].end : start;
|
||||
const end = tree.length > 0 ? tree[tree.length - 1].end : start;
|
||||
|
||||
const macro = new Templates(undefined, { extraDelimiters: ':' });
|
||||
|
||||
const ctx = new ExpansionContext(moduleType, typescript, options.emitError);
|
||||
const ctx = new ExpansionContext(moduleType, typescript);
|
||||
|
||||
tree = expand(tree, ctx);
|
||||
|
||||
const ts = macro.template(fixPos(start));
|
||||
// const te = macro.template(fixPos(end));
|
||||
const te = macro.template(fixPos(end));
|
||||
|
||||
if (ctx.hasBootProc) {
|
||||
let bp;
|
||||
switch (moduleType) {
|
||||
case 'es6':
|
||||
case 'global':
|
||||
bp = BootProc;
|
||||
break;
|
||||
case 'require':
|
||||
bp = te`module.exports.${BootProc}`;
|
||||
break;
|
||||
}
|
||||
tree = te`${tree}\nif (typeof module !== 'undefined' && ((typeof require === 'undefined' ? {main: void 0} : require).main === module)) __SYNDICATE__.bootModule(${bp});`;
|
||||
}
|
||||
|
||||
const activationImports = ctx.activationRecords.map(r => {
|
||||
const a = r.activation;
|
||||
const t = macro.template(a.activationKeyword.start);
|
||||
switch (a.target.type) {
|
||||
case 'import':
|
||||
return t`import { ${BootProc} as ${[r.activationScriptId]} } from ${[a.target.moduleName]};\n`;
|
||||
case 'expr':
|
||||
return t`const ${[r.activationScriptId]} = (${a.target.moduleExpr}).${BootProc};\n`;
|
||||
}
|
||||
});
|
||||
tree = ts`${joinItems(activationImports)}${tree}`;
|
||||
|
||||
{
|
||||
const runtime = options.runtime ?? '@syndicate-lang/core';
|
||||
|
@ -365,18 +404,13 @@ export function compile(options: CompileOptions): CompilerOutput {
|
|||
case 'global':
|
||||
tree = ts`const __SYNDICATE__ = ${runtime};\n${tree}`;
|
||||
break;
|
||||
case 'none':
|
||||
break;
|
||||
default:
|
||||
((_: never) => {
|
||||
throw new Error(`Unsupported ModuleType: ${moduleType}`);
|
||||
})(moduleType);
|
||||
}
|
||||
}
|
||||
|
||||
const cw = new CodeWriter(inputFilename);
|
||||
cw.emit(tree);
|
||||
|
||||
|
||||
const text = cw.text;
|
||||
|
||||
return {
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import {
|
||||
Token, Items, TokenBase, TokenType, Pos,
|
||||
TokenType, Token, Items,
|
||||
Pattern,
|
||||
foldItems, match, anonymousTemplate as template, commaJoin,
|
||||
advancePos,
|
||||
startPos,
|
||||
|
||||
scope, bind, seq, seqTuple, alt, upTo, atom, atomString, group,
|
||||
scope, bind, seq, alt, upTo, atom, atomString, group, exec,
|
||||
repeat, option, withoutSpace, map, mapm, rest, discard,
|
||||
value, succeed, fail, separatedOrTerminatedBy, not,
|
||||
} from '../syntax/index';
|
||||
import * as Matcher from '../syntax/matcher';
|
||||
value, succeed, fail, separatedBy, anything, not, follows,
|
||||
} from '../syntax/index.js';
|
||||
import * as Matcher from '../syntax/matcher.js';
|
||||
import { Path, Skeleton } from './internals.js';
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// AST types
|
||||
|
@ -22,44 +20,42 @@ export type Identifier = Token;
|
|||
export type Type = Items;
|
||||
export type Binder = { id: Identifier, type?: Type };
|
||||
|
||||
export interface TurnAction {
|
||||
export interface FacetAction {
|
||||
implicitFacet: boolean;
|
||||
}
|
||||
|
||||
export interface FacetSetupAction extends TurnAction {
|
||||
export type FacetFields = Binder[];
|
||||
|
||||
export interface FacetProducingAction extends FacetAction {
|
||||
body: Statement;
|
||||
facetFields: FacetFields;
|
||||
}
|
||||
|
||||
export interface SpawnStatement extends FacetSetupAction {
|
||||
export interface SpawnStatement extends FacetProducingAction {
|
||||
isDataspace: boolean;
|
||||
name?: Expr;
|
||||
linkedToken: TokenBase | null;
|
||||
initialAssertions: Expr[];
|
||||
parentBinders: Binder[];
|
||||
parentInits: Expr[];
|
||||
}
|
||||
|
||||
export interface FieldDeclarationStatement extends TurnAction {
|
||||
field: Binder;
|
||||
export interface FieldDeclarationStatement extends FacetAction {
|
||||
property: Binder;
|
||||
init?: Expr;
|
||||
}
|
||||
|
||||
export interface AssertionEndpointStatement extends TurnAction {
|
||||
export interface AssertionEndpointStatement extends FacetAction {
|
||||
isDynamic: boolean,
|
||||
template: Expr,
|
||||
test?: Expr,
|
||||
}
|
||||
|
||||
export interface StatementTurnAction extends TurnAction {
|
||||
export interface StatementFacetAction extends FacetAction {
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export type FacetToStop = 'default' | Expr;
|
||||
|
||||
export interface StopStatement extends StatementTurnAction {
|
||||
facetToStop: FacetToStop;
|
||||
}
|
||||
|
||||
export interface GenericEventEndpointStatement extends StatementTurnAction {
|
||||
facetToStop: FacetToStop | 'none' | 'once-wrapper';
|
||||
once: boolean;
|
||||
export interface GenericEventEndpointStatement extends StatementFacetAction {
|
||||
terminal: boolean;
|
||||
isDynamic: boolean;
|
||||
}
|
||||
|
||||
|
@ -69,13 +65,12 @@ export interface DataflowEndpointStatement extends GenericEventEndpointStatement
|
|||
}
|
||||
|
||||
export interface PseudoEventEndpointStatement extends GenericEventEndpointStatement {
|
||||
triggerType: 'stop';
|
||||
triggerType: 'start' | 'stop';
|
||||
}
|
||||
|
||||
export interface AssertionEventEndpointStatement extends GenericEventEndpointStatement {
|
||||
triggerType: 'asserted' | 'retracted' | 'message';
|
||||
pattern: ValuePattern;
|
||||
test?: Expr,
|
||||
}
|
||||
|
||||
export type EventHandlerEndpointStatement =
|
||||
|
@ -88,26 +83,20 @@ export interface TypeDefinitionStatement {
|
|||
wireName?: Expr;
|
||||
}
|
||||
|
||||
export interface MessageSendStatement extends TurnAction {
|
||||
export interface MessageSendStatement extends FacetAction {
|
||||
expr: Expr;
|
||||
}
|
||||
|
||||
export interface DuringStatement extends FacetSetupAction {
|
||||
export interface DuringStatement extends FacetProducingAction {
|
||||
pattern: ValuePattern;
|
||||
test?: Expr,
|
||||
}
|
||||
|
||||
export interface ReactStatement extends FacetSetupAction {
|
||||
label: Identifier | null;
|
||||
export interface ReactStatement extends FacetProducingAction {
|
||||
}
|
||||
|
||||
export interface AtStatement {
|
||||
target: Expr;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface CreateExpression {
|
||||
entity: Expr;
|
||||
export interface ActivationImport {
|
||||
activationKeyword: Identifier;
|
||||
target: { type: 'import', moduleName: Token } | { type: 'expr', moduleExpr: Expr };
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -123,52 +112,37 @@ export interface PDiscard {
|
|||
type: 'PDiscard',
|
||||
}
|
||||
|
||||
export interface PConstant {
|
||||
type: 'PConstant',
|
||||
value: Expr,
|
||||
}
|
||||
|
||||
export interface PConstructor {
|
||||
type: 'PConstructor',
|
||||
ctor: Expr,
|
||||
arguments: ValuePattern[],
|
||||
}
|
||||
|
||||
export interface PConstant {
|
||||
type: 'PConstant',
|
||||
value: Expr,
|
||||
}
|
||||
|
||||
export interface PArray {
|
||||
type: 'PArray',
|
||||
elements: ValuePattern[],
|
||||
}
|
||||
|
||||
export interface PDict {
|
||||
type: 'PDict',
|
||||
elements: [Expr, ValuePattern][],
|
||||
export type ValuePattern = PCapture | PDiscard | PConstructor | PConstant | PArray;
|
||||
|
||||
interface RawCall {
|
||||
items: Items;
|
||||
callee: Expr;
|
||||
arguments: Expr[];
|
||||
}
|
||||
|
||||
export interface PUnquote {
|
||||
type: 'PUnquote',
|
||||
unquoted: ValuePattern,
|
||||
}
|
||||
|
||||
export interface POuterUnquote {
|
||||
type: 'POuterUnquote',
|
||||
outer: Expr,
|
||||
};
|
||||
|
||||
export interface PQuote {
|
||||
type: 'PQuote',
|
||||
quoted: ValuePattern,
|
||||
}
|
||||
|
||||
export type ValuePattern =
|
||||
| PCapture | PDiscard
|
||||
| PConstant
|
||||
| PConstructor | PArray | PDict
|
||||
| PUnquote | POuterUnquote | PQuote
|
||||
;
|
||||
|
||||
export interface StaticAnalysis {
|
||||
skeleton: Expr; // constructs a P.Pattern
|
||||
skeleton: Expr;
|
||||
constPaths: Path[];
|
||||
constVals: Expr[];
|
||||
capturePaths: Path[];
|
||||
captureBinders: Binder[];
|
||||
assertion: Expr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -183,37 +157,16 @@ export class SyndicateParser {
|
|||
return group('{', map(rest, items => (acc?.push(... items), items)));
|
||||
}
|
||||
|
||||
readonly statementBoundary = alt<any>(
|
||||
atom(';'),
|
||||
Matcher.newline,
|
||||
seq(Matcher.end, i => {
|
||||
if (i.context === null || i.context === '{') return discard(i);
|
||||
// ^ toplevel, or inside braces, so presumably statement context
|
||||
return fail(i); // otherwise, parens or brackets presumably, so not statement context
|
||||
}),
|
||||
);
|
||||
readonly statementBoundary = alt<any>(atom(';'), Matcher.newline);
|
||||
readonly exprBoundary = alt<any>(atom(';'), atom(','), group('{', discard), Matcher.end);
|
||||
|
||||
readonly identifier: Pattern<Identifier> = atom();
|
||||
binder(... _extraStops: Pattern<any>[]): Pattern<Binder> { return scope(o => bind(o, 'id', this.identifier)); }
|
||||
readonly defaultBinder = this.binder();
|
||||
get binder(): Pattern<Binder> { return scope(o => bind(o, 'id', this.identifier)); }
|
||||
|
||||
expr(... extraStops: Pattern<any>[]): Pattern<Expr> {
|
||||
return withoutSpace(upTo(alt(this.exprBoundary, ... extraStops)));
|
||||
}
|
||||
|
||||
expr1(... extraStops: Pattern<any>[]): Pattern<Expr> {
|
||||
return mapm(this.expr(... extraStops), e => e.length ? succeed(e) : fail);
|
||||
}
|
||||
|
||||
propertyNameExpr(): Pattern<Expr> {
|
||||
const dq = template`"`;
|
||||
return alt<Expr>(
|
||||
map(atom(), name => [... dq, name, ... dq]),
|
||||
map(atom(void 0, { tokenType: TokenType.STRING }), str => [str]),
|
||||
group('[', this.expr()));
|
||||
}
|
||||
|
||||
readonly type: (... extraStops: Pattern<any>[]) => Pattern<Type> = this.expr;
|
||||
|
||||
statement(acc: Items): Pattern<any> {
|
||||
|
@ -224,10 +177,11 @@ export class SyndicateParser {
|
|||
i => i ? acc.push(i) : void 0))));
|
||||
}
|
||||
|
||||
turnAction<T extends TurnAction>(pattern: (scope: T) => Pattern<any>): Pattern<T> {
|
||||
facetAction<T extends FacetAction>(pattern: (scope: T) => Pattern<any>): Pattern<T> {
|
||||
return i => {
|
||||
const scope = Object.create(null);
|
||||
const p = pattern(scope);
|
||||
scope.implicitFacet = true;
|
||||
const p = seq(option(map(atom('.'), _ => scope.implicitFacet = false)), pattern(scope));
|
||||
const r = p(i);
|
||||
if (r === null) return null;
|
||||
return [scope, r[1]];
|
||||
|
@ -236,43 +190,45 @@ export class SyndicateParser {
|
|||
|
||||
readonly headerExpr = this.expr(kw('asserting'), kw('let'));
|
||||
|
||||
// Principal: Turn
|
||||
// Principal: Facet
|
||||
readonly spawn: Pattern<SpawnStatement> =
|
||||
this.turnAction(o => {
|
||||
o.linkedToken = null;
|
||||
this.facetAction(o => {
|
||||
o.isDataspace = false;
|
||||
o.initialAssertions = [];
|
||||
o.parentBinders = [];
|
||||
o.parentInits = [];
|
||||
o.body = [];
|
||||
o.facetFields = [];
|
||||
return seq(atom('spawn'),
|
||||
option(map(atom('linked'), tok => o.linkedToken = tok)),
|
||||
option(seq(atom('named'), bind(o, 'name', this.headerExpr))),
|
||||
repeat(alt(
|
||||
/* seq(kw('asserting'), map(this.headerExpr, e => o.initialAssertions.push(e))), */
|
||||
map(scope(
|
||||
(l: { b: Binder, init: Expr }) =>
|
||||
seq(kw('let'),
|
||||
bind(l, 'b', this.defaultBinder),
|
||||
atom('='),
|
||||
bind(l, 'init', this.headerExpr))),
|
||||
l => {
|
||||
o.parentBinders.push(l.b);
|
||||
o.parentInits.push(l.init);
|
||||
}))),
|
||||
option(seq(atom('dataspace'), exec(() => o.isDataspace = true))),
|
||||
option(seq(atom('named'),
|
||||
bind(o, 'name', this.headerExpr))),
|
||||
repeat(alt(seq(kw('asserting'),
|
||||
map(this.headerExpr, e => o.initialAssertions.push(e))),
|
||||
map(scope((l: { b: Binder, init: Expr }) =>
|
||||
seq(kw('let'),
|
||||
bind(l, 'b', this.binder),
|
||||
atom('='),
|
||||
bind(l, 'init', this.headerExpr))),
|
||||
l => {
|
||||
o.parentBinders.push(l.b);
|
||||
o.parentInits.push(l.init);
|
||||
}))),
|
||||
this.block(o.body));
|
||||
});
|
||||
|
||||
// Principal: Turn
|
||||
// Principal: Dataspace, but only for implementation reasons, so really Facet
|
||||
readonly fieldDeclarationStatement: Pattern<FieldDeclarationStatement> =
|
||||
this.turnAction(o => {
|
||||
this.facetAction(o => {
|
||||
return seq(atom('field'),
|
||||
bind(o, 'field', this.defaultBinder),
|
||||
bind(o, 'property', this.binder),
|
||||
option(seq(atom('='), bind(o, 'init', this.expr()))),
|
||||
this.statementBoundary);
|
||||
});
|
||||
|
||||
// Principal: Turn
|
||||
// Principal: Facet
|
||||
readonly assertionEndpointStatement: Pattern<AssertionEndpointStatement> =
|
||||
this.turnAction(o => {
|
||||
this.facetAction(o => {
|
||||
o.isDynamic = true;
|
||||
return seq(atom('assert'),
|
||||
option(map(kw('snapshot'), _ => o.isDynamic = false)),
|
||||
|
@ -281,56 +237,45 @@ export class SyndicateParser {
|
|||
this.statementBoundary);
|
||||
});
|
||||
|
||||
blockTurnAction(kw: Pattern<any>): Pattern<StatementTurnAction> {
|
||||
return this.turnAction(o => {
|
||||
blockFacetAction(kw: Pattern<any>): Pattern<StatementFacetAction> {
|
||||
return this.facetAction(o => {
|
||||
o.body = [];
|
||||
return seq(kw, this.block(o.body));
|
||||
});
|
||||
}
|
||||
|
||||
// Principal: Turn
|
||||
readonly dataflowStatement = this.blockTurnAction(atom('dataflow'));
|
||||
// Principal: Facet
|
||||
readonly dataflowStatement = this.blockFacetAction(atom('dataflow'));
|
||||
|
||||
mandatoryIfNotTerminal(o: GenericEventEndpointStatement, p: Pattern<any>): Pattern<any> {
|
||||
return i => {
|
||||
return (o.facetToStop !== 'none') ? option(p)(i) : p(i);
|
||||
return (o.terminal) ? option(p)(i) : p(i);
|
||||
};
|
||||
}
|
||||
|
||||
// Principal: Turn
|
||||
// Principal: Facet
|
||||
readonly eventHandlerEndpointStatement: Pattern<EventHandlerEndpointStatement> =
|
||||
this.turnAction(o => {
|
||||
o.facetToStop = 'none';
|
||||
o.once = false;
|
||||
this.facetAction(o => {
|
||||
o.terminal = false;
|
||||
o.isDynamic = true;
|
||||
o.body = [];
|
||||
return seq(alt(seq(option(seq(atom('stop'),
|
||||
map(option(this.expr1(atom('on'))), es => {
|
||||
o.facetToStop = es.length ? es[0] : 'default';
|
||||
}))),
|
||||
atom('on')),
|
||||
map(atom('once'), _ => {
|
||||
o.once = true;
|
||||
o.facetToStop = 'once-wrapper';
|
||||
})),
|
||||
return seq(option(map(atom('stop'), _ => o.terminal = true)),
|
||||
atom('on'),
|
||||
alt<any>(seq(map(group('(', bind(o as DataflowEndpointStatement, 'predicate',
|
||||
this.expr())),
|
||||
_ => o.triggerType = 'dataflow'),
|
||||
this.mandatoryIfNotTerminal(o, this.statement(o.body))),
|
||||
mapm(seq(bind(o, 'triggerType', atomString('stop')),
|
||||
mapm(seq(bind(o, 'triggerType',
|
||||
alt(atomString('start'), atomString('stop'))),
|
||||
option(this.statement(o.body))),
|
||||
v => ((o.facetToStop !== 'none') || o.once) ? fail : succeed(v)),
|
||||
v => o.terminal ? fail : succeed(v)),
|
||||
seq(bind(o, 'triggerType',
|
||||
alt(atomString('asserted'),
|
||||
atomString('retracted'),
|
||||
atomString('message'))),
|
||||
option(map(kw('snapshot'), _ => o.isDynamic = false)),
|
||||
bind(o as AssertionEventEndpointStatement, 'pattern',
|
||||
this.valuePattern(1, atom('=>'),
|
||||
seq(atom('when'), group('(', discard)))),
|
||||
option(seq(atom('when'), group(
|
||||
'(', bind(o as AssertionEventEndpointStatement, 'test',
|
||||
this.expr())))),
|
||||
this.valuePattern(atom('=>'))),
|
||||
this.mandatoryIfNotTerminal(
|
||||
o, seq(atom('=>'), this.statement(o.body))))));
|
||||
});
|
||||
|
@ -340,259 +285,283 @@ export class SyndicateParser {
|
|||
scope(o => seq(bind(o, 'expectedUse', alt(atomString('message'), atomString('assertion'))),
|
||||
atom('type'),
|
||||
bind(o, 'label', this.identifier),
|
||||
group('(', bind(o, 'fields', repeat(this.defaultBinder, { separator: atom(',') }))),
|
||||
group('(', bind(o, 'fields',
|
||||
repeat(this.binder, { separator: atom(',') }))),
|
||||
option(seq(atom('='),
|
||||
bind(o, 'wireName', withoutSpace(upTo(this.statementBoundary))))),
|
||||
this.statementBoundary));
|
||||
|
||||
// Principal: Turn
|
||||
// Principal: Facet
|
||||
readonly messageSendStatement: Pattern<MessageSendStatement> =
|
||||
this.turnAction(o => seq(atom('send'),
|
||||
this.facetAction(o => seq(atom('send'),
|
||||
atom('message'),
|
||||
not(this.statementBoundary),
|
||||
bind(o, 'expr', withoutSpace(upTo(this.statementBoundary))),
|
||||
this.statementBoundary));
|
||||
|
||||
// Principal: Turn
|
||||
// Principal: Facet
|
||||
readonly duringStatement: Pattern<DuringStatement> =
|
||||
this.turnAction(o => {
|
||||
this.facetAction(o => {
|
||||
o.body = [];
|
||||
o.facetFields = [];
|
||||
return seq(atom('during'),
|
||||
bind(o, 'pattern',
|
||||
this.valuePattern(1, atom('=>'), seq(atom('when'), group('(', discard)))),
|
||||
option(seq(atom('when'), group('(', bind(o, 'test', this.expr())))),
|
||||
bind(o, 'pattern', this.valuePattern(atom('=>'))),
|
||||
seq(atom('=>'), this.statement(o.body)));
|
||||
});
|
||||
|
||||
// Principal: Turn
|
||||
// Principal: Facet
|
||||
readonly reactStatement: Pattern<ReactStatement> =
|
||||
this.turnAction(o => {
|
||||
o.label = null;
|
||||
this.facetAction(o => {
|
||||
o.body = [];
|
||||
return seq(option(map(seqTuple(this.identifier, atom(':')),
|
||||
([i, _colon]) => o.label = i)),
|
||||
atom('react'),
|
||||
this.block(o.body));
|
||||
});
|
||||
|
||||
// Principal: Turn
|
||||
readonly stopStatement: Pattern<StopStatement> =
|
||||
this.turnAction(o => {
|
||||
o.facetToStop = 'default';
|
||||
o.body = [];
|
||||
return seq(atom('stop'),
|
||||
option(map(this.expr1(), e => o.facetToStop = e)),
|
||||
alt(this.block(o.body), this.statementBoundary));
|
||||
o.facetFields = [];
|
||||
return seq(atom('react'), this.block(o.body));
|
||||
});
|
||||
|
||||
// Principal: none
|
||||
readonly atStatement: Pattern<AtStatement> =
|
||||
scope(o => {
|
||||
o.body = [];
|
||||
return seq(atom('at'),
|
||||
bind(o, 'target', this.expr()),
|
||||
this.block(o.body));
|
||||
readonly bootStatement: Pattern<Statement> =
|
||||
value(o => {
|
||||
o.value = [];
|
||||
return seq(atom('boot'), this.block(o.value));
|
||||
});
|
||||
|
||||
// Principal: Facet
|
||||
readonly stopStatement = this.blockFacetAction(atom('stop'));
|
||||
|
||||
// Principal: none
|
||||
readonly createExpression: Pattern<CreateExpression> =
|
||||
scope(o => seq(atom('create'), bind(o, 'entity', this.expr())));
|
||||
readonly activationImport: Pattern<ActivationImport> =
|
||||
scope(o => seq(bind(o, 'activationKeyword', atom('activate')),
|
||||
follows(alt<any>(seq(atom('import'),
|
||||
upTo(seq(
|
||||
map(atom(void 0, { tokenType: TokenType.STRING }),
|
||||
n => o.target = {
|
||||
type: 'import',
|
||||
moduleName: n
|
||||
}),
|
||||
this.statementBoundary))),
|
||||
map(this.expr(), e => o.target = {
|
||||
type: 'expr',
|
||||
moduleExpr: e
|
||||
})))));
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Syntax of patterns over Value, used in endpoints
|
||||
|
||||
readonly pCaptureBinder: Pattern<Binder> =
|
||||
mapm(this.binder, i => {
|
||||
return i.id.text.startsWith('$')
|
||||
? succeed({ id: { ... i.id, text: i.id.text.slice(1) }, type: i.type })
|
||||
: fail;
|
||||
});
|
||||
|
||||
readonly pDiscard: Pattern<void> =
|
||||
mapm(this.identifier, i => i.text === '_' ? succeed(void 0) : fail);
|
||||
|
||||
hasCapturesOrDiscards(e: Expr): boolean {
|
||||
return foldItems(e,
|
||||
t => match(alt<any>(this.pCaptureBinder, this.pDiscard), [t], null) !== null,
|
||||
(_g, b, _k) => b,
|
||||
bs => bs.some(b => b));
|
||||
}
|
||||
|
||||
// $id - capture of discard
|
||||
// _ - discard
|
||||
//
|
||||
// expr(pat, ...) - record ctor
|
||||
// $id(pat) - nested capture
|
||||
// [pat, ...] - array pat
|
||||
// {expr: pat, ...} - dict pat
|
||||
//
|
||||
// expr(expr, ...) - constant
|
||||
// [expr, ...] - constant
|
||||
// {expr: expr, ...} - constant
|
||||
// other - constant
|
||||
|
||||
pCaptureBinder = (b: Pattern<Binder>): Pattern<Binder> =>
|
||||
mapm(b, i => {
|
||||
if (i.id.text.startsWith('$')) {
|
||||
const adjustedStart: Pos = { ... i.id.start };
|
||||
advancePos(adjustedStart, ' ');
|
||||
const adjustedId: Token = {
|
||||
... i.id,
|
||||
start: adjustedStart,
|
||||
text: i.id.text.slice(1),
|
||||
};
|
||||
return succeed({ id: adjustedId, type: i.type });
|
||||
} else {
|
||||
return fail;
|
||||
}
|
||||
});
|
||||
readonly pCaptureDefaultBinder = this.pCaptureBinder(this.defaultBinder);
|
||||
|
||||
readonly pDiscard: Pattern<void> =
|
||||
mapm(this.identifier, i => i.text === '_' ? succeed(void 0) : fail);
|
||||
|
||||
pUnquote(level: number, extraStops: Pattern<any>[]): Pattern<PUnquote | POuterUnquote> {
|
||||
if (level == 1) {
|
||||
return scope<POuterUnquote>(o => {
|
||||
o.type = 'POuterUnquote';
|
||||
return seq(atom('\\'), bind(o, 'outer', this.expr(... extraStops)));
|
||||
});
|
||||
} else {
|
||||
return scope<PUnquote>(o => {
|
||||
o.type = 'PUnquote';
|
||||
return seq(atom('\\'), bind(o, 'unquoted', this.valuePattern(level - 1, ... extraStops)));
|
||||
});
|
||||
}
|
||||
pRawCall(... extraStops: Pattern<any>[]): Pattern<RawCall> {
|
||||
return scope((o: RawCall) =>
|
||||
seq(bind(o, 'callee',
|
||||
this.expr(seq(group('(', discard),
|
||||
alt(this.exprBoundary, ... extraStops)))),
|
||||
seq(map(anything({ advance: false }),
|
||||
g => o.items = [... o.callee, g]),
|
||||
group('(', bind(o, 'arguments',
|
||||
separatedBy(this.expr(), atom(',')))))));
|
||||
}
|
||||
|
||||
pQuote(level: number, extraStops: Pattern<any>[]): Pattern<PQuote> {
|
||||
return scope(o => {
|
||||
o.type = 'PQuote';
|
||||
return seq(kw('pattern'), bind(o, 'quoted', this.valuePattern(level + 1, ... extraStops)));
|
||||
});
|
||||
isConstant(o: RawCall): boolean {
|
||||
return (!(this.hasCapturesOrDiscards(o.callee) ||
|
||||
o.arguments.some(a => this.hasCapturesOrDiscards(a))));
|
||||
}
|
||||
|
||||
hasCapturesOrDiscards(e: Expr): boolean {
|
||||
return foldItems(e,
|
||||
t => match(alt<any>(this.pCaptureDefaultBinder, this.pDiscard), [t], null, '(') !== null,
|
||||
(_g, b, _k) => b,
|
||||
bs => bs.some(b => b));
|
||||
}
|
||||
|
||||
pArray(level: number): Pattern<PArray> {
|
||||
return scope(o => {
|
||||
o.type = 'PArray';
|
||||
return group(
|
||||
'[', mapm(bind(o, 'elements',
|
||||
separatedOrTerminatedBy(this.valuePattern(level), atom(','))),
|
||||
v => (o.elements.every(p => p.type === 'PConstant') ? fail : succeed(v))));
|
||||
});
|
||||
}
|
||||
|
||||
pDict(level: number): Pattern<PDict> {
|
||||
return scope(o => {
|
||||
o.type = 'PDict';
|
||||
return group(
|
||||
'{', mapm(bind(o,
|
||||
'elements',
|
||||
separatedOrTerminatedBy(
|
||||
value<[Expr, ValuePattern]>(e => {
|
||||
e.value = [] as any;
|
||||
return seq(
|
||||
bind(e.value, '0', this.propertyNameExpr()),
|
||||
atom(':'),
|
||||
bind(e.value, '1', this.valuePattern(level)));
|
||||
}),
|
||||
atom(','))),
|
||||
v => (o.elements.every(e => e[1].type === 'PConstant') ? fail : succeed(v))));
|
||||
});
|
||||
}
|
||||
|
||||
pConstructor(level: number, extraStops: Pattern<any>[]): Pattern<PConstructor> {
|
||||
return scope(o => {
|
||||
o.type = 'PConstructor';
|
||||
return seq(bind(o, 'ctor', this.expr(... extraStops, group('(', discard))),
|
||||
// map(anything({ advance: false }), g => o.argumentGroup = g),
|
||||
group('(', bind(o, 'arguments',
|
||||
separatedOrTerminatedBy(
|
||||
this.valuePattern(level, ... extraStops),
|
||||
atom(',')))));
|
||||
});
|
||||
}
|
||||
|
||||
valuePattern(level: number, ... extraStops: Pattern<any>[]): Pattern<ValuePattern> {
|
||||
return withoutSpace(alt<ValuePattern>(
|
||||
valuePattern(... extraStops: Pattern<any>[]): Pattern<ValuePattern> {
|
||||
return alt<ValuePattern>(
|
||||
scope<PCapture>(o => {
|
||||
o.type = 'PCapture';
|
||||
o.inner = { type: 'PDiscard' };
|
||||
return bind(o, 'binder', this.pCaptureBinder);
|
||||
}),
|
||||
scope(o => map(this.pDiscard, _ => o.type = 'PDiscard')),
|
||||
this.pArray(level),
|
||||
this.pDict(level),
|
||||
this.pQuote(level, extraStops),
|
||||
this.pUnquote(level, extraStops),
|
||||
mapm<PConstructor, PConstant | PCapture | PConstructor>(
|
||||
this.pConstructor(level, extraStops),
|
||||
mapm<RawCall, ValuePattern>(
|
||||
this.pRawCall(... extraStops),
|
||||
o => {
|
||||
// if (o.arguments.every(a => a.type === 'PConstant')) {
|
||||
// return succeed({
|
||||
// type: 'PConstant',
|
||||
// value: [... o.ctor, o.argumentGroup],
|
||||
// });
|
||||
// } else
|
||||
if (this.hasCapturesOrDiscards(o.ctor)) {
|
||||
const r = match(this.pCaptureDefaultBinder, o.ctor, null, '(');
|
||||
if (r !== null && o.arguments.length === 1) {
|
||||
if (this.isConstant(o)) {
|
||||
return succeed({ type: 'PConstant', value: o.items });
|
||||
} else if (this.hasCapturesOrDiscards(o.callee)) {
|
||||
const r = match(this.pCaptureBinder, o.callee, null);
|
||||
if (r !== null && o.arguments.length === 1)
|
||||
{
|
||||
const argPat = match(this.valuePattern(), o.arguments[0], null);
|
||||
if (argPat === null) return fail;
|
||||
return succeed({
|
||||
type: 'PCapture',
|
||||
inner: o.arguments[0],
|
||||
inner: argPat,
|
||||
binder: r
|
||||
});
|
||||
} else {
|
||||
return fail;
|
||||
}
|
||||
} else {
|
||||
return succeed(o);
|
||||
const argPats = o.arguments.map(a => match(this.valuePattern(), a, null));
|
||||
if (argPats.some(p => p === null)) return fail;
|
||||
return succeed({
|
||||
type: 'PConstructor',
|
||||
ctor: o.callee,
|
||||
arguments: argPats as ValuePattern[]
|
||||
});
|
||||
}
|
||||
}),
|
||||
scope<PCapture>(o => {
|
||||
o.type = 'PCapture';
|
||||
o.inner = { type: 'PDiscard' };
|
||||
return bind(o, 'binder', this.pCaptureBinder(this.binder(... extraStops)));
|
||||
}),
|
||||
map(this.expr(... extraStops), e => ({ type: 'PConstant', value: e }))
|
||||
));
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class SyndicateTypedParser extends SyndicateParser {
|
||||
binder(... extraStops: Pattern<any>[]): Pattern<Binder> {
|
||||
get binder(): Pattern<Binder> {
|
||||
return scope(o => seq(bind(o, 'id', this.identifier),
|
||||
option(seq(atom(':'),
|
||||
bind(o, 'type', this.type(atom('='), ... extraStops))))));
|
||||
bind(o, 'type', this.type(atom('=')))))));
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Value pattern utilities
|
||||
|
||||
export function patternText(p: ValuePattern): Items {
|
||||
switch (p.type) {
|
||||
case 'PDiscard': return template`_`;
|
||||
case 'PConstant': return p.value;
|
||||
case 'PCapture':
|
||||
{
|
||||
const binderId = { ... p.binder.id, text: '$' + p.binder.id.text };
|
||||
const affix =
|
||||
(p.inner.type === 'PDiscard') ? [] : template`(${patternText(p.inner)})`;
|
||||
if (p.binder.type !== void 0) {
|
||||
return template`${[binderId]}:${p.binder.type}${affix}`;
|
||||
} else {
|
||||
return template`${[binderId]}${affix}`;
|
||||
}
|
||||
}
|
||||
case 'PArray': return template`[${commaJoin(p.elements.map(patternText))}]`;
|
||||
case 'PConstructor': return template`${p.ctor}(${commaJoin(p.arguments.map(patternText))})`;
|
||||
}
|
||||
}
|
||||
|
||||
export function instantiatePatternToPattern(p: ValuePattern): ValuePattern {
|
||||
switch (p.type) {
|
||||
case 'PDiscard': return p;
|
||||
case 'PConstant': return p;
|
||||
case 'PCapture': return { type: 'PConstant', value: [p.binder.id] };
|
||||
case 'PArray':
|
||||
return {
|
||||
type: 'PArray',
|
||||
elements: p.elements.map(instantiatePatternToPattern),
|
||||
};
|
||||
case 'PConstructor':
|
||||
return {
|
||||
type: 'PConstructor',
|
||||
ctor: p.ctor,
|
||||
arguments: p.arguments.map(instantiatePatternToPattern),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const eDiscard: Expr = template`(__SYNDICATE__.Discard._instance)`;
|
||||
const eCapture = (e: Expr): Expr => template`(__SYNDICATE__.Capture(${e}))`;
|
||||
|
||||
export function compilePattern(pattern: ValuePattern): StaticAnalysis {
|
||||
const constPaths: Path[] = [];
|
||||
const constVals: Expr[] = [];
|
||||
const capturePaths: Path[] = [];
|
||||
const captureBinders: Binder[] = [];
|
||||
|
||||
function walk(pattern: ValuePattern): Expr {
|
||||
const currentPath: Path = [];
|
||||
|
||||
function walk(pattern: ValuePattern): [Skeleton<Expr>, Expr] {
|
||||
switch (pattern.type) {
|
||||
case 'PDiscard':
|
||||
return template`(__SYNDICATE__.QuasiValue._)`;
|
||||
return [null, eDiscard];
|
||||
case 'PCapture': {
|
||||
capturePaths.push(currentPath.slice());
|
||||
captureBinders.push(pattern.binder);
|
||||
return template`(__SYNDICATE__.QuasiValue.bind(${walk(pattern.inner)}))`;
|
||||
const [s, a] = walk(pattern.inner);
|
||||
return [s, eCapture(a)];
|
||||
}
|
||||
case 'PConstant':
|
||||
return template`(__SYNDICATE__.QuasiValue.lit(__SYNDICATE__.fromJS(${pattern.value})))`;
|
||||
constPaths.push(currentPath.slice());
|
||||
constVals.push(pattern.value);
|
||||
return [null, pattern.value];
|
||||
case 'PConstructor': {
|
||||
const pieces = [template`${pattern.ctor}`, ... pattern.arguments.map(walk)];
|
||||
return template`(__SYNDICATE__.QuasiValue.ctor(${commaJoin(pieces)}))`;
|
||||
const skel: Skeleton<Expr> = {
|
||||
shape: template`__SYNDICATE__.Skeleton.constructorInfoSignature((${pattern.ctor}).constructorInfo)`,
|
||||
members: [],
|
||||
};
|
||||
const assertionArgs: Expr[] = [];
|
||||
pattern.arguments.forEach((argPat, i) => {
|
||||
currentPath.push(i);
|
||||
const [s, a] = walk(argPat);
|
||||
skel.members.push(s);
|
||||
assertionArgs.push(a);
|
||||
currentPath.pop();
|
||||
});
|
||||
return [skel, template`(${pattern.ctor}(${commaJoin(assertionArgs)}))`];
|
||||
}
|
||||
case 'PArray': {
|
||||
const pieces = pattern.elements.map(walk);
|
||||
return template`(__SYNDICATE__.QuasiValue.arr(${commaJoin(pieces)}))`;
|
||||
const skel: Skeleton<Expr> = {
|
||||
shape: [ {
|
||||
start: startPos(null),
|
||||
end: startPos(null),
|
||||
type: TokenType.STRING,
|
||||
text: JSON.stringify(pattern.elements.length.toString()),
|
||||
} ],
|
||||
members: []
|
||||
};
|
||||
const elements: Expr[] = [];
|
||||
pattern.elements.forEach((elemPat, i) => {
|
||||
currentPath.push(i);
|
||||
const [s, a] = walk(elemPat);
|
||||
skel.members.push(s);
|
||||
elements.push(a);
|
||||
currentPath.pop();
|
||||
});
|
||||
return [skel, template`[${commaJoin(elements)}]`];
|
||||
}
|
||||
case 'PDict': {
|
||||
const pieces = pattern.elements.map(([k, v]) => template`[${k}, ${walk(v)}]`);
|
||||
return template`(__SYNDICATE__.QuasiValue.dict(${commaJoin(pieces)}))`;
|
||||
}
|
||||
case 'PQuote':
|
||||
return template`(__SYNDICATE__.QuasiValue.quote(${walk(pattern.quoted)}))`;
|
||||
case 'PUnquote':
|
||||
return template`(__SYNDICATE__.QuasiValue.unquote(${walk(pattern.unquoted)}))`;
|
||||
case 'POuterUnquote':
|
||||
return template`(__SYNDICATE__.QuasiValue.unquote(${pattern.outer}))`;
|
||||
}
|
||||
}
|
||||
|
||||
const skeleton = walk(pattern);
|
||||
const [skeletonStructure, assertion] = walk(pattern);
|
||||
const skeleton = renderSkeleton(skeletonStructure);
|
||||
|
||||
return {
|
||||
skeleton,
|
||||
constPaths,
|
||||
constVals,
|
||||
capturePaths,
|
||||
captureBinders,
|
||||
assertion,
|
||||
};
|
||||
}
|
||||
|
||||
function renderSkeleton(skel: Skeleton<Expr>): Expr {
|
||||
if (skel === null) {
|
||||
return template`null`;
|
||||
} else {
|
||||
return template`({shape:${skel.shape}, members: [${commaJoin(skel.members.map(renderSkeleton))}]})`;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export * as Grammar from './grammar';
|
||||
export * as Codegen from './codegen';
|
||||
export { compile, CompileOptions } from './codegen';
|
||||
export * as Grammar from './grammar.js';
|
||||
export * as Internals from './internals.js';
|
||||
export * as Codegen from './codegen.js';
|
||||
export { compile, CompileOptions } from './codegen.js';
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
export const BootProc = '__SYNDICATE__bootProc';
|
||||
|
||||
// Keep these definitions in sync with api.ts from the core package
|
||||
//
|
||||
export type NonEmptySkeleton<Shape> = { shape: Shape, members: Skeleton<Shape>[] };
|
||||
export type Skeleton<Shape> = null | NonEmptySkeleton<Shape>;
|
||||
export type Path = Array<number>;
|
|
@ -1,5 +1,20 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
//---------------------------------------------------------------------------
|
||||
// @syndicate-lang/compiler, an implementation of Syndicate dataspaces for JS.
|
||||
// Copyright (C) 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
export * as Syntax from './syntax/index';
|
||||
export * from './compiler/index';
|
||||
export * as Syntax from './syntax/index.js';
|
||||
export * from './compiler/index.js';
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { Token, TokenType, Item, Items, isGroup } from './tokens';
|
||||
import { Pos, startPos, advancePos } from './position';
|
||||
import { vlqEncode } from './vlq';
|
||||
import { SpanInfo } from './span';
|
||||
import { Token, TokenType, Item, Items, isGroup } from './tokens.js';
|
||||
import { Pos, startPos, advancePos } from './position.js';
|
||||
import { vlqEncode } from './vlq.js';
|
||||
import { SpanInfo } from './span.js';
|
||||
|
||||
export interface SourceMap {
|
||||
version: 3;
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export * from './codewriter';
|
||||
export * from './list';
|
||||
export * from './matcher';
|
||||
export * from './position';
|
||||
export * from './reader';
|
||||
export * from './scanner';
|
||||
export * from './span';
|
||||
export * from './template';
|
||||
export * from './tokens';
|
||||
export * from './vlq';
|
||||
export * from './codewriter.js';
|
||||
export * from './list.js';
|
||||
export * from './matcher.js';
|
||||
export * from './position.js';
|
||||
export * from './reader.js';
|
||||
export * from './scanner.js';
|
||||
export * from './span.js';
|
||||
export * from './template.js';
|
||||
export * from './tokens.js';
|
||||
export * from './vlq.js';
|
||||
|
|
|
@ -1,27 +1,23 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export interface List<T, C> extends Iterable<T> {
|
||||
export interface List<T> extends Iterable<T> {
|
||||
item: T | null;
|
||||
next: List<T, C> | null;
|
||||
context: C;
|
||||
next: List<T> | null;
|
||||
|
||||
toArray(): Array<T>;
|
||||
}
|
||||
|
||||
export function atEnd<T, C>(xs: List<T, C>): xs is (List<T, C> & { item: null, next: null }) {
|
||||
export function atEnd<T>(xs: List<T>): xs is (List<T> & { item: null, next: null }) {
|
||||
return xs.item === null;
|
||||
}
|
||||
|
||||
export function notAtEnd<T, C>(xs: List<T, C>): xs is (List<T, C> & { item: T, next: List<T, C> }) {
|
||||
export function notAtEnd<T>(xs: List<T>): xs is (List<T> & { item: T, next: List<T> }) {
|
||||
return xs.item !== null;
|
||||
}
|
||||
|
||||
export class ArrayList<T, C> implements List<T, C> {
|
||||
export class ArrayList<T> implements List<T> {
|
||||
readonly items: Array<T>;
|
||||
readonly index: number = 0;
|
||||
|
||||
constructor(items: Array<T>, public context: C, index = 0) {
|
||||
constructor(items: Array<T>, index = 0) {
|
||||
this.items = items;
|
||||
this.index = index;
|
||||
}
|
||||
|
@ -30,9 +26,9 @@ export class ArrayList<T, C> implements List<T, C> {
|
|||
return this.items[this.index] ?? null;
|
||||
}
|
||||
|
||||
get next(): List<T, C> | null {
|
||||
get next(): List<T> | null {
|
||||
if (this.index >= this.items.length) return null;
|
||||
return new ArrayList(this.items, this.context, this.index + 1);
|
||||
return new ArrayList(this.items, this.index + 1);
|
||||
}
|
||||
|
||||
toArray(): Array<T> {
|
||||
|
@ -40,7 +36,7 @@ export class ArrayList<T, C> implements List<T, C> {
|
|||
}
|
||||
|
||||
[Symbol.iterator](): Iterator<T> {
|
||||
let i: List<T, C> = this;
|
||||
let i: List<T> = this;
|
||||
return {
|
||||
next(): IteratorResult<T> {
|
||||
if (notAtEnd(i)) {
|
||||
|
|
|
@ -1,38 +1,31 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import {
|
||||
Token, TokenType, Items, Item,
|
||||
isGroup, isToken, isSpace, isTokenType,
|
||||
} from './tokens';
|
||||
import { Pos, startPos } from './position';
|
||||
import { List, ArrayList, atEnd, notAtEnd } from './list';
|
||||
} from './tokens.js';
|
||||
import { Pos, startPos } from './position.js';
|
||||
import { List, ArrayList, atEnd, notAtEnd } from './list.js';
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Patterns over Item
|
||||
|
||||
export type ItemContext = string /* the opener of the containing group, if any */ | null;
|
||||
export type ItemList = List<Item, ItemContext>;
|
||||
export type PatternResult<T> = [T, ItemList] | null;
|
||||
export type Pattern<T> = (i: ItemList) => PatternResult<T>;
|
||||
export type PatternResult<T> = [T, List<Item>] | null;
|
||||
export type Pattern<T> = (i: List<Item>) => PatternResult<T>;
|
||||
|
||||
export type PatternTypeArg<P> = P extends Pattern<infer T> ? T : never;
|
||||
|
||||
export function match<T,F>(p: Pattern<T>, items: Items, failure: F, context: ItemContext): T | F {
|
||||
const r = p(new ArrayList(items, context));
|
||||
export function match<T,F>(p: Pattern<T>, items: Items, failure: F): T | F {
|
||||
const r = p(new ArrayList(items));
|
||||
if (r === null) return failure;
|
||||
if (notAtEnd(skipSpace(r[1]))) return failure;
|
||||
return r[0];
|
||||
}
|
||||
|
||||
export const noItems = (c: ItemContext) => new ArrayList([], c);
|
||||
export const noItems = new ArrayList<Item>([]);
|
||||
|
||||
export const fail: Pattern<never> = _i => null;
|
||||
export function succeed<T>(t: T): Pattern<T> { return i => [t, i]; }
|
||||
|
||||
export const discard: Pattern<void> = i => [void 0, noItems(i.context)];
|
||||
export const rest: Pattern<Items> = i => [i.toArray(), noItems(i.context)];
|
||||
export const end: Pattern<void> = i => atEnd(skipSpace(i)) ? [void 0, noItems(i.context)] : null;
|
||||
export const discard: Pattern<void> = _i => [void 0, noItems];
|
||||
export const rest: Pattern<Items> = i => [i.toArray(), noItems];
|
||||
export const end: Pattern<void> = i => atEnd(skipSpace(i)) ? [void 0, noItems] : null;
|
||||
export const pos: Pattern<Pos> = i => notAtEnd(i) ? [i.item.start, i] : null;
|
||||
|
||||
export const newline: Pattern<Item> = i => {
|
||||
|
@ -41,12 +34,12 @@ export const newline: Pattern<Item> = i => {
|
|||
return [i.item, i.next];
|
||||
};
|
||||
|
||||
export function skipSpace(i: ItemList): ItemList {
|
||||
export function skipSpace(i: List<Item>): List<Item> {
|
||||
while (notAtEnd(i) && isSpace(i.item)) i = i.next;
|
||||
return i;
|
||||
}
|
||||
|
||||
export function collectSpace(i: ItemList, acc: Array<Item>): ItemList {
|
||||
export function collectSpace(i: List<Item>, acc: Array<Item>): List<Item> {
|
||||
while (notAtEnd(i) && isSpace(i.item)) {
|
||||
acc.push(i.item);
|
||||
i = i.next;
|
||||
|
@ -82,22 +75,6 @@ export function seq(... patterns: Pattern<any>[]): Pattern<any> {
|
|||
};
|
||||
}
|
||||
|
||||
export function seqTuple<Patterns extends [...Pattern<any>[]]>(
|
||||
... patterns: Patterns
|
||||
): Pattern<{ [I in keyof Patterns]: PatternTypeArg<Patterns[I]> } & { length: Patterns['length'] }>
|
||||
{
|
||||
return i => {
|
||||
const rs = [];
|
||||
for (const p of patterns) {
|
||||
const r = p(i);
|
||||
if (r === null) return null;
|
||||
rs.push(r[0]);
|
||||
i = r[1];
|
||||
}
|
||||
return [rs as unknown as PatternTypeArg<ReturnType<typeof seqTuple<Patterns>>>, i];
|
||||
};
|
||||
}
|
||||
|
||||
export function alt<T>(... alts: Pattern<T>[]): Pattern<T> {
|
||||
return i => {
|
||||
for (const a of alts) {
|
||||
|
@ -135,7 +112,7 @@ export function bind<T, K extends keyof T>(target: T, key: K, pattern: Pattern<T
|
|||
};
|
||||
}
|
||||
|
||||
export function exec(thunk: (i: ItemList) => void): Pattern<void> {
|
||||
export function exec(thunk: (i: List<Item>) => void): Pattern<void> {
|
||||
return i => {
|
||||
thunk(i);
|
||||
return [void 0, i];
|
||||
|
@ -176,7 +153,7 @@ export function group<T>(opener: string, items: Pattern<T>, options: GroupOption
|
|||
if (!notAtEnd(i)) return null;
|
||||
if (!isGroup(i.item)) return null;
|
||||
if (i.item.open.text !== opener) return null;
|
||||
const r = items(new ArrayList(i.item.items, opener));
|
||||
const r = items(new ArrayList(i.item.items));
|
||||
if (r === null) return null;
|
||||
if (!atEnd(r[1])) return null;
|
||||
return [r[0], (options.advance ?? true) ? i.next : i];
|
||||
|
@ -223,7 +200,7 @@ export function upTo(p: Pattern<any>): Pattern<Items> {
|
|||
export function separatedBy<T>(itemPattern: Pattern<T>, separator: Pattern<any>): Pattern<T[]> {
|
||||
return i => {
|
||||
const acc: T[] = [];
|
||||
if (end(i) !== null) return [acc, noItems(i.context)];
|
||||
if (end(i) !== null) return [acc, noItems];
|
||||
while (true) {
|
||||
{
|
||||
const r = itemPattern(i);
|
||||
|
@ -234,7 +211,7 @@ export function separatedBy<T>(itemPattern: Pattern<T>, separator: Pattern<any>)
|
|||
{
|
||||
const r = separator(i);
|
||||
if (r === null) {
|
||||
if (end(i) !== null) return [acc, noItems(i.context)];
|
||||
if (end(i) !== null) return [acc, noItems];
|
||||
return null;
|
||||
}
|
||||
i = r[1];
|
||||
|
@ -243,34 +220,6 @@ export function separatedBy<T>(itemPattern: Pattern<T>, separator: Pattern<any>)
|
|||
};
|
||||
}
|
||||
|
||||
export function separatedOrTerminatedBy<T>(
|
||||
itemPattern: Pattern<T>,
|
||||
separator: Pattern<any>,
|
||||
): Pattern<T[]> {
|
||||
return i => {
|
||||
const acc: T[] = [];
|
||||
if (end(i) !== null) return [acc, noItems(i.context)];
|
||||
while (true) {
|
||||
{
|
||||
const r = itemPattern(i);
|
||||
if (r === null) return null;
|
||||
acc.push(r[0]);
|
||||
i = r[1];
|
||||
}
|
||||
{
|
||||
const r = separator(i);
|
||||
if (r === null) {
|
||||
if (end(i) !== null) return [acc, noItems(i.context)];
|
||||
return null;
|
||||
} else {
|
||||
i = r[1];
|
||||
if (end(i) !== null) return [acc, noItems(i.context)];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export interface RepeatOptions {
|
||||
min?: number;
|
||||
max?: number;
|
||||
|
@ -310,13 +259,12 @@ export function option<T>(p: Pattern<T>): Pattern<T[]> {
|
|||
|
||||
export function replace<T>(
|
||||
items: Items,
|
||||
outerContext: ItemContext,
|
||||
p: Pattern<T>,
|
||||
f: (t: T, start: Pos, end: Pos) => Items,
|
||||
end: Pos = items.length > 0 ? items[items.length - 1].end : startPos(null),
|
||||
) : Items {
|
||||
const walkItems = (items: Items, end: Pos, context: ItemContext): Items => {
|
||||
let i: ItemList = new ArrayList(items, context);
|
||||
end: Pos = items.length > 0 ? items[items.length - 1].end : startPos(null)) : Items
|
||||
{
|
||||
const walkItems = (items: Items, end: Pos): Items => {
|
||||
let i: List<Item> = new ArrayList(items);
|
||||
const acc: Items = [];
|
||||
while (notAtEnd(i = collectSpace(i, acc))) {
|
||||
const r = p(i);
|
||||
|
@ -330,14 +278,11 @@ export function replace<T>(
|
|||
acc.push(i.item);
|
||||
i = i.next;
|
||||
} else {
|
||||
acc.push({
|
||||
... i.item,
|
||||
items: walkItems(i.item.items, i.item.end, i.item.open.text),
|
||||
});
|
||||
acc.push({ ... i.item, items: walkItems(i.item.items, i.item.end) });
|
||||
i = i.next;
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
};
|
||||
return walkItems(items, end, outerContext);
|
||||
return walkItems(items, end);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export interface Pos {
|
||||
line: number;
|
||||
column: number;
|
||||
|
@ -9,10 +6,6 @@ export interface Pos {
|
|||
fixed?: boolean;
|
||||
}
|
||||
|
||||
export function formatPos(p?: Pos): string {
|
||||
return p ? `${p.name ?? '?'}:${p.line}:${p.column}` : '?';
|
||||
}
|
||||
|
||||
export function startPos(name: string | null): Pos {
|
||||
return { line: 1, column: 0, pos: 0, name };
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { TokenType, Token, Group, GroupInProgress, Item, Items, finishGroup } from './tokens';
|
||||
import { Pos, startPos } from './position';
|
||||
import { Scanner, StringScanner } from './scanner';
|
||||
import { TokenType, Token, Group, GroupInProgress, Item, Items, finishGroup } from './tokens.js';
|
||||
import { Pos, startPos } from './position.js';
|
||||
import { Scanner, StringScanner } from './scanner.js';
|
||||
|
||||
function matchingParen(c: string): string | null {
|
||||
switch (c) {
|
||||
|
@ -134,10 +131,23 @@ export class LaxReader implements IterableIterator<Item> {
|
|||
case TokenType.SPACE:
|
||||
case TokenType.NEWLINE:
|
||||
case TokenType.ATOM:
|
||||
this.drop();
|
||||
if (g === null) {
|
||||
this.drop();
|
||||
return t;
|
||||
}
|
||||
if (t.text === ';') {
|
||||
while ('(['.indexOf(g.open.text) >= 0) {
|
||||
this.stack.pop();
|
||||
const outer = this.stackTop();
|
||||
if (outer === null) {
|
||||
// do not drop the semicolon here
|
||||
return finishGroup(g, t.start);
|
||||
}
|
||||
outer.items.push(finishGroup(g, t.start));
|
||||
g = outer;
|
||||
}
|
||||
}
|
||||
this.drop();
|
||||
g.items.push(t);
|
||||
break;
|
||||
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { TokenType, Token, Item, GroupInProgress } from './tokens';
|
||||
import { Pos, advancePos } from './position';
|
||||
import { TokenType, Token, Item, GroupInProgress } from './tokens.js';
|
||||
import { Pos, advancePos } from './position.js';
|
||||
|
||||
export abstract class Scanner implements IterableIterator<Token> {
|
||||
readonly pos: Pos;
|
||||
readonly synthetic: boolean | undefined;
|
||||
charBuffer: string | null = null;
|
||||
tokenBuffer: Token | null = null;
|
||||
delimiters = ' \t\n\r\'"`.,;()[]{}/\\';
|
||||
delimiters = ' \t\n\r\'"`.,;()[]{}/';
|
||||
|
||||
constructor(pos: Pos, synthetic?: boolean) {
|
||||
this.pos = { ... pos };
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
export class SpanResult<T> {
|
||||
readonly searchTarget: number;
|
||||
readonly start: number;
|
||||
|
@ -33,17 +30,17 @@ export class SpanIndex<T> {
|
|||
let lo = 0;
|
||||
let hi = this.index.length;
|
||||
|
||||
// console.log(`\nsearching for ${pos}`);
|
||||
// console.log(`\nsearching for ${target}`);
|
||||
while (true) {
|
||||
if (lo === hi) {
|
||||
if (lo === 0) return null;
|
||||
const e = this.index[lo - 1];
|
||||
if (e[0] > pos) throw new Error("INTERNAL ERROR: bad binary search (1)");
|
||||
if (this.index[lo]?.[0] <= pos) throw new Error("INTERNAL ERROR: bad binary search (2)");
|
||||
// console.log(`found ${JSON.stringify(e)}, ${JSON.stringify(this.index[lo] ?? null)}`);
|
||||
// console.log(`found ${JSON.stringify(e)}, ${JSON.stringify(items[lo] ?? null)}`);
|
||||
const r = new SpanResult<T>(pos, e[0]);
|
||||
e[1].forEach(([end, item]) => {
|
||||
if (pos <= end) {
|
||||
if (pos < end) {
|
||||
r.items.push({ end, item });
|
||||
}
|
||||
});
|
||||
|
@ -53,7 +50,7 @@ export class SpanIndex<T> {
|
|||
const mid = (lo + hi) >> 1;
|
||||
const e = this.index[mid];
|
||||
|
||||
// console.log(`${pos} lo ${lo} hi ${hi} mid ${mid} probe ${JSON.stringify(e)}`);
|
||||
// console.log(`${target} lo ${lo} hi ${hi} mid ${mid} probe ${JSON.stringify([e[0], e[1].target])}`);
|
||||
|
||||
if (e[0] <= pos) {
|
||||
lo = mid + 1;
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { Items } from './tokens';
|
||||
import { Pos, startPos } from './position';
|
||||
import { laxRead, LaxReadOptions } from './reader';
|
||||
import * as M from './matcher';
|
||||
import { Items } from './tokens.js';
|
||||
import { Pos, startPos } from './position.js';
|
||||
import { laxRead, LaxReadOptions } from './reader.js';
|
||||
import * as M from './matcher.js';
|
||||
|
||||
const substPat = M.scope((o: { pos: Pos }) =>
|
||||
M.seq(M.atom('$'),
|
||||
|
@ -29,7 +26,7 @@ export class Templates {
|
|||
this.readOptions = readOptions;
|
||||
}
|
||||
|
||||
template(start0: Pos | string = this.defaultPos, context: M.ItemContext = null): TemplateFunction {
|
||||
template(start0: Pos | string = this.defaultPos): TemplateFunction {
|
||||
const start = (typeof start0 === 'string') ? startPos(start0) : start0;
|
||||
return (consts, ... vars) => {
|
||||
const sourcePieces = [consts[0]];
|
||||
|
@ -53,7 +50,6 @@ export class Templates {
|
|||
(this.readOptions.extraDelimiters ?? '') + '$',
|
||||
synthetic: true,
|
||||
}),
|
||||
context,
|
||||
substPat,
|
||||
sub => toItems(this.readOptions, vars[i++], sub.pos));
|
||||
};
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { Pos } from './position';
|
||||
import { Pos } from './position.js';
|
||||
|
||||
export enum TokenType {
|
||||
SPACE,
|
||||
|
@ -34,14 +31,6 @@ export type Items = Array<Item>;
|
|||
|
||||
export type GroupInProgress = Omit<Group, 'end'>;
|
||||
|
||||
export function getRange(t: Item | Items): TokenBase {
|
||||
if (Array.isArray(t)) {
|
||||
return { start: t[0].start, end: t[t.length - 1].end, synthetic: true };
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
export function finishGroup(g: GroupInProgress, end: Pos): Group {
|
||||
return { ... g, end };
|
||||
}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
const inverse_alphabet =
|
||||
new Map<string, number>(Object.entries(alphabet).map(([i,c])=>[c,parseInt(i)]));
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2023-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
const __SYNDICATE__ = Syndicate;
|
||||
const currentSyndicateTarget = Syndicate.Dataspace.global;
|
||||
|
||||
(() => {
|
||||
async function translateScripts() {
|
||||
if (SchemaReady) await SchemaReady;
|
||||
|
||||
const syndicateScripts =
|
||||
Array.from(document.getElementsByTagName('script'))
|
||||
.filter(s => (s.type === 'text/javascript+syndicate' ||
|
||||
s.type === 'syndicate' ||
|
||||
s.type === 'module+syndicate'));
|
||||
|
||||
for (const script of syndicateScripts) {
|
||||
const isModule = script.type === 'module+syndicate';
|
||||
|
||||
const sourceUrl = script.src || script.getAttribute('data-src') || false;
|
||||
const sourceCode = sourceUrl ? await (await fetch(sourceUrl)).text() : script.innerHTML;
|
||||
|
||||
const compilationResult = SyndicateCompiler.compile({
|
||||
name: sourceUrl || script.id || 'anonymous-script-tag',
|
||||
source: sourceCode,
|
||||
module: isModule ? 'es6' : 'none',
|
||||
runtime: isModule ? void 0 : 'Syndicate',
|
||||
emitError: console.error,
|
||||
});
|
||||
|
||||
const sourceMap = { ... compilationResult.map };
|
||||
sourceMap.sourcesContent = [sourceCode];
|
||||
const formattedSourceMap = '\n//# sourceMappingURL=data:application/json;base64,' +
|
||||
Syndicate.Bytes.from(JSON.stringify(sourceMap)).toBase64();
|
||||
const finalOutput = compilationResult.text + formattedSourceMap;
|
||||
|
||||
// console.log(finalOutput);
|
||||
|
||||
const replacement = document.createElement('script');
|
||||
replacement.text = finalOutput;
|
||||
if (isModule) replacement.type = 'module';
|
||||
script.parentNode.replaceChild(replacement, script);
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', translateScripts);
|
||||
})();
|
|
@ -1,262 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { compile, CompileOptions, Syntax } from '../src/index';
|
||||
import Pos = Syntax.Pos;
|
||||
import './test-utils';
|
||||
import { js as format } from 'js-beautify';
|
||||
|
||||
type Error = { message: string, start: Pos | undefined, end: Pos | undefined };
|
||||
|
||||
function translate(source: string, options: Partial<CompileOptions> = {}): { code: string, errors: Error[] } {
|
||||
const errors: Error[] = [];
|
||||
const result = compile({
|
||||
... options,
|
||||
module: 'none',
|
||||
source,
|
||||
emitError: (message, start, end) => errors.push({ message, start, end }),
|
||||
});
|
||||
return { code: result.text, errors };
|
||||
}
|
||||
|
||||
function translateNoErrors(source: string, options?: Partial<CompileOptions>): string {
|
||||
const o = translate(source, options);
|
||||
expect(o.errors.length).toBe(0);
|
||||
return o.code;
|
||||
}
|
||||
|
||||
function expectCodeEqual(input: string, output: string, options?: Partial<CompileOptions>) {
|
||||
expect(format(translateNoErrors(input, options))).toBe(format(output));
|
||||
}
|
||||
|
||||
describe('react', () => {
|
||||
|
||||
it('without label', () => expectCodeEqual(`react { a; b; c; }`, `
|
||||
__SYNDICATE__.Turn.active.facet(() => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
a; b; c;
|
||||
});`));
|
||||
|
||||
it('with label', () => expectCodeEqual(`someLabel: react { a; b; c; }`, `
|
||||
__SYNDICATE__.Turn.active.facet(() => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
const someLabel = currentSyndicateFacet;
|
||||
a; b; c;
|
||||
});`));
|
||||
|
||||
});
|
||||
|
||||
describe('spawn', () => {
|
||||
|
||||
it('without name', () => expectCodeEqual(`spawn { a; b; c; }`, `
|
||||
__SYNDICATE__.Dataspace._spawn(() => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
a; b; c;
|
||||
});`));
|
||||
|
||||
it('with name', () => expectCodeEqual(`spawn named 'foo' { a; b; c; }`, `
|
||||
__SYNDICATE__.Dataspace._spawn(() => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
currentSyndicateFacet.actor.name = 'foo';
|
||||
a; b; c;
|
||||
});`));
|
||||
|
||||
// At present, the expr() parser accepts *empty input*. TODO: something better.
|
||||
it('with missing name (known incorrect parsing and codegen)', () =>
|
||||
expectCodeEqual(`spawn named { a; b; c; }`, `
|
||||
__SYNDICATE__.Dataspace._spawn(() => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
currentSyndicateFacet.actor.name = ;
|
||||
a; b; c;
|
||||
});`));
|
||||
|
||||
});
|
||||
|
||||
describe('stop', () => {
|
||||
|
||||
it('non-statement', () => expectCodeEqual(`(stop)`, `(stop)`));
|
||||
it('toplevel end-delimited statement', () => expectCodeEqual(`stop`, `
|
||||
__SYNDICATE__.Turn.active._stop(currentSyndicateFacet, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
});`));
|
||||
it('nested end-delimited statement', () => expectCodeEqual(`{ stop }`, `
|
||||
{
|
||||
__SYNDICATE__.Turn.active._stop(currentSyndicateFacet, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
});
|
||||
}`));
|
||||
|
||||
it('without facet, without body', () => expectCodeEqual(`stop;`, `
|
||||
__SYNDICATE__.Turn.active._stop(currentSyndicateFacet, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
});`));
|
||||
|
||||
it('without facet, empty body', () => expectCodeEqual(`stop {}`, `
|
||||
__SYNDICATE__.Turn.active._stop(currentSyndicateFacet, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
});`));
|
||||
|
||||
it('without facet, non-empty body', () => expectCodeEqual(`stop { a; b; }`, `
|
||||
__SYNDICATE__.Turn.active._stop(currentSyndicateFacet, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
a; b;
|
||||
});`));
|
||||
|
||||
it('with facet, without body', () => expectCodeEqual(`stop x.y;`, `
|
||||
__SYNDICATE__.Turn.active._stop(x.y, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
});`));
|
||||
|
||||
it('with facet, empty body', () => expectCodeEqual(`stop x.y {}`, `
|
||||
__SYNDICATE__.Turn.active._stop(x.y, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
});`));
|
||||
|
||||
it('with facet, non-empty body', () => expectCodeEqual(`stop x.y { a; b; }`, `
|
||||
__SYNDICATE__.Turn.active._stop(x.y, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
a; b;
|
||||
});`));
|
||||
|
||||
it('nested stop, no labels', () => expectCodeEqual(`stop { stop; }`, `
|
||||
__SYNDICATE__.Turn.active._stop(currentSyndicateFacet, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
__SYNDICATE__.Turn.active._stop(currentSyndicateFacet, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
});
|
||||
});`));
|
||||
|
||||
});
|
||||
|
||||
describe('during', () => {
|
||||
|
||||
it('stop in body', () => expectCodeEqual(`during P => { a; stop; b; }`, `
|
||||
__SYNDICATE__.Turn.active.assertDataflow(() => ({
|
||||
target: currentSyndicateTarget,
|
||||
assertion: __SYNDICATE__.Observe({
|
||||
pattern: __SYNDICATE__.QuasiValue.finish((__SYNDICATE__.QuasiValue.lit(__SYNDICATE__.fromJS(P)))),
|
||||
observer: __SYNDICATE__.Turn.ref(__SYNDICATE__.assertionFacetObserver(
|
||||
(__vs) => {
|
||||
if (Array.isArray(__vs)) {
|
||||
|
||||
a;
|
||||
__SYNDICATE__.Turn.active._stop(currentSyndicateFacet, () => {
|
||||
const currentSyndicateFacet = __SYNDICATE__.Turn.activeFacet;
|
||||
});
|
||||
b;
|
||||
}
|
||||
}
|
||||
))
|
||||
})
|
||||
}));`));
|
||||
|
||||
it('capture with type at top', () => expectCodeEqual(`during $v: T => { ok() }`, `
|
||||
__SYNDICATE__.Turn.active.assertDataflow(() => ({
|
||||
target: currentSyndicateTarget,
|
||||
assertion: __SYNDICATE__.Observe({
|
||||
pattern: __SYNDICATE__.QuasiValue.finish((__SYNDICATE__.QuasiValue.bind((__SYNDICATE__.QuasiValue._)))),
|
||||
observer: __SYNDICATE__.Turn.ref(__SYNDICATE__.assertionFacetObserver(
|
||||
(__vs: __SYNDICATE__.AnyValue) => {
|
||||
if (Array.isArray(__vs)) {
|
||||
const __v_0 = T.__from_preserve__(__vs[0]);
|
||||
if (__v_0 === void 0) return;
|
||||
const v = __v_0;
|
||||
ok()
|
||||
}
|
||||
}
|
||||
))
|
||||
})
|
||||
}));
|
||||
`, { typescript: true }));
|
||||
|
||||
});
|
||||
|
||||
describe('once', () => {
|
||||
it('basics with block', () => expectCodeEqual(`once asserted P => { a; b; }`, `
|
||||
__SYNDICATE__.Turn.active.facet(() => {
|
||||
const __once_facet = __SYNDICATE__.Turn.activeFacet;
|
||||
__SYNDICATE__.Turn.active.assertDataflow(() => ({
|
||||
target: currentSyndicateTarget,
|
||||
assertion: __SYNDICATE__.Observe({
|
||||
pattern: __SYNDICATE__.QuasiValue.finish((__SYNDICATE__.QuasiValue.lit(__SYNDICATE__.fromJS(P)))),
|
||||
observer: __SYNDICATE__.Turn.ref({
|
||||
assert: (__vs, __handle) => {
|
||||
if (Array.isArray(__vs)) {
|
||||
|
||||
__SYNDICATE__.Turn.active._stop(__once_facet, () => { a; b; })
|
||||
}
|
||||
}
|
||||
}),
|
||||
})
|
||||
}));
|
||||
});`));
|
||||
|
||||
it('basics with statement', () => expectCodeEqual(`once asserted P => x;`, `
|
||||
__SYNDICATE__.Turn.active.facet(() => {
|
||||
const __once_facet = __SYNDICATE__.Turn.activeFacet;
|
||||
__SYNDICATE__.Turn.active.assertDataflow(() => ({
|
||||
target: currentSyndicateTarget,
|
||||
assertion: __SYNDICATE__.Observe({
|
||||
pattern: __SYNDICATE__.QuasiValue.finish((__SYNDICATE__.QuasiValue.lit(__SYNDICATE__.fromJS(P)))),
|
||||
observer: __SYNDICATE__.Turn.ref({
|
||||
assert: (__vs, __handle) => {
|
||||
if (Array.isArray(__vs)) {
|
||||
|
||||
__SYNDICATE__.Turn.active._stop(__once_facet, () => {x;})
|
||||
}
|
||||
}
|
||||
}),
|
||||
})
|
||||
}));
|
||||
});`));
|
||||
|
||||
});
|
||||
|
||||
describe('on', () => {
|
||||
it('message with guard', () => expectCodeEqual(`
|
||||
on message S.Focus(entity) when (isLast.value) => {
|
||||
text.node.focus();
|
||||
}`, `__SYNDICATE__.Turn.active.assertDataflow(() => (isLast.value) ?
|
||||
({
|
||||
target: currentSyndicateTarget,
|
||||
assertion: __SYNDICATE__.Observe({
|
||||
pattern: __SYNDICATE__.QuasiValue.finish((__SYNDICATE__.QuasiValue.ctor(S.Focus, (__SYNDICATE__.QuasiValue.lit(__SYNDICATE__.fromJS(entity)))))),
|
||||
observer: __SYNDICATE__.Turn.ref({
|
||||
message: (__vs) => {
|
||||
if (Array.isArray(__vs)) {
|
||||
|
||||
|
||||
text.node.focus();
|
||||
|
||||
}
|
||||
}
|
||||
}),
|
||||
})
|
||||
}) :
|
||||
({
|
||||
target: void 0,
|
||||
assertion: void 0
|
||||
}));`));
|
||||
|
||||
it('asserted with guard', () => expectCodeEqual(`on asserted P when (someTest) => x;`, `
|
||||
__SYNDICATE__.Turn.active.assertDataflow(() => (someTest) ?
|
||||
({
|
||||
target: currentSyndicateTarget,
|
||||
assertion: __SYNDICATE__.Observe({
|
||||
pattern: __SYNDICATE__.QuasiValue.finish((__SYNDICATE__.QuasiValue.lit(__SYNDICATE__.fromJS(P)))),
|
||||
observer: __SYNDICATE__.Turn.ref({
|
||||
assert: (__vs, __handle) => {
|
||||
if (Array.isArray(__vs)) {
|
||||
|
||||
x;
|
||||
}
|
||||
}
|
||||
}),
|
||||
})
|
||||
}) :
|
||||
({
|
||||
target: void 0,
|
||||
assertion: void 0
|
||||
}));`));
|
||||
|
||||
});
|
|
@ -1,30 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { Grammar, Syntax } from '../src/index';
|
||||
import './test-utils';
|
||||
|
||||
describe('statement boundary', () => {
|
||||
function stmt(input: string): [string, string] | null {
|
||||
const parser = new Grammar.SyndicateParser();
|
||||
const tree = Syntax.laxRead(input);
|
||||
const items: Syntax.Items = [];
|
||||
const r = parser.statement(items)(new Syntax.ArrayList(tree, '{'));
|
||||
if (r === null) return null;
|
||||
return [Syntax.itemText(items), Syntax.itemText(r[1].toArray())];
|
||||
}
|
||||
|
||||
it('should include semicolon', () => {
|
||||
expect(stmt('i am a statement ; ')).toEqual(['i am a statement;', ' ']);
|
||||
});
|
||||
|
||||
it('should include newline', () => {
|
||||
expect(stmt('i am a statement \n ')).toEqual(['i am a statement\n', ' ']);
|
||||
});
|
||||
|
||||
it('should include closing brace on the same line', () => {
|
||||
// Note that `" remainder is in outer group"` is discarded by `laxRead`.
|
||||
expect(stmt('i am a statement } remainder is in outer group'))
|
||||
.toEqual(['i am a statement', '']);
|
||||
});
|
||||
});
|
|
@ -1,38 +0,0 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { is, preserves } from '@preserves/core';
|
||||
|
||||
declare global {
|
||||
namespace jest {
|
||||
interface Matchers<R> {
|
||||
is(expected: any): R;
|
||||
toThrowFilter(f: (e: Error) => boolean): R;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expect.extend({
|
||||
is(actual, expected) {
|
||||
return is(actual, expected)
|
||||
? { message: () => preserves`expected ${actual} not to be Preserves.is to ${expected}`,
|
||||
pass: true }
|
||||
: { message: () => preserves`expected ${actual} to be Preserves.is to ${expected}`,
|
||||
pass: false };
|
||||
},
|
||||
|
||||
toThrowFilter(thunk, f) {
|
||||
try {
|
||||
thunk();
|
||||
return { message: () => preserves`expected an exception`, pass: false };
|
||||
} catch (e) {
|
||||
if (f(e)) {
|
||||
return { message: () => preserves`expected an exception not matching the filter`,
|
||||
pass: true };
|
||||
} else {
|
||||
return { message: () => preserves`expected an exception matching the filter: ${(e as any)?.constructor?.name}`,
|
||||
pass: false };
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,674 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
@ -0,0 +1 @@
|
|||
gpl-3.0.txt
|
|
@ -0,0 +1 @@
|
|||
../../Makefile.generic-package
|
|
@ -1,13 +1,25 @@
|
|||
#!/usr/bin/env node
|
||||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
//---------------------------------------------------------------------------
|
||||
// @syndicate-lang/core, an implementation of Syndicate dataspaces for JS.
|
||||
// Copyright (C) 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
import {
|
||||
Pattern as P,
|
||||
assertObserve,
|
||||
Record,
|
||||
Dataspace, Turn,
|
||||
} from '..';
|
||||
const { bootModule, Dataspace, Skeleton, Ground, Record, Discard, Capture, Observe } = require('..');
|
||||
const __ = Discard._instance;
|
||||
const _$ = Capture(__);
|
||||
|
||||
const BoxState = Record.makeConstructor()(Symbol.for('BoxState'), ['value']);
|
||||
const SetBox = Record.makeConstructor()(Symbol.for('SetBox'), ['newValue']);
|
||||
|
@ -16,51 +28,63 @@ const N = 100000;
|
|||
|
||||
console.time('box-and-client-' + N.toString());
|
||||
|
||||
Dataspace.boot(ds => {
|
||||
Turn.active.spawn(() => {
|
||||
Turn.activeFacet.actor.name = 'box';
|
||||
const boxValue = Turn.active.field(0, 'value');
|
||||
|
||||
Turn.active.assertDataflow(() => {
|
||||
// console.log('recomputing published BoxState', boxValue.value);
|
||||
return {
|
||||
target: ds,
|
||||
assertion: BoxState(boxValue.value),
|
||||
};
|
||||
function boot(thisFacet) {
|
||||
thisFacet.spawn('box', function (thisFacet) {
|
||||
thisFacet.declareField(this, 'value', 0);
|
||||
thisFacet.addEndpoint(() => {
|
||||
// console.log('recomputing published BoxState', this.value);
|
||||
return { assertion: BoxState(this.value), analysis: null };
|
||||
});
|
||||
|
||||
Turn.active.dataflow(() => {
|
||||
// console.log('dataflow saw new value', boxValue.value);
|
||||
if (boxValue.value === N) {
|
||||
Turn.active.stop(Turn.activeFacet, () => {
|
||||
thisFacet.addDataflow(() => {
|
||||
// console.log('dataflow saw new value', this.value);
|
||||
if (this.value === N) {
|
||||
thisFacet.stop(() => {
|
||||
console.log('terminated box root facet');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
assertObserve(ds, P.rec(SetBox.constructorInfo.label, P.bind()), {
|
||||
message([v]) {
|
||||
boxValue.value = v;
|
||||
// console.log('box updated value', v);
|
||||
}
|
||||
thisFacet.addEndpoint(() => {
|
||||
let analysis = Skeleton.analyzeAssertion(SetBox(_$));
|
||||
analysis.callback = thisFacet.wrap((thisFacet, evt, vs) => {
|
||||
if (evt === Skeleton.EventType.MESSAGE) {
|
||||
thisFacet.scheduleScript(() => {
|
||||
this.value = vs[0];
|
||||
// console.log('box updated value', vs[0]);
|
||||
});
|
||||
}
|
||||
});
|
||||
return { assertion: Observe(SetBox(_$)), analysis };
|
||||
});
|
||||
});
|
||||
|
||||
Turn.active.spawn(() => {
|
||||
Turn.activeFacet.actor.name = 'client';
|
||||
|
||||
assertObserve(ds, P.rec(BoxState.constructorInfo.label, P.bind()), {
|
||||
assert([v], _handle) {
|
||||
// console.log('client sending SetBox', v + 1);
|
||||
Turn.active.message(ds, SetBox(v + 1));
|
||||
}
|
||||
thisFacet.spawn('client', function (thisFacet) {
|
||||
thisFacet.addEndpoint(() => {
|
||||
let analysis = Skeleton.analyzeAssertion(BoxState(_$));
|
||||
analysis.callback = thisFacet.wrap((thisFacet, evt, [v]) => {
|
||||
if (evt === Skeleton.EventType.ADDED) {
|
||||
thisFacet.scheduleScript(() => {
|
||||
// console.log('client sending SetBox', v + 1);
|
||||
thisFacet.send(SetBox(v + 1));
|
||||
});
|
||||
}
|
||||
});
|
||||
return { assertion: Observe(BoxState(_$)), analysis };
|
||||
});
|
||||
|
||||
assertObserve(ds, P.rec(BoxState.constructorInfo.label, P._), {
|
||||
retract() {
|
||||
console.log('box gone');
|
||||
console.timeEnd('box-and-client-' + N.toString());
|
||||
}
|
||||
thisFacet.addEndpoint(() => {
|
||||
let analysis = Skeleton.analyzeAssertion(BoxState(__));
|
||||
analysis.callback = thisFacet.wrap((thisFacet, evt, _vs) => {
|
||||
if (evt === Skeleton.EventType.REMOVED) {
|
||||
thisFacet.scheduleScript(() => {
|
||||
console.log('box gone');
|
||||
});
|
||||
}
|
||||
});
|
||||
return { assertion: Observe(BoxState(__)), analysis };
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
thisFacet.actor.dataspace.ground().addStopHandler(() =>
|
||||
console.timeEnd('box-and-client-' + N.toString()));
|
||||
}
|
||||
|
||||
bootModule(boot);
|
||||
|
|
|
@ -1,66 +1,99 @@
|
|||
#!/usr/bin/env -S npx ts-node -O '{"module": "commonjs"}'
|
||||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
//---------------------------------------------------------------------------
|
||||
// @syndicate-lang/core, an implementation of Syndicate dataspaces for JS.
|
||||
// Copyright (C) 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
import {
|
||||
Pattern as P,
|
||||
assertObserve,
|
||||
Record,
|
||||
Dataspace, Turn,
|
||||
} from '..';
|
||||
import { bootModule, Skeleton, Record, Discard, Capture, Observe, Facet, Value } from '..';
|
||||
const __ = Discard._instance;
|
||||
const _$ = Capture(__);
|
||||
|
||||
const BoxState = Record.makeConstructor<{value: number}>()(Symbol.for('BoxState'), ['value']);
|
||||
const SetBox = Record.makeConstructor<{newValue: number}>()(Symbol.for('SetBox'), ['newValue']);
|
||||
// The current pattern representation puts Capture and Discard record
|
||||
// instances into Record fields, so those record fields have to be
|
||||
// prepared to type them, which is why we see `number | Pattern` here
|
||||
// rather than the ideal `number`.
|
||||
//
|
||||
type Pattern = ReturnType<typeof Capture> | ReturnType<typeof Discard>;
|
||||
const BoxState = Record.makeConstructor<{value: number | Pattern}>()(Symbol.for('BoxState'), ['value']);
|
||||
const SetBox = Record.makeConstructor<{newValue: number | Pattern}>()(Symbol.for('SetBox'), ['newValue']);
|
||||
|
||||
const N = 100000;
|
||||
|
||||
console.time('box-and-client-' + N.toString());
|
||||
|
||||
Dataspace.boot(ds => {
|
||||
Turn.active.spawn(() => {
|
||||
Turn.activeFacet.actor.name = 'box';
|
||||
const boxValue = Turn.active.field<number>(0, 'value');
|
||||
|
||||
Turn.active.assertDataflow(() => {
|
||||
// console.log('recomputing published BoxState', boxValue.value);
|
||||
return {
|
||||
target: ds,
|
||||
assertion: BoxState(boxValue.value),
|
||||
};
|
||||
function boot(thisFacet: Facet<{}>) {
|
||||
thisFacet.spawn<{ value: number }>('box', function (thisFacet) {
|
||||
thisFacet.declareField(this, 'value', 0);
|
||||
thisFacet.addEndpoint(function () {
|
||||
// console.log('recomputing published BoxState', this.value);
|
||||
return { assertion: BoxState(this.value), analysis: null };
|
||||
});
|
||||
|
||||
Turn.active.dataflow(() => {
|
||||
// console.log('dataflow saw new value', boxValue.value);
|
||||
if (boxValue.value === N) {
|
||||
Turn.active.stop(Turn.activeFacet, () => {
|
||||
thisFacet.addDataflow(function () {
|
||||
// console.log('dataflow saw new value', this.value);
|
||||
if (this.value === N) {
|
||||
thisFacet.stop(function () {
|
||||
console.log('terminated box root facet');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
assertObserve(ds, P.rec(SetBox.constructorInfo.label, P.bind()), {
|
||||
message([v]: [number]) {
|
||||
boxValue.value = v;
|
||||
// console.log('box updated value', v);
|
||||
}
|
||||
thisFacet.addEndpoint(function () {
|
||||
let analysis = Skeleton.analyzeAssertion(SetBox(_$));
|
||||
analysis.callback = thisFacet.wrap(function (thisFacet, evt, [v]) {
|
||||
if (evt === Skeleton.EventType.MESSAGE) {
|
||||
if (typeof v !== 'number') return;
|
||||
thisFacet.scheduleScript(function () {
|
||||
this.value = v;
|
||||
// console.log('box updated value', v);
|
||||
});
|
||||
}
|
||||
});
|
||||
return { assertion: Observe(SetBox(_$)), analysis };
|
||||
});
|
||||
});
|
||||
|
||||
Turn.active.spawn(() => {
|
||||
Turn.activeFacet.actor.name = 'client';
|
||||
|
||||
assertObserve(ds, P.rec(BoxState.constructorInfo.label, P.bind()), {
|
||||
assert([v]: [number], _handle) {
|
||||
// console.log('client sending SetBox', v + 1);
|
||||
Turn.active.message(ds, SetBox(v + 1));
|
||||
}
|
||||
thisFacet.spawn('client', function (thisFacet: Facet<{}>) {
|
||||
thisFacet.addEndpoint(function () {
|
||||
let analysis = Skeleton.analyzeAssertion(BoxState(_$));
|
||||
analysis.callback = thisFacet.wrap(function (thisFacet, evt, [v]) {
|
||||
if (evt === Skeleton.EventType.ADDED) {
|
||||
if (typeof v !== 'number') return;
|
||||
thisFacet.scheduleScript(function () {
|
||||
// console.log('client sending SetBox', v + 1);
|
||||
thisFacet.send(SetBox(v + 1));
|
||||
});
|
||||
}
|
||||
});
|
||||
return { assertion: Observe(BoxState(_$)), analysis };
|
||||
});
|
||||
|
||||
assertObserve(ds, P.rec(BoxState.constructorInfo.label, P._), {
|
||||
retract() {
|
||||
console.log('box gone');
|
||||
console.timeEnd('box-and-client-' + N.toString());
|
||||
}
|
||||
thisFacet.addEndpoint(function () {
|
||||
let analysis = Skeleton.analyzeAssertion(BoxState(__));
|
||||
analysis.callback = thisFacet.wrap(function (thisFacet, evt, _vs) {
|
||||
if (evt === Skeleton.EventType.REMOVED) {
|
||||
thisFacet.scheduleScript(function () {
|
||||
console.log('box gone');
|
||||
});
|
||||
}
|
||||
});
|
||||
return { assertion: Observe(BoxState(__)), analysis };
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
thisFacet.actor.dataspace.ground().addStopHandler(function () {
|
||||
console.timeEnd('box-and-client-' + N.toString());
|
||||
});
|
||||
}
|
||||
|
||||
bootModule(boot);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
import 'preserves';
|
||||
|
||||
export default {
|
||||
preset: 'ts-jest',
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
version 1 .
|
||||
embeddedType EntityRef.Cap .
|
||||
|
||||
ActionDescription =
|
||||
/ @spawnActor <spawn-actor @detail OptionalAny @initialAssertions #{protocol.Handle}>
|
||||
/ @stopActor <stop-actor @error OptionalAny>
|
||||
/ @inertCheck <inert-check>
|
||||
/ <assert @target #:any @crossSpace bool @handle protocol.Handle @assertion any>
|
||||
/ <retract @target #:any @crossSpace bool @handle protocol.Handle>
|
||||
/ <message @target #:any @assertion any>
|
||||
/ <sync @target #:any @callback #:any>
|
||||
.
|
||||
|
||||
OptionalAny = <none> / <some @value any> .
|
|
@ -1,41 +1,27 @@
|
|||
{
|
||||
"name": "@syndicate-lang/core",
|
||||
"version": "0.34.1",
|
||||
"version": "0.6.0",
|
||||
"description": "Syndicate/JS for browser and node.js",
|
||||
"homepage": "https://github.com/syndicate-lang/syndicate-js/tree/main/packages/core",
|
||||
"homepage": "https://github.com/syndicate-lang/syndicate-js/tree/master/packages/core",
|
||||
"license": "GPL-3.0+",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.syndicate-lang.org/syndicate-lang/syndicate-js"
|
||||
},
|
||||
"repository": "github:syndicate-lang/syndicate-js",
|
||||
"scripts": {
|
||||
"prepare": "yarn regenerate && yarn compile && yarn rollup",
|
||||
"regenerate": "rm -rf ./src/gen && preserves-schema-ts --module EntityRef=./src/runtime/actor.ts --output ./src/gen './protocols/schemas' './local-protocols/schemas'",
|
||||
"regenerate:watch": "yarn regenerate --watch",
|
||||
"prepare": "yarn compile && yarn rollup",
|
||||
"compile": "../../node_modules/.bin/tsc",
|
||||
"compile:watch": "../../node_modules/.bin/tsc -w",
|
||||
"rollup": "../../node_modules/.bin/rollup -c",
|
||||
"rollup:watch": "../../node_modules/.bin/rollup -c -w",
|
||||
"test": "../../node_modules/.bin/jest",
|
||||
"cover": "../../node_modules/.bin/nyc --reporter=html ../../node_modules/.bin/jest",
|
||||
"clean": "rm -rf lib dist ./src/gen",
|
||||
"veryclean": "yarn run clean && rm -rf node_modules"
|
||||
"cover": "../../node_modules/.bin/nyc --reporter=html ../../node_modules/.bin/jest"
|
||||
},
|
||||
"main": "dist/syndicate.js",
|
||||
"module": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||
"devDependencies": {
|
||||
"@preserves/core": "^0.995.200",
|
||||
"@preserves/schema-cli": "^0.995.201"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@preserves/core": ">=0.995.200"
|
||||
},
|
||||
"dependencies": {
|
||||
"salty-crypto": "^0.3.1"
|
||||
"@preserves/core": "0.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
all: schema-bundle.bin
|
||||
|
||||
clean:
|
||||
rm -f schema-bundle.bin
|
||||
|
||||
schema-bundle.bin: schemas/*.prs
|
||||
preserves-schemac schemas > $@.tmp
|
||||
mv $@.tmp $@
|
|
@ -1,44 +0,0 @@
|
|||
´³bundle·µ³tcp„´³schema·³version°³definitions·³TcpLocal´³rec´³lit³ tcp-local„´³tupleµ´³named³host´³atom³String„„´³named³port´³atom³
SignedInteger„„„„„³ TcpRemote´³rec´³lit³
|
||||
tcp-remote„´³tupleµ´³named³host´³atom³String„„´³named³port´³atom³
SignedInteger„„„„„³TcpPeerInfo´³rec´³lit³tcp-peer„´³tupleµ´³named³handle´³embedded³any„„´³named³local´³refµ„³TcpLocal„„´³named³remote´³refµ„³ TcpRemote„„„„„„³embeddedType´³refµ³ EntityRef„³Cap„„„µ³http„´³schema·³version°³definitions·³Chunk´³orµµ±string´³atom³String„„µ±bytes´³atom³
|
||||
ByteString„„„„³Headers´³dictof´³atom³Symbol„´³atom³String„„³MimeType´³atom³Symbol„³
|
||||
QueryValue´³orµµ±string´³atom³String„„µ±file´³rec´³lit³file„´³tupleµ´³named³filename´³atom³String„„´³named³headers´³refµ„³Headers„„´³named³body´³atom³
|
||||
ByteString„„„„„„„„³HostPattern´³orµµ±host´³atom³String„„µ±any´³lit€„„„„³HttpBinding´³rec´³lit³ http-bind„´³tupleµ´³named³host´³refµ„³HostPattern„„´³named³port´³atom³
SignedInteger„„´³named³method´³refµ„³
MethodPattern„„´³named³path´³refµ„³PathPattern„„´³named³handler´³embedded´³refµ„³HttpRequest„„„„„„³HttpContext´³rec´³lit³request„´³tupleµ´³named³req´³refµ„³HttpRequest„„´³named³res´³embedded´³refµ„³HttpResponse„„„„„„³HttpRequest´³rec´³lit³http-request„´³tupleµ´³named³sequenceNumber´³atom³
SignedInteger„„´³named³host´³refµ„³RequestHost„„´³named³port´³atom³
SignedInteger„„´³named³method´³atom³Symbol„„´³named³path´³seqof´³atom³String„„„´³named³headers´³refµ„³Headers„„´³named³query´³dictof´³atom³Symbol„´³seqof´³refµ„³
|
||||
QueryValue„„„„´³named³body´³refµ„³RequestBody„„„„„³HttpService´³rec´³lit³http-service„´³tupleµ´³named³host´³refµ„³HostPattern„„´³named³port´³atom³
SignedInteger„„´³named³method´³refµ„³
MethodPattern„„´³named³path´³refµ„³PathPattern„„„„„³PathPattern´³seqof´³refµ„³PathPatternElement„„³RequestBody´³orµµ±present´³atom³
|
||||
ByteString„„µ±absent´³lit€„„„„³RequestHost´³orµµ±present´³atom³String„„µ±absent´³lit€„„„„³HttpListener´³rec´³lit³
http-listener„´³tupleµ´³named³port´³atom³
SignedInteger„„„„„³HttpResponse´³orµµ±status´³rec´³lit³status„´³tupleµ´³named³code´³atom³
SignedInteger„„´³named³message´³atom³String„„„„„„µ±header´³rec´³lit³header„´³tupleµ´³named³name´³atom³Symbol„„´³named³value´³atom³String„„„„„„µ±chunk´³rec´³lit³chunk„´³tupleµ´³named³chunk´³refµ„³Chunk„„„„„„µ±done´³rec´³lit³done„´³tupleµ´³named³chunk´³refµ„³Chunk„„„„„„„„³
MethodPattern´³orµµ±any´³lit€„„µ±specific´³atom³Symbol„„„„³PathPatternElement´³orµµ±label´³atom³String„„µ±wildcard´³lit³_„„µ±rest´³lit³...„„„„„³embeddedType€„„µ³noise„´³schema·³version°³definitions·³Packet´³orµµ±complete´³atom³
|
||||
ByteString„„µ±
|
||||
fragmented´³seqof´³atom³
|
||||
ByteString„„„„„³ Initiator´³rec´³lit³ initiator„´³tupleµ´³named³initiatorSession´³embedded´³refµ„³Packet„„„„„„³ NoiseSpec´³andµ´³dict·³key´³named³key´³atom³
|
||||
ByteString„„³service´³named³service´³refµ„³ServiceSelector„„„„´³named³protocol´³refµ„³
NoiseProtocol„„´³named³
preSharedKeys´³refµ„³NoisePreSharedKeys„„„„³SessionItem´³orµµ± Initiator´³refµ„³ Initiator„„µ±Packet´³refµ„³Packet„„„„³
NoiseProtocol´³orµµ±present´³dict·³protocol´³named³protocol´³atom³String„„„„„µ±invalid´³dict·³protocol´³named³protocol³any„„„„µ±absent´³dict·„„„„„³
NoiseStepType´³lit³noise„³SecretKeyField´³orµµ±present´³dict·³ secretKey´³named³ secretKey´³atom³
|
||||
ByteString„„„„„µ±invalid´³dict·³ secretKey´³named³ secretKey³any„„„„µ±absent´³dict·„„„„„³DefaultProtocol´³lit±!Noise_NK_25519_ChaChaPoly_BLAKE2s„³NoiseStepDetail´³refµ„³ServiceSelector„³ServiceSelector³any³NoiseServiceSpec´³andµ´³named³base´³refµ„³ NoiseSpec„„´³named³ secretKey´³refµ„³SecretKeyField„„„„³NoisePreSharedKeys´³orµµ±present´³dict·³
preSharedKeys´³named³
preSharedKeys´³seqof´³atom³
|
||||
ByteString„„„„„„µ±invalid´³dict·³
preSharedKeys´³named³
preSharedKeys³any„„„„µ±absent´³dict·„„„„„³NoisePathStepDetail´³refµ„³ NoiseSpec„³NoiseDescriptionDetail´³refµ„³NoiseServiceSpec„„³embeddedType´³refµ³ EntityRef„³Cap„„„µ³timer„´³schema·³version°³definitions·³SetTimer´³rec´³lit³ set-timer„´³tupleµ´³named³label³any„´³named³seconds´³atom³Double„„´³named³kind´³refµ„³ TimerKind„„„„„³ LaterThan´³rec´³lit³
|
||||
later-than„´³tupleµ´³named³seconds´³atom³Double„„„„„³ TimerKind´³orµµ±relative´³lit³relative„„µ±absolute´³lit³absolute„„µ±clear´³lit³clear„„„„³TimerExpired´³rec´³lit³
timer-expired„´³tupleµ´³named³label³any„´³named³seconds´³atom³Double„„„„„„³embeddedType€„„µ³trace„´³schema·³version°³definitions·³Oid³any³Name´³orµµ± anonymous´³rec´³lit³ anonymous„´³tupleµ„„„„µ±named´³rec´³lit³named„´³tupleµ´³named³name³any„„„„„„„³Target´³rec´³lit³entity„´³tupleµ´³named³actor´³refµ„³ActorId„„´³named³facet´³refµ„³FacetId„„´³named³oid´³refµ„³Oid„„„„„³TaskId³any³TurnId³any³ActorId³any³FacetId³any³ TurnCause´³orµµ±turn´³rec´³lit³ caused-by„´³tupleµ´³named³id´³refµ„³TurnId„„„„„„µ±cleanup´³rec´³lit³cleanup„´³tupleµ„„„„µ±linkedTaskRelease´³rec´³lit³linked-task-release„´³tupleµ´³named³id´³refµ„³TaskId„„´³named³reason´³refµ„³LinkedTaskReleaseReason„„„„„„µ±periodicActivation´³rec´³lit³periodic-activation„´³tupleµ´³named³period´³atom³Double„„„„„„µ±delay´³rec´³lit³delay„´³tupleµ´³named³causingTurn´³refµ„³TurnId„„´³named³amount´³atom³Double„„„„„„µ±external´³rec´³lit³external„´³tupleµ´³named³description³any„„„„„„„³ TurnEvent´³orµµ±assert´³rec´³lit³assert„´³tupleµ´³named³ assertion´³refµ„³AssertionDescription„„´³named³handle´³refµ³protocol„³Handle„„„„„„µ±retract´³rec´³lit³retract„´³tupleµ´³named³handle´³refµ³protocol„³Handle„„„„„„µ±message´³rec´³lit³message„´³tupleµ´³named³body´³refµ„³AssertionDescription„„„„„„µ±sync´³rec´³lit³sync„´³tupleµ´³named³peer´³refµ„³Target„„„„„„µ± breakLink´³rec´³lit³
|
||||
break-link„´³tupleµ´³named³source´³refµ„³ActorId„„´³named³handle´³refµ³protocol„³Handle„„„„„„„„³
|
||||
ExitStatus´³orµµ±ok´³lit³ok„„µ±Error´³refµ³protocol„³Error„„„„³
|
||||
TraceEntry´³rec´³lit³trace„´³tupleµ´³named³ timestamp´³atom³Double„„´³named³actor´³refµ„³ActorId„„´³named³item´³refµ„³ActorActivation„„„„„³ActorActivation´³orµµ±start´³rec´³lit³start„´³tupleµ´³named³ actorName´³refµ„³Name„„„„„„µ±turn´³refµ„³TurnDescription„„µ±stop´³rec´³lit³stop„´³tupleµ´³named³status´³refµ„³
|
||||
ExitStatus„„„„„„„„³FacetStopReason´³orµµ±explicitAction´³lit³explicit-action„„µ±inert´³lit³inert„„µ±parentStopping´³lit³parent-stopping„„µ±
actorStopping´³lit³actor-stopping„„„„³TurnDescription´³rec´³lit³turn„´³tupleµ´³named³id´³refµ„³TurnId„„´³named³cause´³refµ„³ TurnCause„„´³named³actions´³seqof´³refµ„³ActionDescription„„„„„„³ActionDescription´³orµµ±dequeue´³rec´³lit³dequeue„´³tupleµ´³named³event´³refµ„³TargetedTurnEvent„„„„„„µ±enqueue´³rec´³lit³enqueue„´³tupleµ´³named³event´³refµ„³TargetedTurnEvent„„„„„„µ±dequeueInternal´³rec´³lit³dequeue-internal„´³tupleµ´³named³event´³refµ„³TargetedTurnEvent„„„„„„µ±enqueueInternal´³rec´³lit³enqueue-internal„´³tupleµ´³named³event´³refµ„³TargetedTurnEvent„„„„„„µ±spawn´³rec´³lit³spawn„´³tupleµ´³named³link´³atom³Boolean„„´³named³id´³refµ„³ActorId„„„„„„µ±link´³rec´³lit³link„´³tupleµ´³named³parentActor´³refµ„³ActorId„„´³named³
childToParent´³refµ³protocol„³Handle„„´³named³
|
||||
childActor´³refµ„³ActorId„„´³named³
parentToChild´³refµ³protocol„³Handle„„„„„„µ±
|
||||
facetStart´³rec´³lit³facet-start„´³tupleµ´³named³path´³seqof´³refµ„³FacetId„„„„„„„µ± facetStop´³rec´³lit³
|
||||
facet-stop„´³tupleµ´³named³path´³seqof´³refµ„³FacetId„„„´³named³reason´³refµ„³FacetStopReason„„„„„„µ±linkedTaskStart´³rec´³lit³linked-task-start„´³tupleµ´³named³taskName´³refµ„³Name„„´³named³id´³refµ„³TaskId„„„„„„„„³TargetedTurnEvent´³rec´³lit³event„´³tupleµ´³named³target´³refµ„³Target„„´³named³detail´³refµ„³ TurnEvent„„„„„³AssertionDescription´³orµµ±value´³rec´³lit³value„´³tupleµ´³named³value³any„„„„„µ±opaque´³rec´³lit³opaque„´³tupleµ´³named³description³any„„„„„„„³LinkedTaskReleaseReason´³orµµ± cancelled´³lit³ cancelled„„µ±normal´³lit³normal„„„„„³embeddedType´³refµ³ EntityRef„³Cap„„„µ³stdenv„´³schema·³version°³definitions·³
StandardRoute´³orµµ±standard´³tuplePrefixµ´³named³
|
||||
transports´³seqof´³refµ„³StandardTransport„„„´³named³key´³atom³
|
||||
ByteString„„´³named³service³any„´³named³sig´³atom³
|
||||
ByteString„„´³named³oid³any„„´³named³caveats´³seqof´³refµ³sturdy„³Caveat„„„„„µ±general´³refµ³
|
||||
gatekeeper„³Route„„„„³StandardTransport´³orµµ±wsUrl´³atom³String„„µ±other³any„„„„³embeddedType€„„µ³stream„´³schema·³version°³definitions·³Mode´³orµµ±bytes´³lit³bytes„„µ±lines´³refµ„³LineMode„„µ±packet´³rec´³lit³packet„´³tupleµ´³named³size´³atom³
SignedInteger„„„„„„µ±object´³rec´³lit³object„´³tupleµ´³named³description³any„„„„„„„³Sink´³orµµ±source´³rec´³lit³source„´³tupleµ´³named³
|
||||
controller´³embedded´³refµ„³Source„„„„„„„µ±StreamError´³refµ„³StreamError„„µ±data´³rec´³lit³data„´³tupleµ´³named³payload³any„´³named³mode´³refµ„³Mode„„„„„„µ±eof´³rec´³lit³eof„´³tupleµ„„„„„„³Source´³orµµ±sink´³rec´³lit³sink„´³tupleµ´³named³
|
||||
controller´³embedded´³refµ„³Sink„„„„„„„µ±StreamError´³refµ„³StreamError„„µ±credit´³rec´³lit³credit„´³tupleµ´³named³amount´³refµ„³CreditAmount„„´³named³mode´³refµ„³Mode„„„„„„„„³LineMode´³orµµ±lf´³lit³lf„„µ±crlf´³lit³crlf„„„„³StreamError´³rec´³lit³error„´³tupleµ´³named³message´³atom³String„„„„„³CreditAmount´³orµµ±count´³atom³
SignedInteger„„µ± unbounded´³lit³ unbounded„„„„³StreamConnection´³rec´³lit³stream-connection„´³tupleµ´³named³source´³embedded´³refµ„³Source„„„´³named³sink´³embedded´³refµ„³Sink„„„´³named³spec³any„„„„³StreamListenerError´³rec´³lit³stream-listener-error„´³tupleµ´³named³spec³any„´³named³message´³atom³String„„„„„³StreamListenerReady´³rec´³lit³stream-listener-ready„´³tupleµ´³named³spec³any„„„„„³embeddedType´³refµ³ EntityRef„³Cap„„„µ³sturdy„´³schema·³version°³definitions·³Lit´³rec´³lit³lit„´³tupleµ´³named³value³any„„„„³Oid´³atom³
SignedInteger„³Alts´³rec´³lit³or„´³tupleµ´³named³alternatives´³seqof´³refµ„³Rewrite„„„„„„³PAnd´³rec´³lit³and„´³tupleµ´³named³patterns´³seqof´³refµ„³Pattern„„„„„„³PNot´³rec´³lit³not„´³tupleµ´³named³pattern´³refµ„³Pattern„„„„„³TRef´³rec´³lit³ref„´³tupleµ´³named³binding´³atom³
SignedInteger„„„„„³PAtom´³orµµ±Boolean´³lit³Boolean„„µ±Double´³lit³Double„„µ±
SignedInteger´³lit³
SignedInteger„„µ±String´³lit³String„„µ±
|
||||
ByteString´³lit³
|
||||
ByteString„„µ±Symbol´³lit³Symbol„„„„³PBind´³rec´³lit³bind„´³tupleµ´³named³pattern´³refµ„³Pattern„„„„„³Caveat´³orµµ±Rewrite´³refµ„³Rewrite„„µ±Alts´³refµ„³Alts„„µ±Reject´³refµ„³Reject„„µ±unknown³any„„„³Reject´³rec´³lit³reject„´³tupleµ´³named³pattern´³refµ„³Pattern„„„„„³Pattern´³orµµ±PDiscard´³refµ„³PDiscard„„µ±PAtom´³refµ„³PAtom„„µ± PEmbedded´³refµ„³ PEmbedded„„µ±PBind´³refµ„³PBind„„µ±PAnd´³refµ„³PAnd„„µ±PNot´³refµ„³PNot„„µ±Lit´³refµ„³Lit„„µ± PCompound´³refµ„³ PCompound„„„„³Rewrite´³rec´³lit³rewrite„´³tupleµ´³named³pattern´³refµ„³Pattern„„´³named³template´³refµ„³Template„„„„„³WireRef´³orµµ±mine´³tupleµ´³lit° |