Fossil

Check-in [a1e415291c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Clarified the double-quoting and {} quoting rules for TH1 in the docs.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a1e415291c8be5ff69c061b11d2ff885e675eabda176c6b1e797ac224811e263
User & Date: wyoung 2021-08-02 08:49:52.654
Context
2021-08-02
10:09
Typo fix in previous ... (check-in: e3066edea3 user: wyoung tags: trunk)
08:49
Clarified the double-quoting and {} quoting rules for TH1 in the docs. ... (check-in: a1e415291c user: wyoung tags: trunk)
2021-07-26
20:07
Fix typo on the /stat page. ... (check-in: 9860f1ea44 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to www/th1.md.
38
39
40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
Each command is terminated by the first *unescaped* newline or ";" character.
The text of the command (excluding the newline or semicolon terminator)
is broken into space-separated tokens.  The first token is the command
name and subsequent tokens are the arguments.  In this sense, TH1 syntax
is similar to the familiar command-line shell syntax.

A token is any sequence of characters other than whitespace and semicolons.
Or, all text without double-quotes is a single token even if it includes
whitespace and semicolons.  Or, all text within nested {...} pairs is a
single token.


The nested {...} form of tokens is important because it allows TH1 commands
to have an appearance similar to C/C++.  It is important to remember, though,
that a TH1 script is really just a list of text commands, not a context-free
language with a grammar like C/C++.  This can be confusing to long-time
C/C++ programmers because TH1 does look a lot like C/C++, but the semantics
of TH1 are closer to FORTH or Lisp than they are to C.







|
|
|
>







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Each command is terminated by the first *unescaped* newline or ";" character.
The text of the command (excluding the newline or semicolon terminator)
is broken into space-separated tokens.  The first token is the command
name and subsequent tokens are the arguments.  In this sense, TH1 syntax
is similar to the familiar command-line shell syntax.

A token is any sequence of characters other than whitespace and semicolons.
Text inside double-quotes is a single token even if it includes
whitespace and semicolons. Text within {...} pairs is also a
single token, which is useful because curly braces are easier to “pair”
and nest properly than doubloe-quotes.

The nested {...} form of tokens is important because it allows TH1 commands
to have an appearance similar to C/C++.  It is important to remember, though,
that a TH1 script is really just a list of text commands, not a context-free
language with a grammar like C/C++.  This can be confusing to long-time
C/C++ programmers because TH1 does look a lot like C/C++, but the semantics
of TH1 are closer to FORTH or Lisp than they are to C.