forked from TiddlyWiki/TiddlyWiki5
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
209 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
editions/tw5.com/tiddlers/macros/syntax/Macro Definition Syntax.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
editions/tw5.com/tiddlers/macros/syntax/Procedure Call Syntax.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
created: 20240310165023000 | ||
modified: 20240310172648116 | ||
tags: [[Procedure Syntax]] | ||
title: Procedure Call Syntax | ||
type: text/vnd.tiddlywiki | ||
|
||
<<.preamble """What follows is a formal presentation of the syntax of the WikiText syntax for procedure calls, using [[railroad diagrams|Railroad Diagrams]].""">> | ||
|
||
!! procedure-name | ||
|
||
<$railroad text=""" | ||
"<<" [[ procedure-name |Procedures]] [: [[whitespace|"Filter Whitespace"]] [:{param-value}] ]">>" | ||
"""/> | ||
|
||
* The [[procedure's|Procedures]] <<.place procedure-name>> is a sequence of non-whitespace characters other than `(` or `>`. | ||
|
||
* <<.place whitespace>> denotes a sequence of [[whitespace characters|Filter Whitespace]]. | ||
|
||
!!! param-value | ||
|
||
Each ''individual'' <<.place param-value>> has the following syntax: | ||
|
||
<$railroad text=""" | ||
\start none | ||
\end none | ||
[: param-name [:[[whitespace|"Filter Whitespace"]]] ":" [:[[whitespace|"Filter Whitespace"]]] ] value [: [[whitespace|"Filter Whitespace"]] ] | ||
"""/> | ||
|
||
* The <<.place param-name>> is a sequence of letters (`A`--`Z`, `a`--`z`), digits (`0`--`9`), hyphens (`-`) and underscores (`_`). | ||
|
||
* The <<.place value>> is specified as follows: | ||
|
||
<$railroad text={{$:/editions/tw5.com/railroad/macro-parameter-value}}/> |
93 changes: 93 additions & 0 deletions
93
editions/tw5.com/tiddlers/macros/syntax/Procedure Definition Syntax.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
created: 20240310165023000 | ||
modified: 20240310175033730 | ||
tags: [[Procedure Syntax]] | ||
title: Procedure Definition Syntax | ||
type: text/vnd.tiddlywiki | ||
|
||
<<.preamble """What follows is a formal presentation of the syntax of the [[Pragma: \procedure]], using [[railroad diagrams|Railroad Diagrams]]. """>> | ||
|
||
! \procedure | ||
|
||
There are 2 types of procedure definitions | ||
|
||
* Single line definitions | ||
* Multi line definitions | ||
|
||
!! Single Line | ||
|
||
Single line definitions should only be used for very short bodies, where the procedure name, params and the body fit into 1 line terminated with a line-feed. | ||
|
||
<$railroad text=""" | ||
"\procedure" | ||
[[<"space">|"Filter Whitespace"]] | ||
"procedure-name" | ||
<"(params)"> | ||
[:[[<"space">|"Filter Whitespace"]]] | ||
"body" | ||
"lf" | ||
"""/> | ||
|
||
!! Multi Line | ||
|
||
The majority of procedure definitions will have a body, that spans over several lines of wikitext. Those procedure definitions are terminated using the "\end" pragma | ||
|
||
<$railroad text=""" | ||
"\procedure" | ||
[[<"space">|"Filter Whitespace"]] | ||
"procedure-name" | ||
<"(params)"> | ||
[:[[<"space">|"Filter Whitespace"]]] | ||
body | ||
"\end" | ||
"""/> | ||
|
||
The [[procedure-name|Procedures]] is a sequence of non-whitespace characters other than `(` or `>`. | ||
|
||
|
||
* <<.place procedure-name>> is a sequence of letters (`A`--`Z`, `a`--`z`), digits (`0`--`9`), hyphens (`-`) and underscores (`_`) | ||
* <<.place body>> is wikitext including [[nested procedures|Pragma: \procedure]] | ||
* <<.place space>> denotes a sequence of [[whitespace characters|Filter Whitespace]] | ||
|
||
!! params | ||
|
||
The parameter declaration list <<.place (params)>> has the following syntax: | ||
|
||
<$railroad text=""" | ||
\start none | ||
\end none | ||
"(" [:"sep"] [:{ parameter "sep" }] ")" | ||
"""/> | ||
|
||
* <<.place sep>> is any sequence of characters that does not match a <<.place param-name>>. <br>Among other things, this includes commas, spaces and linefeeds. | ||
|
||
|
||
Each ''individual'' <<.place parameter>> has the following syntax: | ||
|
||
<$railroad text=""" | ||
\start none | ||
\end none | ||
"param-name" [: [:[[<"space">|"Filter Whitespace"]]] ":" [:[[<"space">|"Filter Whitespace"]]] default ] | ||
"""/> | ||
|
||
* <<.place param-name>> is a sequence of letters (`A`--`Z`, `a`--`z`), digits (`0`--`9`), hyphens (`-`) and underscores (`_`). | ||
|
||
* <<.place default>> is an optional value of a parameter is specified as follows: | ||
|
||
<$railroad text={{$:/editions/tw5.com/railroad/macro-parameter-value}}/> | ||
|
||
!! body | ||
|
||
The <<.place body>> of the definition has the following syntax: | ||
|
||
<$railroad text=""" | ||
\start none | ||
\end none | ||
{[[<"wikitext">|WikiText]] "lf"} | ||
"""/> | ||
|
||
* <<.place wikitext>> is any sequence of characters that doesn't terminate the macro definition. | ||
** If [[nested procedures|Pragma: \procedure]] are used they need to be at the start of the wikitext. There are the same rules as if the wikitext would be in a tiddler. | ||
** Pragmas need to be before standard wikitext. | ||
|
||
* <<.place lf>> denotes a linefeed. | ||
|
11 changes: 11 additions & 0 deletions
11
editions/tw5.com/tiddlers/macros/syntax/Procedure Syntax.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
created: 20240310165023000 | ||
modified: 20240310173318213 | ||
tags: Procedures | ||
title: Procedure Syntax | ||
type: text/vnd.tiddlywiki | ||
|
||
Plain text description can be found at [[Procedures]] | ||
|
||
<<list-links filter:"[tag[Procedure Syntax]]">> | ||
|
||
<<.tip "The railroad boxes in the linked tiddlers can be used to navigate.">> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.