Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Concatenated block format: Difference between revisions

From triplescripts.org wiki
Content added Content deleted
No edit summary
(→‎Delimiters: rm "scriptwrap")
Line 7: Line 7:
== Delimiters ==
== Delimiters ==


The scriptwrap trick is what allows triple scripts to run in various legacy runtimes, including Web browsers and JS engines. The triple script dialect was carefully designed so the triple slash script delimiters that appear in compilation form indicating the beginning and end of a given module are not just valid tokens for the triple script compiler, but for valid sequences according to the ECMA-262 grammar and for a Web browser expecting markup according to the HTML5 standard.
The clever design and use of triple slash script delimiters is what allows triple scripts to run in various legacy runtimes, including Web browsers and JS engines. The triple script dialect was carefully designed so the triple slash script delimiters that appear in compilation form indicating the beginning and end of a given module are not just valid tokens for the triple script compiler, but are valid sequences according to the ECMA-262 grammar and for a Web browser expecting markup to be parsing using the HTML5 parsing algorithm.


The file format permits, as an alternative to [[t-block]]s, delimiters that look like <code>//? &lt;script&gt;</code> and <code>//? &lt;/script&gt;</code> to denote a [[g-block]]s. Files comprising a sequence of g-blocks are not meant to have strong guarantees about the contents the way that t-blocks do. The [[trplkt/publish|trplkt publish command]] may be used to convert a valid program into a triple script for wide distribution. Programs that are *not* valid triple scripts (because they fail to abide by the three [[invariants]]) may repurpose the triple script tooling to produce files comprising a sequence of g-blocks instead, so as not to confuse recipients.
The file format permits, as an alternative to [[t-block]]s, delimiters that look like <code>//? &lt;script&gt;</code> and <code>//? &lt;/script&gt;</code> to denote a [[g-block]]s. Files comprising a sequence of g-blocks are not meant to have strong guarantees about the contents the way that t-blocks do. The [[trplkt/publish|trplkt publish command]] may be used to convert a valid program into a triple script for wide distribution. Programs that are *not* valid triple scripts (because they fail to abide by the three [[invariants]]) may repurpose the triple script tooling to produce files comprising a sequence of g-blocks instead, so as not to confuse recipients.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.